6

I want to create a \marginnote which is aligned to the title of a theorem. However, the \marginnote is always placed over or under the title, when I put the \marginnote command before or into the theorem environment.

\documentclass{article}

\usepackage{ntheorem}
\usepackage{marginnote}
\theoremstyle{break}
\theorembodyfont{\normalfont}
\newtheorem{definition}{Definition}

\begin{document}

\begin{definition}[my title]
    \marginnote{my comment}
    my definition
\end{definition}

\end{document}
3

Try:

\documentclass{article}

\usepackage{ntheorem}
\usepackage{marginnote}
\theoremstyle{break}
\theorembodyfont{\normalfont}
\newtheorem{definition}{Definition}

\begin{document}
\begin{definition}[my title]
    \marginnote{my comment}[-\baselineskip]% Adjust the vertical offset here
    my definition
\end{definition}

\end{document}

Note that

The command \marginnote[<left>]{<right>}[<voffset>] may be used to set a margin note using marginnote. The first optional argument and the mandatory argument are same using \marginpar from the LATEX kernel. Even \reversemarginpar will be considered. The note <left> or <right> will be put at the current vertical position. Second optional argument <voffset> may be used to adjust the vertical position of the margin note. Use a negative dimension to move it up or a positive dimension to move it down.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.