Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using pygments to highlight the code I insert in my lyx document.

The external file gets inserted in my document like this:

{\small \input{listings/blah.tex} }

And I use this command to generate the blah.tex file:

pygmentize -f latex -O linenos=true -l xml blah.xml > blah.tex

I can see that the numbering flags seem to appear in the output of pygmentize:


But when I render the pdf, it only shows the highlighted listing, without line numbers. What am I doing wrong?

share|improve this question

closed as too localized by Stefan Kottwitz Aug 7 '11 at 22:21

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Is there anyway you could post a short sample of the blah.tex file that pygmentize produces that demonstrates your problem? Have you considered using the minted (ctan.org/pkg/minted) package? (I know next to nothing about lyx, so this may be an absurd suggestion - apologies). –  Edd Mar 14 '11 at 21:25
This question seems to be related to this one (Neither has a satisfactory answer as yet...) –  Seamus Jun 22 '11 at 8:51
As I've comment on the question @Seamus links to, this seems to be working fine with an up-to-date system. If the linked question is closed, then this one should be also. –  Joseph Wright Jul 16 '11 at 5:12

Browse other questions tagged or ask your own question.