4
votes

I need to put a margin note next to a tabbing environment. If I try to use \marginpar within the environment I get an error: LaTeX Error: Not in outer par mode.

I've tried putting the \marginpar just before the \begin of the environment but it ends up aligned with the last line of the preceding paragraph instead of with the first line of the tabbing environment.

In the example below the first margin note gets aligned above the tabbing text and the second one below. I tried using \vspace to shift the top note down, and that works okay unless a page break occurs between the tabbing environment and the preceding paragraph -- then the margin note and the tabbing text end up on separate pages.

Any ideas how to get the margin note to line up with the top of the tabbing text?

\documentclass{memoir}
\begin{document}

Now is the time for all good men to come to the aid of their country.
\marginpar{a margin note}\begin{tabbing}
tabbing text a\\
tabbing text b\\
\end{tabbing}\marginpar{another margin note}
Now is the time for all good men to come to the aid of their country.

\end{document}
1
Are you looking for something like the todonotes package? Or am I misinterpreting the question?Pieter
I want to put a corresponding file name in the margin next to some text that is formatted using tabbing. I'm not sure if todonotes can do that or not. I need to format the name in small gray slant font, without any box around it.ecto
I just tried todonotes -- it generates the same Not in outer par mode error as \marginpar.ecto

1 Answers

2
votes

The marginnote package provides a work-around for this:

enter image description here

\documentclass{memoir}
\usepackage{marginnote}% http://ctan.org/pkg/marginnote
\begin{document}

Now is the time for all good men to come to the aid of their country.
\begin{tabbing}
  tabbing text a \marginnote{a margin note} \\
  tabbing text b
\end{tabbing}
Now is the time for all good men to come to the aid of their country.

\end{document}