I am trying to get margin notes (using scrlayer-notecolumn) to align left or right, depending on wether they appear on a odd or even page in a twoside scrbook. The following works fine so far:

\usepackage[left=2 cm,right=2 cm,bottom=6cm]{geometry}


        \ifoddpage \raggedright\footnotesize






Yet, when the notes break pages (the main reason I use scrlayer-notecolumn instead of the normal \marginpar) the text alignment stays the same.

Is there a way to make it switch automatically?

  • I can't see what you describe: here I get a marginnote on p. 1 on the right, which continues on p. 2 in the left margin. Other way round on p2/3. Seems ok! Maybe update your tex-installation? – Keks Dose Dec 20 '19 at 14:51
  • no, that is how it is supposed to be. the problem is the text alignment: a note on even pages (in the left margin) should be \raggedleft, when the note appears in the right margin it should instead be \raggedright. if the note, however, continues from one page to the next, it keeps its text alignment when, in fact, I want it to change according to my definition. – moritzklenk Dec 21 '19 at 13:52

After some try & error I guess that the marginnote is typeset (raggedright, raggedleft, whatever) completely at shipout of the page were it begins. I tried things like


...but without success.

So my answer is that you can't change the layout of a marginnote at pagebreak without a hack of the internals of KOMA-script.

However, while testing I noticed that a ragged left beginning of a new line in the marginnote isn't easy to read.

So I'd suggest to print marginnotes always »ragged right«. Use the package ragged2e and its command \RaggedRight.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.