pdfbookmark for listings to spanish

Issue #180 invalid
Murpholinox Peligro created an issue

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, the second line puts Listings.

How can I fix the translation?

I am working on linux with version 4.6 of classic-thesis and pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019)
Greetings from México.

Comments (5)

  1. Ivo Pletikosić

    Hi M·P,

    Not really a classicthesis 'bug', this goes to not having support for listings in the babel package. There are some hints about what to do in classicthesis-config.tex around line 200. Try adding

    \addto\captionsspanish{\renewcommand*{\lstlistlistingname}{Lista de ...}}
    

    where two other \addto commands are, and let us know if it worked. This might also work (the new way): \renewcommand\spanishlstlistlistingname{Lista de ...}. I don't know if there are any options to babel that can do this for you, like es-tabla here https://bitbucket.org/amiede/classicthesis/wiki/SpanishLanguageSupport. Check https://ctan.org/pkg/babel documentation.

    Note: Also asked at https://tex.stackexchange.com/questions/550394/

    Please don't forget to send André a postcard... from Mexico ;)

  2. Murpholinox Peligro reporter

    Thanks. I changed the next lines in the respective files.

    + 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 + means change and o means no change.
    Also I have to change the name in the \chapter*{} like so \chapter*{Agradecimientos}.

    And also i have to add the next lines to classicthesis-config.tex

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

    That seems to work. :)

    Thanks
    I’ll add this to https://tex.stackexchange.com/questions/550394/

  3. Ivo Pletikosić

    Glad it worked. FYI: all these pdfbookmark commands are meant to be changed manually, i.e. we're adding them where there are no automatic mechanisms for adding special section titles to pdf ouline/toc (F9 in evince). More about those here (level 0 is for chapters, level 1 for sections; text is what you want printed, name is just an internal unique label): http://ftp.math.purdue.edu/mirrors/ctan.org/macros/latex/contrib/hyperref/doc/manual.html#x1-150004.1 Good luck, i

  4. Log in to comment