
如何將「附錄」翻譯成義大利文?
\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}
另外,為什麼「附錄」的頁碼是3而不是4?是否可以從目錄中刪除「附錄」顯示的頁碼?
答案1
該appendix
包沒有定義任何本地化字串;必須補充一點
\renewcommand{\appendixtocname}{<Appendices>}
到適當的語言集;對於義大利語來說應該是
\addto\captionsitalian{%
\renewcommand{\appendixtocname}{Appendici}%
\renewcommand{\appendixpagename}{Appendici}%
}
babel
(和都相同polyglossia
)。但這並不能解決頁碼問題。
您實際上可以appendix
為此從包裝中免除。
做就是了
\makeatletter
\g@addto@macro\appendix{%
\cleardoublepage
\addtocontents{toc}{\protect\contentsline{chapter}{Appendici}{}{}}%
}
\makeatother
在你的序言中。
完整範例
\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}
hyperref
使用時可能更好的版本:
\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}
這也會將目錄中的「附錄」變成附錄第一頁的連結。