\marginnote
creates a new paragraph when it's called on a separate line before a new section, which adds unwanted extra vertical space, but it doesn't do this when the next line is just a regular line:
\documentclass{article}
\usepackage{marginnote}
\begin{document}
text
\marginnote{123} % creates extra line
\section{section}
text
\marginnote{123} % doesn't create extra line
text
\end{document}
I'm trying to find a way for marginnote
to not add this extra line, regardless of whether it's placed before the new section or elsewhere. marginpar
doesn't do this, and works well for this specific example, but it has other drawbacks which are dealt with in marginnote
, so I would prefer to fix marginnote
Technically a very similar question has already been asked and answered ( Prevent marginnote from creating extra paragraph ), but I need marginnote
to not add extra paragraph when used on a separate line right before a section starts, instead of calling it from elsewhere.