Questions tagged [listings]

{listings} is a package that extends LaTeX's {verbatim} features. A variety of syntax highlighting options are available. For general questions about {verbatim} or {highlighting} use the respective tag. For the unrelated concept of list structures, use {lists} instead.

Filter by
Sorted by
Tagged with
5
votes
0answers
120 views
+300

Highlight numbers using listings package

The problem: Is it possible to highlight all the numbers inside a lstenvironment except the numbers in comments, strings or variable names? Example of expected output (Python in Google Colaboratory): ...
1
vote
0answers
61 views
+100

Code highlight in ltxdoc documentation

I wish to add LaTeX code highlight in a package documentation. Usually I use the following code to highlight LaTeX code (copied from classicthesis documentation): \usepackage{listings} \definecolor{...