Change "List of Listings" text
Asked Answered
G

4

26

I tried to change the "List of Listings" text with the command

\renewcommand*{\lstlistlistingname}{List of XYZ}

before my \begin{document}. What's wrong with this?

By the way

\renewcommand*{\lstlistingname}{NewListing}

worked like a charm.

Edit: No error occurred, just no change in the text. It's still "List of Listings".

By the way this is how I included it:

\pagestyle{scrheadings}
\pagenumbering{Roman}

\pdfbookmark[0]{\contentsname}{Contents}
\tableofcontents
\listoftables
\listoffigures
\listoflistings

\pagestyle{scrheadings}
\pagenumbering{arabic}

I've seen that on the "List of Listings" page the numbering starts with "1" but it should be a "V". Some hints?

Thank you

Graphophone answered 25/4, 2010 at 20:47 Comment(2)
It is always a good idea to tell what happened when you tried it vs. what you expected to happen.Audre
Maybe some List macro is defined... BTW. welcome:)Nijinsky
A
25

Use \lstlistoflistings

\listoflistings is from the listing package. \lstlistoflistings is from listings package (Notice the plural). You should not use both at the same time.

If you are using the listing package, use

\renewcommand*{\listlistingname}{List of XYZ}

to change the heading.

EDIT: From the fact that \lstlistingname works I conclude that you use the listings package. I suggest to remove the line \usepackage{listing} from your tex file. If you use both packages: Just use the right commands. Listings from both package appear in both put the entries into the same lol file.

Audre answered 25/4, 2010 at 21:10 Comment(2)
If I add \renewcommand*{\lstlistoflistings}{New Section Title} to either the preable or document, the section title of the list of listings changes (from "Listings"), but the entries disappear (i.e. I get an empty page with a section header only). What am I missing?Unfaithful
Using that command your replaced the listings's definition of a Table of Listings by the text "New Section Title". Change \listlistingname to change only the heading.Audre
A
20

Just tried to change it myself. There is a separate command that provides the name. E.g.:

\renewcommand{\lstlistlistingname}{My listungs}

so both \lstlistingname and \lstlistlistingname need to be changed.

Antilogarithm answered 28/2, 2012 at 10:58 Comment(0)
P
3

For answering your page numbering question:

Insert a \cleardoublepage just before \pagenumbering{arabic}. That should fix the roman numbering on your List of listings.

Pneumothorax answered 23/5, 2013 at 7:41 Comment(0)
B
1

Non of above answers worked for me. The commands that solved my issue were:

\renewcommand{\listingscaption}{Code}
\renewcommand{\listoflistingscaption}{List of source code examples}

Note: the commands above are for the Listing package, not for the Listings package!

Bonniebonns answered 15/12, 2021 at 18:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.