2

I'm using the package listings for the code snippets in my document. But I want them to be named "Code" rather than "listings". I already got that in my document, but when I create a \lstlistoflistings, it still is titled with "Listings".

How can I change the topic to "Code fragments"? (or anything else?)

\documentclass{article}

\usepackage{listings}

\begin{document}

\lstlistoflistings
\renewcommand{\lstlistingname}{Code}

\section{foo}

\begin{lstlisting}[caption={A listing}]
    Some source code
\end{lstlisting}

\end{document}
0

1 Answer 1

1

While \lstlistingname gives the name of a single listing, the name for the list of listings is given by \lstlistlistingname. So just do:

\renewcommand{\lstlistlistingname}{Code fragments}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .