42

I'm using the listings package with this \begin command:

\begin{lstlisting}[caption=blabla, label=amb]

This yields a nice code listing with a caption like "Listing 1.1 blabla". Is there a way to change the caption and have something like "Code 1.1 blabla"?

I saw the title command but it doesn't use a numbering system. Any hint will be greatly appreciated!

  • 1
    Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other (by using the same OpenID), otherwise you won't be able to comment on or accept answers or edit your question. – Werner May 7 '12 at 18:28
37

The caption name is defined with \lstlistingname command. You should add a line that reads

\renewcommand{\lstlistingname}{Code}

to change it the way you wanted. For more tricks you should check the manual for package listings.

  • Without the answers to the question this is marked as a duplicate of, I wouldn't have been certain where to put this (i.e. in the preamble). – Isaac Apr 27 '17 at 11:30