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.
I'm using this in LaTeX Preamble:
\usepackage{listings}
\lstset{language=java,numbers=left,tabsize=2,showstringspaces=false,showspaces=false}
Best Answer
Besides addin
xleftmargin=<size>
to shift the listings over, you also needresetmargins=true
which resets the indention from list environments like enumerate or itemize.The frame here is from the
geometry
package to show the alignment with the margins.Code:
Commenting out the
resetmargins=true
below will illustrate the problem.