I am making a document that includes two languages. I want to make two seperate tables of contents (one for each language)
Is there an easy way to do this?
General ⇒ Multiple Table of Contents
Multiple Table of Contents
Hi,
one option would be to use some of the features provided by the tocloft package (please, refer to the package documentation for further information). The following example uses the standard \tableofcontents command to create a table of contents in English and illustrates how to proceed to also produce a table of contents in Spanish (the code contains some explanatory comments):
one option would be to use some of the features provided by the tocloft package (please, refer to the package documentation for further information). The following example uses the standard \tableofcontents command to create a table of contents in English and illustrates how to proceed to also produce a table of contents in Spanish (the code contains some explanatory comments):
Code: Select all
\documentclass{book}
\usepackage[spanish,english]{babel}
\usepackage{tocloft}
\newcommand{\nombreindice}{\'Indice General}
\newlistof{indice}{tce}{\nombreindice}
% definition of the commands used for the Spanish ToC;
% \captce for chapters, \sectce for sections and
% \ssectce for subsections
\newcommand\captce[1]{%
\addcontentsline{tce}{chapter}{\protect\makebox[1.3em][l]{\thechapter}#1}}
\newcommand\sectce[1]{%
\addcontentsline{tce}{section}{\protect\makebox[2.8em][l]{\thesection}#1}}
\newcommand\ssectce[1]{%
\addcontentsline{tce}{subsection}{\protect\makebox[3em][l]{\thesubsection}#1}}
\begin{document}
\tableofcontents
\clearpage
\listofindice
\clearpage
\chapter{Test chapter one}
\captce{Cap\'itulo de prueba uno}
\section{Test section one one}
\sectce{Secci\'on de prueba uno uno}
\section{Test section one two}
\sectce{Secci\'on de prueba uno dos}
\subsection{Test subsection one two one}
\ssectce{Subsecci\'on de prueba uno dos uno}
\chapter{Test chapter two}
\captce{Cap\'itulo de prueba dos}
\section{Test section two one}
\sectce{Secci\'on de prueba dos uno}
\subsection{Test subsection two one one}
\ssectce{Subsecci\'on de prueba dos uno uno}
\subsection{Test subsection two one two}
\ssectce{Subsecci\'on de prueba dos uno dos}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
-
- Posts: 1
- Joined: Wed Jun 18, 2014 10:01 pm
Re: Multiple Table of Contents
Hello - I was having this exact same problem and I stumbled upon your answer and it worked brilliantly (I just had to rename the commands and change the title name to their Romanian equivalents). Thank you very much!
Multiple Table of Contents
Hello,
This works, but how do you add \chapter*{Introduction} (unnumbered) to this second list?
greetings
This works, but how do you add \chapter*{Introduction} (unnumbered) to this second list?
greetings
Multiple Table of Contents
I known!
\addcontentsline{tce}{chapter}{Introduction}
\addcontentsline{tce}{chapter}{Introduction}
