I'm trying to make a latex document in spanish, I've successfully imported the babel package for the language, but the \listoflistings command does not get translated to spanish. Also captions for listings are not translated. I've tried to renew these commands: \renewcommand{\lstlistingname}{Listado} \renewcommand{\lstlistlistingname}{Índice de listados}. Note that I'm also using minted.

Here is the code (MWE):

\documentclass[12pt, twoside, openright]{report}



\renewcommand{\lstlistlistingname}{Índice de listados}



% \subimport*{./}{chapter01.tex}
\begin{minted}[linenos,frame=lines, framesep=2mm,numbersep=5pt]{scala}
val immutableInt = 2
immutableInt = 3    // Compile Error
var mutableInt = 4
mutableInt = 2  // OK
\caption{val versus var}


Any help would be appreciated.


1 Answer 1


Referencing the question (I recommend to read the answers posted): How to change the name of document elements like "Figure", "Contents", "Bibliography", "Appendix", etc.? , the answer is that minted uses other macro names that the ones I was using, concretely, an answer (by @hpesoj626) gives this snippet:

\renewcommand\listoflistingscaption{List of program codes}

If the babel package is being used, wrap these definitions with \addto\captions<language>{...}

  • Why should I wrap them if using babel? It works for me without doing it. And could you please provide an example for ngerman? Oct 20, 2017 at 13:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .