Automatically produce outline?
LaTeX generates a file with the extension .toc
which contains the required TOC commands. You could simply include that file into an outline document.
So, let's say, your main document is called main.tex. The file containing the table of contents is then main.toc. Create a new document outline.tex, within that use \input{main.toc}
. Use makeatletter
and \makeatother
for the case that the .toc file might contain internal macros, such as \select@language {english}
of babel. Group those actions to keep settings local. For the outline, you might wish to use the same settings respectively preamble like your main document does.
So, this could be such an outline document:
\documentclass{article}
% your preamble settings you wish to keep: fonts etc.
\begin{document}
\begingroup
\section*{\contentsname}
\makeatletter
\input{main.toc}
\makeatother
\endgroup
\end{document}
Looking at two places might further be useful in this matter:
- the definition of
\tableofcontents
in your document class file - the definition of
\@starttoc
withinlatex.ltx
or in a customized class/package.
Of course this works also for lists of tables and figures.