2010-06-03 73 views
4

我需要在標籤環境旁邊放置保證金註釋。如果我嘗試在環境中使用\ marginpar,我得到一個錯誤:LaTeX Error: Not in outer par mode.保證金標籤與乳膠中的標籤環境

我試過把\ marginpar放在\環境開始之前,但它最後與上一段的最後一行對齊與tabbing環境的第一行有關。

在下面的示例中,第一個邊距註釋與標籤文本以及下面的第二個對齊。我嘗試使用\ vspace將頂部筆記向下移動,並且工作正常,除非在標籤環境和前一段落之間出現分頁符 - 然後頁邊空白筆記和標籤文本結束在單獨的頁面上。

任何想法如何獲得保證金注意排隊標籤文本的頂部?

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

您是否正在尋找類似的'todonotes'包?或者我誤解了這個問題? – Pieter 2010-06-03 17:20:38

+0

我想將一個相應的文件名放在一些使用Tab鍵格式化的文本旁邊的空白處。我不確定todonotes是否可以做到這一點。我需要使用小灰色傾斜字體來格式化名稱,而不是圍繞它。 – ecto 2010-06-03 17:45:03

+0

我剛剛嘗試todonotes - 它會生成與\ marginpar相同的'不在外部參數模式下的錯誤。 – ecto 2010-06-03 18:00:25

回答

2

marginnote package提供了一個解決這個:

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}