I have the following MWE in which the \marginnote
need to appear at correct margin. For example the margin notes one, two, three and four need to appear on left margin of first page. In the second page the margin notes thirteen and fourteen should appear on right side.
The command \reversemarginpar
corrects this, but I need to reset on next column. I am not able to use the twocolumn
document class option as I am using \twocolumn[]
to set the title part of the document.
I will not be able to use other class files. Is there an easy way to put the margin notes to the respective margins.
MWE
\documentclass[twoside]{article}
\RequirePackage{lipsum}
\RequirePackage[margin=2cm]{geometry}
\RequirePackage{marginnote}
\begin{document}
\sloppy
\twocolumn[{%
\hrulefill\medskip\par
\lipsum[1]
\hrulefill
\vspace*{2pc}
}]
\section{Two}\label{s2}
\marginnote{One}\lipsum[1]
\marginnote{Two}\lipsum[2]
\marginnote{Three}\lipsum[3]
\marginnote{Four}\lipsum[4]
\marginnote{Five}\lipsum[5]
\marginnote{Six}\lipsum[6]
\marginnote{Seven}\lipsum[7]
\section{Three}\label{s3}
\marginnote{Eight}\lipsum[1]
\marginnote{Nine}\lipsum[2]
\marginnote{Ten}\lipsum[3]
\marginnote{Eleven}\lipsum[4]
\marginnote{Twelve}\lipsum[5]
\marginnote{Thirteen}\lipsum[6]
\marginnote{Fourteen}\lipsum[7]
\end{document}
There are certain post available here with \marginnote
which is not exactly what I am looking for.
Best Answer
Add the following lines in your preamble:
MWE:
Output:
To avoid having paragraphs at the beginning of a page with an orphan margin note in the previous page, you can load the
needspace
package and add\needspace{\baselineskip}
to the re-definition of\marginnote
MWE (try removing
\needspace{\baselineskip}
to see the difference)Output