LyXNumbers and programming code

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
john12
Posts: 6
Joined: Thu Feb 23, 2012 3:51 pm

Numbers and programming code

Post by john12 »

This happens when I use programming code and enumeration, how can I add a gap between the numbering and the line numbers of the code. (Attached this this post)

I'm using this in LaTeX Preamble:

Code: Select all

\usepackage{listings}
\lstset{language=java,numbers=left,tabsize=2,showstringspaces=false,showspaces=false}
Attachments
Screen Shot 2012-02-23 at 08.55.26.png
Screen Shot 2012-02-23 at 08.55.26.png (14.26 KiB) Viewed 1670 times

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Numbers and programming code

Post by localghost »

Just for information to other users to be aware of possibly already existing solutions. The question has also been posted to the {TeX} SE.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

Re: Numbers and programming code

Post by Stefan Kottwitz »

John, perhaps add such a small LyX code example as attachment to a forum post, so somebody could test it.

Stefan
LaTeX.org admin
Post Reply