Page LayoutAlternate lstlisting line number side on twoside document

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
elomanias
Posts: 1
Joined: Wed Apr 08, 2015 2:45 pm

Alternate lstlisting line number side on twoside document

Post by elomanias »

Hi
I am currently writing my thesis.
My document is twosided and I have lots of listings in it.
I would like to have an automated check for odd and nonodd pages to allign the line numbers on the correct side.

Can anyone help me?

thanks

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Alternate lstlisting line number side on twoside documen

Post by Johannes_B »

Hi and welcome,

the chance is high, that most of your lines are rather short. Compare with the table of contents, where dotted lines are introduced to keep the eye on the line. If no lines are there, it is quite easy to confuse the line.

Do you really want thos? Which document class are you using?
To be honest, i am not sure if this is easy to implement.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply