TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I use the listings package for code listings and I turned the line numbers on. But they appear left of the paragraph. I want them inside the paragraph. In the documentation it looks just right. Here is my code:

share|improve this question
If you accept an answer you probably find it useful and hence you should upvote it. – N.N. Aug 8 '11 at 13:38
up vote 12 down vote accepted


share|improve this answer
ok that helps, but I use frame=lines and the lines change too with this setting – dbrettschneider Jul 5 '11 at 12:38
I tried framexleftmargin=-1.5em but it ignores the minus – dbrettschneider Jul 5 '11 at 12:41
see edited answer – Herbert Jul 5 '11 at 12:55
ah thanks, misunderstood the framexleftmargin – dbrettschneider Jul 5 '11 at 13:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.