0

Why \listtablename gets properly translated (to spanish)

\pdfbookmark[1]{\listtablename}{lot}`

…. while \lstlistlistingname does not?

\pdfbookmark[1]{\lstlistlistingname}{lol}

The first line puts 'Lista de Tablas' in the contents of my pdf viewer (evince), the second line puts 'Listings'.

How can I fix this?

I am working on linux (Fedora 32) with version 4.6 of classic-thesis and pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019).

My workaround was to change the first text between braces with something in spanish. This works for almost everything, except for Listings (for example: \pdfbookmark[1]{Acrónimos}{acronyms}). To be more explicit, the title in the toc in my pdf viewer changes but not in the main document. Here is the code (from Contents.tex)

\pdfbookmark[1]{\listtablename}{lot}
\listoftables

\vspace{8ex} % \newpage

%******************************************************* % List of Listings %******************************************************* %\phantomsection %\addcontentsline{toc}{chapter}{\lstlistlistingname} \pdfbookmark[1]{\lstlistlistingname}{lol} \lstlistoflistings

\vspace{8ex}

%******************************************************* % Acronyms %******************************************************* %\phantomsection \pdfbookmark[1]{Acrónimos}{acronyms} \markboth{\spacedlowsmallcaps{Acronyms}}{\spacedlowsmallcaps{Acronyms}} \chapter*{Acronyms}

See the difference between Lista de Tablas, Listings and Acrónimos...

Many thanks

enter image description here

  • Try lockstep's answer, or if needed Mensch's answer, at https://tex.stackexchange.com/questions/82993/. In short, you'll be adding something like \addto\captionsspanish{\renewcommand*{\lstlistlistingname}{Lista de}} to your -config.tex file. Also check https://bitbucket.org/amiede/classicthesis/wiki/SpanishLanguageSupport. – PhilipPirrip Jun 21 '20 at 11:39
  • That works. But only for Listings. You have to manually change every corresponding \pdfbookmark in every file where there is no proper macro name for that particular section/chapter. – murpholinox Jun 21 '20 at 17:08

1 Answers1

1

For the sake of completeness I will specify what I did.

Although I followed the steps outlined in here to get spanish support in classic-thesis...

  • In classicthesis-config.tex: \PassOptionsToPackage{english,spanish,mexico,es-lcroman,es-tabla}{babel} \usepackage{babel}.
  • In ClassicThesis.tex: \selectlanguage{spanish} % español
  • And in Abstract.tex: \begin{otherlanguage}{english} and the respective \end{} before the second abstract.

... It seems that not everything is translated.

As PhilipPirrip in the comments says the answer is to \addto\captionsspanish{\renewcommand*{\lstlistlistingname}{Algo en español}}. As pointed out by Ivo Pletikosić in here that must be added to the file classicthesis-config.tex. I added the next lines before the line that starts with % Fix to getting autorefs for subfigures right:

  \addto\captionsspanish{%
    \renewcommand*{\lstlistlistingname}{Lista de código}%
    \renewcommand*{\lstlistingname}{Código} 
}

I also changed almost every \pdfbookmark[1]{Title in English}{title in english} to something like \pdfbookmark[1]{Título en Español}{título en español}. Here is a list:

+ Abstract.tex:\pdfbookmark[1]{Resumen}{Abstract}
+ Abstract.tex:\pdfbookmark[1]{Abstract}{Zusammenfassung}
+ Acknowledgments.tex:\pdfbookmark[1]{Agradecimientos}{acknowledgments}
+ Colophon.tex:\pdfbookmark[0]{Colofón}{colophon}
o Contents.tex:\pdfbookmark[1]{\contentsname}{tableofcontents}
o Contents.tex:    \pdfbookmark[1]{\listfigurename}{lof}
o Contents.tex:    \pdfbookmark[1]{\listtablename}{lot}
o Contents.tex:    \pdfbookmark[1]{\lstlistlistingname}{lol}
+ Contents.tex:    \pdfbookmark[1]{Acrónimos}{acronyms}
+ Declaration.tex:\pdfbookmark[0]{Declaración de autenticidad}{declaration}
+ Dedication.tex:\pdfbookmark[1]{Dedicatoria}{Dedication}
o DirtyTitlepage.tex:%\pdfbookmark[1]{Titel}{title}
+ Publications.tex:\pdfbookmark[1]{Publicaciones}{publications}
o Titlepage.tex:    %\pdfbookmark[1]{\myTitle}{titlepage}

Where the symbol before each line means that there was a change (+) or there was not (o).

Also you have to change every \chapter*{Title in English} to \chapter*{Título en Español} like \chapter*{Agradecimientos}and etc.

Hope it helps...

Ps. Please correct me if I am wrong, as I am very new to LaTeX