General ⇒ margin note in tabbing environment
margin note in tabbing environment
I need to put a margin note (a file name) next to a code example in my text. I'm currently using the tabbing environment to display my code, and considering switching to the listing package.
If I try to use \marginpar in the tabbing environment I get an error: LaTeX Error: Not in outer par mode.
If I try to put one in a lstlisting environment it just gets printed verbatim.
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 code example.
Any suggestions?
George
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
margin note in tabbing environment
Code: Select all
\begin{lstlisting}[escapechar=!]
First line of code
Second line of code
Third line of code!\marginpar{\footnotesize A marginal note}!
Fourth line of code
Fifth line of code
\end{lstlisting}
Re: margin note in tabbing environment
George
(Sorry I posted this in the wrong topic. Is there a way to move it to latex >> general instead of latex-community >> general?)