The marginnote package

Places notes in the page margin with \marginnote, also in places where \marginpar fails: inside figures, footnotes and boxes.

Loading the package

\usepackage{marginnote}

\marginpar creates a float. Inside a figure, a footnote or a minipage it stops with Not in outer par mode or Float(s) lost. \marginnote is not a float and works in all of these places.

The price: LaTeX moves a \marginpar down when it would overlap the previous one, and \marginnote stays where it is. Two notes close together can overlap; shift one with the optional offset argument.

Main commands

\marginnote{text}Note in the margin, level with the current line.
\marginnote{text}[1cm]The same note moved down by 1cm; a negative value moves it up.
\marginnote[left text]{right text}Different text for a note that lands in the left margin.
\renewcommand{\marginfont}{\footnotesize\itshape}Font of all margin notes.
\reversemarginparPuts the notes in the opposite margin; \normalmarginpar switches back.

Complete example

\documentclass{article}
\usepackage{marginnote}
\renewcommand{\marginfont}{\footnotesize\itshape}
\begin{document}
The result differs from the earlier study.\marginnote{Check the source.}
A second sentence fills the line.

\begin{figure}[h]
\centering
\fbox{A figure}\marginnote{Note next to a figure}
\caption{A figure with a margin note}
\end{figure}
\end{document}
Result
The compiled example

Open in the editor

Compiled with pdfLaTeX from TeX Live 2023. Tools run in this order: pdflatex → pdflatex.

Pitfalls

Related pages