# How to align a marginpar with a section title

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}
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.

-
Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. –  Martin Schröder Aug 7 at 15:23

Move the \marginpar inside the argument for \section:

\documentclass[openany]{book}
\begin{document}
Is it working?
\end{document}

As an alternative, you can use \marginnote from the marginnote package instead and move the \marginnote command inside the argument for \section:

\documentclass[openany]{book}
\usepackage{marginnote}
\begin{document}
Is it working?
\end{document}

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.

-
With your example I was able to align my marginnote with my section title. I also discovered that the titlesec package was causing an issue with aligning the marginnote. Once I discovered that, I found the article Conflict between the packages titlesec and marginnote, which now makes sense. –  Tim Thayer Aug 7 at 16:06
\documentclass[openany]{book}
\usepackage{marginnote}
\renewcommand*\marginfont{\normalcolor\normalfont\small}

\begin{document}