9

Using LyX I can add line numbers to my code listing. However, these are in the document (serif/Roman) font and look strange next to code blocks (Typewriter font). Is it possible to change the font of the line numbers to match that of the code block? Can this be achieved using either listing parameters or some LaTeX code in the preamble?

1 Answer 1

14

The key is numberstyle:

\lstset{numberstyle=\ttfamily}
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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