fmarotta / kaobook

A LaTeX class for books, reports or theses based on https://github.com/kenohori/thesis and https://github.com/Tufte-LaTeX/tufte-latex.

Home Page:https://github.com/fmarotta/kaobook

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Change the title of "List of Listings"

xiehao opened this issue · comments

Description

I would like to change the name of "List of Listings" to something like "List of Code", but failed.
Currently I am using the minted package, and adding the following commands as its doc says:

  • \renewcommand{\listingscaption}{Code}
  • \renewcommand{\listoflistingscaption}{List of Code}

The first one works, but the second failed.

Minimal Working Example

\documentclass{kaobook}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{kaobiblio}
\usepackage{kaotheorems}
\usepackage{kaorefs}

% Using the `minted` package and do some configurations
\usepackage{minted}
\renewcommand{\listingscaption}{Code} % This works
\renewcommand{\listoflistingscaption}{List of Code} % This does not work!

\begin{document}

\title{Bug Report}
\author{Author}
\date{\today}

\frontmatter
\maketitle

\listoflistings % Add a list of listings

\mainmatter
\setchapterstyle{kao}

\chapter{First Chapter}
\blindtext

% Add a piece of demo code
\begin{listing}[H]
    \caption{A piece of demo code}
    \begin{minted}[autogobble,linenos]{cpp}
        import <iostream>;
        
        int main() {
            std::cout << "Hello" << std::endl;
            return 0;
        }
    \end{minted}
\end{listing}

\end{document}

Expected behavior:
The title name above should be changed to "List of Code".

Actual behavior:
It remains as "List of Listings".

Additional Information