# Two consecutive marginnotes printed over each other

When using the marginnote package and writing two \marginnote{text} fields directly after each other, the two nodes clash into each other. MWE:

\documentclass{memoir}
\usepackage{marginnote}
\begin{document}
\marginnote{first}
\marginnote{second test}
\end{document}


which results in:

Can this be fixed, so that the second marginnotes automatically is vertically moved -- that is, without using the optional argument to manually move it?

I'm actually trying to create a custom citation command, based on the alphabetic-style-cite-command. I want the citation to put the label in the text and add a marginnote with some more bibliographic information on the cited object. The above problem occurs, when multiple objects are cited, i.e. in \cite{label1,label2}. This then generates the above marginnotes for each cited object. I think the actual DeclareCiteCommand details are not important here, so I only add the above MWE (I can of course also give more details, if necessary).

• Isn't \marginpar good for you? If you don't insist on using marginnote, simply change \marginnote to \marginpar. – bmv Jan 20 '18 at 15:07

## 2 Answers

For me your MWE gives the result you show as does the test where you replace \marginnote by \marginpar. However then if there is any text on the line with the two marginal notes they are vertically separated.

Did you try:

\documentclass{memoir}
% \setmarginnotes{7pt}{128pt}{5pt}
\begin{document}
Text \marginpar{first} \marginpar{second}
\end{document}


which for me gives non-overlapping marginal notes.

The memoir class macro \setmarginnotes{sep}{width}{push} sets the layout for \marginpar notes, where sep is the space between the textblock and the note, width is the width of the note's text and push is the minimal vertical space between notes (the push value can be set via the standard LaTeX \marginparpush length) see section 2.6 in the memoir manual. The sep and width aspects can be individually set via the LaTeX lengths \marginparsep and \marginparwidth; these are all basic LaTeX lengths that apply to any standard document class. The values I showed in the commented-out \setmarginnotes macro are the default values used by LaTeX.

Basically just use \marginpar and if necessary tweak its layout to your needs.

If you have to have two or more \marginpar on a line with no other text than perhaps \setlength{\marginparsep}{\baselineskip} will meet your needs.

From the documentation of marginnotes:

Note: The margin note will be placed at the current vertical line. This means, if you are using two \marginnote commands at the same line, they will be put on the same place. This is not a bug but a feature!

If you want to place more margin notes at the same line, use \marginpar.

• Thanks for the pointer to the marginnotes documentation. But apparently \marginpar does not solve the problem completly. With this, the second note is only moved for roughly halve a baselineskip and both notes still overlap halve. – asante Jan 21 '18 at 12:24