I'm using memoir to produce a book with lots of margin paragraphs and side captions. I'd prefer that these elements be ragged on the outside and flush on the inside (e.g., on a recto page they would be flush left and ragged right). I thought that was the default, but I'm getting fully justified paragraphs. A search of the memoir manual has not enlightened me. I'd appreciate any help.
David
Document Classes ⇒ memoir class: get ragged marginalia?
NEW: TikZ book now 40% off at Amazon.com for a short time.

memoir class: get ragged marginalia?
Hi David,
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.
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
Code, edit and compile here:
\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}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Re: memoir class: get ragged marginalia?
Thank you! This works perfectly in my document. I'm not much of a programmer, but I'll see if I can use your model to get side captions ragged also. Thanks too for the reference to ragged2e package; I wasn't familiar with it.
David
David
memoir class: get ragged marginalia?
You are welcome.
Additionally, the memoir class provides the \captionstyle command that allows you to obtain ragged captions; (see the manual, page 188).
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).
1,1,2,3,5,8,13,21,34,55,89,144,233,...
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