# TOC in double language

For my thesis, I have to write the table of contents in two different languages.. (don't ask me why...). Is there a way to do it?

-
Welcome to TeX.sx! Is it the table of contents or the index? Italians often confuse the two. –  egreg Feb 13 '13 at 17:53
if the answer to @egreg s question is yes, then of course the answer would be a totally different one. –  Frank Mittelbach Feb 13 '13 at 18:01
Yes, you're right! I'm confusing, sorry... I need a table of contents in two different languages. I edit the question. –  Daniele Feb 13 '13 at 18:08
You probably should start a new topic with the new question to make the site easier to work with –  Boris Feb 13 '13 at 18:38
@Daniele Should you translate the titles of chapters and sections? What level of sectioning do you want to be listed? –  egreg Feb 13 '13 at 18:46

Since you changed the question, here is how to make an additional TOC in a different language.

1. Look how is `\tableofcontents` defined in your class. For example, in `article.cls` it is defined as

``````\newcommand\tableofcontents{%
\section*{\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
\@starttoc{toc}%
}
``````

So we can define a new table with filename `file.tos` and define it as

``````\makeatletter
\newcommand\spanishtableofcontents{%
\selectlanguage{spanish}%
\section*{\contentsname
\@mkboth{%
\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
\@starttoc{tos}%
\selectlanguage{english}%
}
\makeatother
``````
2. Now just add to your sectioning commands writing to the new table (it is possible to add this to the command itself, but since you need to translate the heading anyway, it might be simpler to do it manually):

``````\section{Word}%
``````

and similarly for subsections etc.

-

If you have an index in several languages then you mean that you have different index entries that sort differently. This can be easily achieved, for example with the `index` package. This package supports the generation of different indexes via the command `\newindex` and the entries then end up in different files.

Each of those files can then be sorted individually using, say `makeindex`.

-
Sorry, but I wanted to say table of contents, not index, so I think (how you have said before) it's very different... However I already modified my question. –  Daniele Feb 13 '13 at 18:21
@Daniele would make more sense to ask a new question as your original also make sense and could help others –  Frank Mittelbach Feb 13 '13 at 21:46

I would do it in this way using `multind` package and `babel`:

``````\usepackage{multind}
\makeindex{spanish}
\makeindex{english}

...

The word\index{english}{Word}\index{spanish}{Palabra}

...

\selectlanguage{spanish}
\printindex{spanish}
\selectlanguage{english}
\printindex{english}
``````
-
Sorry, but I wanted to say table of contents, not index, so I think it's very different... However I already modified my question. –  Daniele Feb 13 '13 at 18:22