How to change title in listings?
28,524
Put these lines to preamble (the preamble is everything from the start of the LaTeX source file until the \begin{document}
command):
\renewcommand\lstlistingname{Algorithm}
\renewcommand\lstlistlistingname{Algorithms}
The first changes the caption name for listings. The second — the header name for the list of listings which is printed by the \lstlistoflistings
command. You would also probably want to modify the text in autoref
s:
\def\lstlistingautorefname{Alg.}
Then when you're referring to a particular listing, e. g. For details see \autoref{sec2:bubblesort}.
it is written as "For details see Alg. 2.1."
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Author by
Admin
Updated on July 26, 2020Comments
-
Admin almost 4 years
I have a question about the
listings
package. Do you know how to change it to get a title like this "Algorithm ## Title" rather than the casual "Listing ## Title" in the title line?