Change “List of Listings” text

♀尐吖头ヾ 提交于 2019-12-03 11:09:27

问题


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


回答1:


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.




回答2:


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.




回答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.



来源:https://stackoverflow.com/questions/2709898/change-list-of-listings-text

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!