1

How could I produce an extra table of content ?

I want to add a TOC describing the content of another document, is that possible in a simple way ? I know I could write the style and everything but I'd like something à la minipage with new sections in it.

(edit: I use LaTeX)

3
  • You don't need to mark every edit with 'edit:', especially not small ones ;-). Using LaTeX is the default here anyway, so you don't need to mention that. May 5, 2011 at 10:01
  • Is the other document also a LaTeX document which is able to produce a ToC by itself? May 5, 2011 at 10:02
  • Well yes, but my point is that that it could be anything, I just need to be able to insert its structure using the TOC look
    – MP0
    May 5, 2011 at 12:22

1 Answer 1

2

The ToC is generated by a set of \contentsline macros which are written into a .toc file by the sectioning macros. You can use that macro to produce your own ToC. If your other document is also a LaTeX document than you could use its .toc file as a base.

The format of \contentsline (with hyperref loaded) is:

\contentsline {<type>}{<content, may include \numberline>}{<page>}{<label>}

Example:

\contentsline {chapter}{\numberline {1}Chapter text}{1}{chapter.1}
\contentsline {section}{\numberline {1.1}Section text}{1}{section.1}
\contentsline {subsubsection}{Subsubsection text}{8}{section*.3}

You might not need to provide anything for the labels because that ToC will most likely not be hyperlinked.

If you want that ToC to be smaller than normal put it into a \scalebox{<factor>}{<content>} and scale it down. If you place it inside a {minipage}{<width>} environment it will be drawn with this given width. You need to add the ToC heading by yourself using \chapter* or better \section*:

\begin{minipage}{8cm}
\section*{Some other ToC}
\contentsline {chapter}{\numberline {1}Chapter text}{1}{}
\contentsline {section}{\numberline {1.1}Section text}{1}{}
\contentsline {subsubsection}{Subsubsection text}{8}{}
\end{minipage}
2
  • I guess this could fit in a minipage environment ?
    – MP0
    May 5, 2011 at 13:29
  • 1
    @EEva: Yes, see my updated answer. May 5, 2011 at 13:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .