Skip to main content

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.

0 votes
1 answer
50 views

I am using the listings package to display code in my document, configured as follows: \documentclass[12pt,letterpaper,twoside]{book} \usepackage{listings} \usepackage{inconsolata} \usepackage{xcolor} ...
Jacob Morales Gonzalez's user avatar
0 votes
1 answer
67 views

I’m trying to define a custom language in LaTeX using \lstdefinelanguage so that keywords and variables in MusicBrainz Picard scripts are highlighted similarly to Picard’s built-in script editor (see ...
Marco Moldenhauer's user avatar
4 votes
1 answer
74 views

In the listings package, \lstset{numbers=right,stepnumber=3,numberfirstline} gives right-aligned line numbers and numbering every third line. I would like to achieve the same behavior using the piton ...
d7ek's user avatar
  • 43
3 votes
1 answer
102 views

I've been looking for ways to exhibit exhaustive listings (for replicability) alongside cropped output. Here are the two solutions I've come up with. For the second, I'm unable to stretch the PDF to ...
Erwann's user avatar
  • 2,658
1 vote
1 answer
26 views

The following minimal working example latex shows a multi line latex macro running inside a listings environment: \documentclass{article} \usepackage{listings} \lstset{ breaklines=true, ...
joanthan's user avatar
6 votes
0 answers
96 views

With the recent updates of the babel and the listings packages (for me that meant babel 25.14 --> 25.16 and listings 1.10c --> 1.11b), I encountered a change in the hyphenation behavior in my ...
suricata78's user avatar
1 vote
1 answer
115 views

I started experimenting tagging and found that listings are a problem: Compiling \DocumentMetadata{lang=en-US,tagging=on,pdfversion=2.0,pdfstandard=a-4f} \documentclass{article} \usepackage{unicode-...
user2609605's user avatar
  • 1,489
8 votes
2 answers
225 views

I would like to create a randomized enumerate list whose items may contain lstlisting environments. So far, I can successfully randomize ordinary items, but items containing a lstlisting environment ...
Dimitrios ANAGNOSTOU's user avatar
1 vote
0 answers
61 views

I am trying to use listings package to show some code. I am compiling it with lualatex to get a tagged document. Here is the minimal working example: \DocumentMetadata{lang=en-UK, tagging=on, ...
Miloop's user avatar
  • 1,511
0 votes
0 answers
32 views

I have a macro that I'm using to format text in answer key different from the rest of the document. When my answers include the lstlisting environment, the macro fails, as in the following MWE: \...
Jigsaw's user avatar
  • 1,047
6 votes
1 answer
254 views

The number sign ("#") raises an error in an environment defined with \lstnewenvironment of listings package. This is possibly related to the recent changes in LaTeX2e kernel ( 2025-11-01) ...
Zeping Lee's user avatar
4 votes
0 answers
166 views

Let's assume, I have nested parentheses like shown in the picture: I want to define a custom code style using the listings package and \lstdefinestyle command to highlight nested parentheses with ...
user2379123's user avatar
0 votes
1 answer
54 views

I am using the listings package and I would like to use zi4 narrow as font. The font is loaded and I can use it with \texttt{} but in the lstlistings environement I have zi4 font but not narrow. Is ...
Reto Ambrosini's user avatar
1 vote
2 answers
90 views

I am inserting a code sample, and It goes in to pages, I hope them to connect, not be divided by two figures. \documentclass[conference]{IEEEtran} \IEEEoverridecommandlockouts % The preceding line is ...
Ricky W.'s user avatar
10 votes
3 answers
515 views

Feeding \documentclass{article} \usepackage{listings} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node {% \begin{lstlisting} foo \end{lstlisting}}; \end{tikzpicture} \end{document} to ...
AlMa1r's user avatar
  • 1

15 30 50 per page
1
2 3 4 5
251