# Apéndices (Appendix spanish accent)

Dear friends: there is a problem with appendix and ápendice.

I have a scrbook document and I use appendix package,

\usepackage[title, titletoc]{appendix}


because I like the word "Apéndice" in the toc

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}


However, when I compile with latex there is an error in file.toc (maybe in file.aux before). The reason is that in the file.aux there is a line like this:

\@writefile{toc}{\contentsline {chapter}{Ap\IeC {\'e}ndice \numberline {A}Sobre el \LaTeX  }{27}{ApÈndice.1.Alph1}}


and in the second compilation the character "È" produces and error. If I compile with lualatex I have not any error.

I have tried to modify \indexname, \@chapapp but I can not find any solution.

Yes, that is a solution. I am going to clarify the problem with a MWE. In my opinion the problem is motivated by UTF-8 codify and inputenc package, as it is possible to see with this code:

\documentclass[paper=a4,10pt, twoside]{scrbook}%

\usepackage{etoolbox}

\usepackage{tgheros}    % (Una versión libre de Helvetica)
\renewcommand{\sfdefault}{qhv} %qhv

%:Fuente para todo lo demás (Una versión libre de Times)
\renewcommand{\rmdefault}{qtm}
\usepackage{textcomp}
\normalfont

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} %para LaTex

%:Paquetes relacionados con el idioma y codificación
\usepackage[english, spanish, es-nosectiondot, es-noindentfirst, es-nolists, activeacute]{babel}
\spanishdecimal{.}

%:Para poner las referencias y los nombres de figuras y tablas en castellano
\addto\captionsspanish
{%
\def\figurename{Figura}%
\def\tablename{Tabla}%
\def\listfigurename{Índice de Figuras}
\def\listtablename{Índice de Tablas}
\def\contentsname{Índice}%
\def\chaptername{Capítulo}
\def\Agradecimientos{Agradecimientos}
\def\Prefacename{Prefacio}%
\def\refname{Referencias}%
\def\abstractname{Resumen}%
\def\bibname{{Bibliografía}}
\def\appendixname{Apéndice}
\def\miapendice{\appendixname}
\def\glossaryname{Glosario}%
\def\indexname{{Índice Alfabético}}
}

%:Para definir APÉNDICES
\usepackage[title, titletoc]{appendix}

\usepackage{hyperref}

\begin{document}

\cleardoublepage
\phantomsection
\tableofcontents

%:Empieza el contenido del libro
\mainmatter

\chapter{Primer capítulo}
\section{Primera sección, primer capítulo}

\chapter{Segundo capítulo}
\section{Primera sección, segundo capítulo}

\begin{appendices}

\chapter{Primer apéndice}
\section{Primera sección, primer apéndice}

\chapter{Segundo apéndice}
\section{Primera sección, segundo apéndice}

\end{appendices}

\end{document}


If you compile, you obtain this error message:

Package inputenc Error: Unicode char \u8:énd not set up for use with La- TeXSee the inputenc package documentation for explanation.Your command was ignored.Type I to replace it with another command,or to continue without it.ice.alph1.Alph11ice.alph1.Alph20P

But the solution proposed it is perfect. Thank you

-
Hi Javier, Welcome to TeX.SE! I edited your code using the {} and backticks- it just makes it a bit easier to distinguish code from text. It would be best if you could post a complete MWE to help those who might be able to work on your problem. Welcome to the group! –  cmhughes Jun 6 '12 at 23:56
Please edit your question and add a minimal, yet complete, version of your document allowing us to reproduce the problem. –  Gonzalo Medina Jun 7 '12 at 0:06
Javier: I could answer just because this reminded me about another question. Please, always try to present a minimal complete example; I add one to my answer so you can adjust it if something doesn't work as advertised. –  egreg Jun 7 '12 at 8:31

## 1 Answer

This seems very similar to How to make appendix and hyperref packages work together with cyrillic (non ASCII) characters? and indeed a part of that answer should make your day.

Add the following after loading appendix (it's needed only when hyperref is used)

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


For some reasons, hyperref defines \Hy@chapapp as \appendixname, which in turn becomes (with Spanish babel and appendix) \spanishappendixname that again becomes Ap\'{e}ndice. However, it seems that \Hy@chapapp is used only for building the anchor name for hyperlinks, so it should be immaterial what string is used, as long as it is unique. Since the expansion of \Hy@chapapp is subject to complete expansion, it's better for it to be composed by characters only.

Here's a minimal document

\documentclass{scrbook}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage[title, titletoc]{appendix}

\usepackage{etoolbox} % we load it for the workaround
\usepackage{hyperref}

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

\begin{document}
\frontmatter
\tableofcontents
\mainmatter
\begin{appendices}
\chapter{Sobre el \LaTeX}
\end{appendices}
\end{document}

-