I wish to have brief information in a marginpar (or other solution) that aligns with the corresponding section (not section*) heading. So far the margin information is above or below the section title.
When run, the following MWE generates the margin text below the section title.
\documentclass[openany]{book}
\begin{document}
\chapter{Chapter Heading}
\section{Section Heading}\marginpar{\normalfont\normalsize Associated text}
Is it working?
\end{document}
I've searched the interwebs for help. I found Vertical alignment of marginnote and section heading, but this article deals with section*. Alas, perhaps it can't be done…
But I hope that it can.
Best Answer
Move the
\marginpar
inside the argument for\section
:As an alternative, you can use
\marginnote
from themarginnote
package instead and move the\marginnote
command inside the argument for\section
:The optional argument was used so the marginal note won't be in the ToC so
\protect
is not really needed; if the optional argument is not used, it is necessary to\protect
the command.