Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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?

share|improve this question
1  
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
show 1 more comment

3 Answers

up vote 7 down vote accepted

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}%
    \addcontentsline{tos}{section}{\protect\numberline{\thesection} Palabra}
    

    and similarly for subsections etc.

share|improve this answer
    
you are the best! It works perfectly! If you write adhoc code, it works for sub and subsub sections,too... However to complete your answer, we can define 3 new commands in the preamble, after Boris' code obviously, in this way: 1) \newcommand\sectionit[1]{\addcontentsline{tos}{section}% {\protect\numberline{\thesection} #1}} 2) \newcommand\subsectionit[1]{\addcontentsline{tos}{subsection}% {\protect\numberline{\thesubsection} #1}} 3) \newcommand\subsubsectionit[1]{\addcontentsline{tos}{subsubsection}% {\protect\numberline{\thesubsubsection} #1}} Thanks a lot! –  Daniele Feb 14 '13 at 10:33
add comment

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.

share|improve this answer
    
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
add comment

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}
share|improve this answer
    
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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.