6

I can't use both (hyperref and appendix) packages together. When I try to compile my code with these two packages, the following errors arise:

Capture of my log file

This is my MWE:

\documentclass{book}
\usepackage[toc,page]{appendix}
\usepackage[acronym]{glossaries}
\usepackage[spanish]{babel} % Manejo de idiomas}
\usepackage[utf8]{inputenc}
\usepackage[hidelinks]{hyperref}

\newacronym{ese}{ESE}{Empresa Social del Estado}
\newacronym{huem}{HUEM}{Hospital Universitario Erasmo Meoz}
\makeglossaries

\begin{document}
I'm gonna need to use a lot of acronyms like \gls{ese} and \gls{huem}
\tableofcontents

\chapter{Regular Chapter}
\begin{appendices}
\chapter{Some Appendix}
The contents...
\end{appendices}

\end{document}

The code was taken from Prof. Medina's answer: making appendix for thesis Thank you, Professor.

Also, When I compile it successfully, the title of the appendix section is in english, but I need it in spanish: "Apendices" instead "Appendices". How can I modify this?

I'm compiling with the following sequence

pdflatex -synctex=1 -interaction=nonstopmode %.tex| makeglossaries -d ./build  %|makeindex -s build/%.ist -o build/%.gls build/%.glo|pdflatex -synctex=1 -interaction=nonstopmode %.tex|evince %.pdf
5

First of all, load babel before appendix and glossaries, so, at least the latter, knows the language you are in. Also load fontenc with T1 option.

Then add the following lines to your preamble

\makeatletter
\appto{\appendices}{\def\Hy@chapapp{Appendix}}
\makeatother

to get rid of all those errors (hyperref's \BOOKMARKs don't like names with accented letters.

Finally, the appendix commands to redefine are \appendixtocname and \appendixpagename:

\renewcommand{\appendixtocname}{Apéndices}
\renewcommand{\appendixpagename}{Apéndices}

MWE:

\documentclass{book}
\usepackage[spanish]{babel} % Manejo de idiomas}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[toc,page]{appendix}
\usepackage[acronym]{glossaries}
\usepackage[hidelinks]{hyperref}

\makeatletter
\appto{\appendices}{\def\Hy@chapapp{Appendix}}
\makeatother
\renewcommand{\appendixtocname}{Apéndices}
\renewcommand{\appendixpagename}{Apéndices}

\newacronym{ese}{ESE}{Empresa Social del Estado}
\newacronym{huem}{HUEM}{Hospital Universitario Erasmo Meoz}
\makeglossaries

\begin{document}
\tableofcontents

\chapter{Regular Chapter}
\begin{appendices}
\chapter{Some Appendix}
The contents...
\end{appendices}

\glsaddall\printglossaries

\end{document} 

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.