Marginal note with tabulation medium in latex

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

I tried putting \ marginpar immediately before \ begin from the environment, but in the end it aligns with the last line of the previous paragraph, and not with the first line of the tab environment.

In the example below, the first field note is aligned above the tab text, and the second is below. I tried using \ vspace to shift the top note down, and this works fine if there is no page break between the tab environment and the previous paragraph, then the field note and the tab text end on separate pages.

Any ideas on how to get a margin note according to the top of the tab 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} 
+4
source share
1 answer

marginnote package provides a workaround 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} 
+2
source

Source: https://habr.com/ru/post/1311765/


All Articles