4

How can I translate "appendices" in Italian?

\documentclass[oneside]{book}
\usepackage{appendix}
\usepackage{polyglossia}
\setmainlanguage{italian}

\begin{document}
\tableofcontents
\chapter{My first chapter}
dummy text
\chapter{My second chapter}
dummy text

\appendix
\addappheadtotoc
\chapter{my appendix}
\end{document}

Also, why is the page number of "Appendices" 3 and not 4? Is it possible to remove the page number shown for "Appendices" from the Toc?

5

The appendix package doesn't define any localized string; one has to add

\renewcommand{\appendixtocname}{<Appendices>}

to the appropriate language set; for Italian it should be

\addto\captionsitalian{%
   \renewcommand{\appendixtocname}{Appendici}%
   \renewcommand{\appendixpagename}{Appendici}%
}

(the same for both babel and polyglossia). This doesn't solve the problem with the page number, though.

You can actually dispense from the appendix package for this.

Just do

\makeatletter
\g@addto@macro\appendix{%
  \cleardoublepage
  \addtocontents{toc}{\protect\contentsline{chapter}{Appendici}{}{}}%
}
\makeatother

in your preamble.

Full example

\documentclass[oneside]{book}
\usepackage{polyglossia}
\setmainlanguage{italian}

%\usepackage{hyperref} % use it or not as you please

\makeatletter
\g@addto@macro\appendix{%
  \cleardoublepage
  \addtocontents{toc}{\protect\contentsline{chapter}{Appendici}{}{}}%
}
\makeatother

\begin{document}           
\tableofcontents
\chapter{My first chapter}
dummy text
\chapter{My second chapter}
dummy text

\appendix
\chapter{my appendix}
\end{document}

enter image description here

A possibly better version when hyperref is used:

\documentclass[oneside]{book}
\usepackage{polyglossia}
\setmainlanguage{italian}

\usepackage{hyperref}                              

\makeatletter
\g@addto@macro\appendix{%
  \cleardoublepage
  \hypertarget{appendixstart}{}%
  \addtocontents{toc}{
    \protect\contentsline{chapter}{\protect\hyperlink{appendixstart}{Appendici}}{}{}%
  }%
}
\makeatother

\begin{document}
\tableofcontents
\chapter{My first chapter}
dummy text
\chapter{My second chapter}
dummy text

\appendix
\chapter{my appendix}
\end{document}

This will turn also “Appendici” in the table of contents into a link to the first page of the appendix.

  • Amazing stuff!! – Lupen Sep 22 '14 at 9:44

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.