General ⇒ lstlisting and two-sided documents
lstlisting and two-sided documents
While I can re-size the margins to lstlisting via x*margin options, many of the source code examples a quite long and the line breaks can become challenging to follow. I can similarly tweak the space allocated for the margin note, but that causes other problems.
I've found a better "appearing" method is to move the border edge and line numbers to the "inside" gutter margin. Thus, I'd like to use "frame=r,numbers=right" on even pages, and "frame=l,numbers=left" on odd pages.
Since this is beyond what lstlisting actually supports, I'm wondering if anyone else has encountered this and devised a way to make it work from a global setting? Or if I need to hack the style file directly? Manually editing each listing (there are hundreds) is simply beyond the scope of reason for this manuscript, particularly when the listings move around as parts of the text are modified.
Thanks for any input.
Cheers,
-josh
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