COPCSE-NTNU / thesis-NTNU

An NTNU thesis LaTeX document class for bachelor, master, and PhD theses
MIT License
96 stars 369 forks source link

Fix Sphinx literalblock listings #31

Closed bilde2910 closed 3 years ago

bilde2910 commented 3 years ago

Sphinx is a documentation generator that can generate PDFs by compiling from Markdown or reStructuredText via LaTeX as an intermediary to PDF. Sphinx uses the literalblock label instead of lstlistings for code listings, which causes rendering of the list of listings to fail when trying to compile the LaTeX intermediary output by Sphinx. This patch copies the \contentsline function \l@lstlisting to \l@literalblock to ensure that the list of listings works for the very few of us who use Sphinx.

Before:

image

After:

image

ifarup commented 3 years ago

Thanks!