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
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
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?)