1

MWE:

\documentclass{book}

\usepackage{appendix}
\usepackage{hyperref}
\usepackage{polyglossia}
\setdefaultlanguage{spanish}

\begin{document}
  \tableofcontents
  \include{chapter1}
  \begin{appendices}
    \include{appendixA}
  \end{appendices}
\end{document}

With this example, the TOC correctly points to the page number of the appendix, but the link does not work (it doesn't point anywhere). Using the PDF's table of contents does not work either. Using \appendix works, however.

What's weirder, this only happens with TeX Live 2015, as shipped in Ubuntu 16.04. It does not happen with the previous LTS version.

Is this a known bug? How can I solve it proper?

  • Apéndice.a is the hyperanchor, which causes troubles. – user31729 Apr 24 '16 at 20:30
1

Since polyglossia allows unicode characters, the name Apéndice as content of \appendixname causes a problem for the hyperanchor that is to be set for the correct linking.

The appendix package defines \Hy@chapname to be \appendixname, which is Apéndice in this case → 'wrong'.

Redefining \Hy@chapname cures the problem -- just use a anchorname with 'regular' letters, i.e. no accents. etc.

\documentclass{book}

\usepackage{appendix}
\usepackage{polyglossia}

\setdefaultlanguage{spanish}


\usepackage{hyperref}


\makeatletter
\newcommand{\usebetterlinkanchor}[1]{%
  \def\Hy@chapapp{#1}%
}
\makeatother



\begin{document}
  \tableofcontents
  \chapter{Chapter 1}
    \begin{appendices} 
      \usebetterlinkanchor{appendixchapters}
      \chapter{Appendix}
    \end{appendices}
\end{document}
  • Thanks for the fix. Any ideas on why accented hyperanchors break down on just this particular version of XeLaTeX? – amyspark Apr 25 '16 at 0:15
  • @amyspark: I don't know -- did it work in a previous version? – user31729 Apr 25 '16 at 3:14
  • It did in TeX Live 2013. – amyspark Apr 25 '16 at 12:36
  • @amyspark: I can't check with TL 2013, unfortunately, but there have been some updates to polyglossia, but I think the issue is rather how xelatex builds up the links. – user31729 Apr 25 '16 at 13:29

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.