
Wie kann ich „Anhänge“ ins Italienische übersetzen?
\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}
Und warum lautet die Seitenzahl von „Anhängen“ 3 und nicht 4? Ist es möglich, die für „Anhänge“ angezeigte Seitenzahl aus dem Inhaltsverzeichnis zu entfernen?
Antwort1
Das appendix
Paket definiert keine lokalisierten Zeichenfolgen; man muss hinzufügen
\renewcommand{\appendixtocname}{<Appendices>}
auf die entsprechende Spracheinstellung; für Italienisch sollte es sein
\addto\captionsitalian{%
\renewcommand{\appendixtocname}{Appendici}%
\renewcommand{\appendixpagename}{Appendici}%
}
babel
(für und das Gleiche polyglossia
). Das Problem mit der Seitenzahl wird dadurch allerdings nicht gelöst.
appendix
Eigentlich kann man hierfür auf die Verpackung verzichten .
Mach einfach
\makeatletter
\g@addto@macro\appendix{%
\cleardoublepage
\addtocontents{toc}{\protect\contentsline{chapter}{Appendici}{}{}}%
}
\makeatother
in Ihrer Präambel.
Vollständiges Beispiel
\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}
Eine möglicherweise bessere Version, wenn hyperref
verwendet wird:
\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}
Dadurch wird auch „Appendici“ im Inhaltsverzeichnis zu einem Link auf die erste Seite des Anhangs.