Document Classes ⇒ memoir class: get ragged marginalia?
memoir class: get ragged marginalia?
David
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
memoir class: get ragged marginalia?
in the following code I defined the \ragmarpar command that will typeset raggedright margin notes on an odd page and raggedleft margin notes on an even page. I used the \RaggedRight and \RaggedLeft commands from the ragged2e package to allow hyphenation inside the margin notes.
Code: Select all
\documentclass{memoir}
\usepackage{ifthen}
\usepackage{ragged2e}
\usepackage{lipsum}% just to automatically generate some text
\newcounter{pl}
\newcommand\ragmarpar[1]{%
\stepcounter{pl}\label{pl-\thepl}%
\ifthenelse{\isodd{\pageref{pl-\thepl}}}%
{\marginpar{\RaggedRight #1}}
{\marginpar{\RaggedLeft #1}}
}
\begin{document}
\lipsum[1]
\ragmarpar{\lipsum[1]}
\lipsum[1-4]
\ragmarpar{\lipsum[1]}
\lipsum[1-4]
\end{document}
Re: memoir class: get ragged marginalia?
David
memoir class: get ragged marginalia?
The caption package implements this option. Please refer to the package documentation (Section 2.2 "Justification", pages 8 and 9).magister wrote:...I'll see if I can use your model to get side captions ragged also...
Additionally, the memoir class provides the \captionstyle command that allows you to obtain ragged captions; (see the manual, page 188).
memoir class: get ragged marginalia?
Yes, that's one thing I really like about memoir--it does many things that eliminate the need for separate packages (with possible conflicts). I used the caption package in the past but rarely need it now that I use memoir for projects of any length. My notion that memoir could do ragged right margin pars was probably misremembered info about ragged right captions. Back to the manual!Additionally, the memoir class provides the \captionstyle command
David