4

I would like to achieve the default behavior of \marginpar, that is, each successive margin note being placed below the previous one, but with the package marginnote. The behavior of marginnote is that the notes overlap, which the authors of the package call a "feature".

The reason why I need this behavior in the marginnote package is that I need to be able to create new margin notes from inside other floats, which marginpar does not allow you to do. I use margin notes for BibLaTeX references, so I need the positioning to be handled automatically.

Is it possible to make marginnote place the notes one below the other?

Below is a minimal working example to show the difference between the behavior of \marginpar and \marginnote.

\documentclass{minimal}

\usepackage{marginnote,lipsum}
\setlength{\marginparsep}{0.1cm}

\begin{document}

\lipsum[66] \marginpar{Marginpar 1} \marginpar{Marginpar 2}
\lipsum[75] \marginnote{Marginnote 1} \marginnote{Marginnote 2}
\lipsum[1]

\end{document}

Comparison between margin notes

  • It is a feature in the sense that marginnote makes no effort to move overlapping items. It just gives you a method to write into the margins from where ever you are. It is possible to write your own macros to move it out of the way by using tikz and the remember picture,overlay feature, but there are many pitfalls and corner cases. – daleif Mar 13 '17 at 9:33
2

As manual says, in this case you should readjust vspace!by \marginnotevadjust, its default definition is 0pt.

In your case below code could help

\lipsum[75] \marginnote{Marginnote 1} \renewcommand*{\marginnotevadjust}{40pt}\marginnote{Marginnote 2}

enter image description here

P.S. why don't you use todonotes? it's more flexible.

  • Right, I should have clarified that I need this to be done automatically, as I use margin notes for references and so I cannot manually adjust the position every time. – Mereenie Mar 13 '17 at 6:13
  • 1
    Todo notes uses marginpar internally, so this would not help the OP. – daleif Mar 13 '17 at 9:30

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.