0

With the Memoir document class the vertical position of margin notes specified via \marginpar is flexible so that adjacent notes are prevented from overlapping:

\documentclass{memoir}
\usepackage{lipsum}
\begin{document}

\lipsum[1][1]%
\marginpar{Hello, world!}%
\marginpar{Bonjour, monde!}%
\lipsum[1][2-4]

\end{document}

Adjacent marginpars with the Memoir document class

Contrary to this, with the KOMA-Script document classes adjacent margin notes specified via \marginnote (of the marginnote package) overlap:

\documentclass{scrartcl}

\usepackage{lipsum}
\usepackage{marginnote}

\begin{document}

\lipsum[1][1]%
\marginnote{Hello, world!}%
\marginnote{Bonjour, monde!}%
\lipsum[1][2-4]

\end{document}

Adjacent marginnotes with the KOMA-Script document class

(Note: the KOMA-Script code needs to be compiled twice in order to work properly. And, by the way, I use LuaLaTeX.)

How can the non-overlapping behavior of margin notes exhibited by the Memoir document class be emulated in the context of the KOMA-Script document classes?

5
  • I don't see anything in the KOMA documentation about using \marginnotes instead of \margnpar (except warning about the overlap). \margnipar is standard LaTeX, not peculiar to memoir. Jul 14, 2021 at 17:42
  • @JohnKormylo: You're right, however I need to use marginnote rather than marginpar because of this problem. It would have been better if I'd compared marginnote's behavior to marginpar's behavior in the context of KOMA-Script rather than comparing marginnote's behavior in the context of KOMA-Script to marginpar's behavior in the context of Memoir.
    – Evan Aad
    Jul 14, 2021 at 18:21
  • Presumably putting \marginnote next to a float or theorem won't overlap anything, and you can use \marginpar otherwise (in outer par mode). See also tex.stackexchange.com/questions/215322/… Jul 15, 2021 at 2:48
  • @JohnKormylo: This would have been a good solution had I not also wanted to assign tags to margin notes in order to be able to selectively format the notes based on their tags, as explained here and here. If you feel very determined to help me solve a problem related to margin notes, the question at the latter link has yet to be fully answrered (there's a hint by Ulrike Fischer, but I'd appreciate a full answer).
    – Evan Aad
    Jul 15, 2021 at 4:35
  • 1
    Not really, but I keep wanting to improve tex.stackexchange.com/questions/215322/… to use saveboxes and macros instead of dimen and count registers. Just never get around to it. Jul 15, 2021 at 14:05

1 Answer 1

1

Well manually you can use an offset:

\documentclass{scrartcl}
\usepackage{lipsum}
\usepackage{marginnote}
\begin{document}
\lipsum[1][1]%
 \marginnote{Hello, world!}%
 \marginnote{Bonjour, monde!}[2\baselineskip]%
\lipsum[1][2-4]
\end{document}

You could also try the scrlayer-notecolumn package which creates one large note column:

\documentclass{scrartcl}
\usepackage{lipsum,scrlayer-notecolumn}

\begin{document}
\lipsum[1][1]
\makenote{Hello, world!}\makenote{Bonjour, monde!}
\lipsum[1][2-4]
\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .