开发者

margin note with tabbing environment in latex

开发者 https://www.devze.com 2023-01-02 17:38 出处:网络
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 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开发者_如何学Python 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}


The marginnote package provides a work-around for this:

margin note with tabbing environment in latex

\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}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号