How do I insert the table of contents of a document into another LaTeX
document? If this is even possible.
In the first document, the ToC
is created using \tableofcontents
edited from comments:
(partial) MWE:
\documentclass[%
paper=A4, twoside=true, openright, parskip=full, chapterprefix=true,
11pt, headings=normal, bibliography=totoc, listof=totoc,
titlepage=on, captions=tableabove, draft=false,
]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage[
figuresep=colon,
sansserif=false,
hangfigurecaption=false,
hangsection=true,
hangsubsection=true,
colorize=full,
colortheme=bluemagenta,
]{cleanthesis}
\usepackage{amsmath}
\usepackage{cleveref}
\usepackage{tabularx}
\usepackage{epstopdf}
\usepackage{placeins}
\usepackage{float}
\usepackage{amssymb}
\usepackage{color}
\restylefloat{figure}
\usepackage{tablefootnote}
\usepackage[framed,numbered,autolinebreaks,useliterate]{mcode}
\lstset{breakatwhitespace=false}
\usepackage{courier}
\usepackage{appendix}
\usepackage{booktabs}
\usepackage{eso-pic}
\usepackage{pbox}
\usepackage{ragged2e}
\usepackage{adjustbox}
\usepackage{graphicx} %allows for including images
\usepackage{biblatex}
\addbibresource{bib-refs}
\usepackage{pdfpages}
\usepackage{subcaption}
\usepackage{xcolor,colortbl}
\usepackage{multirow}
.toc
file:
\boolfalse {citerequest}
\boolfalse {citetracker}
\boolfalse {pagetracker}
\boolfalse {backtracker}\relax
\defcounter {refsection}{0}\relax
\select@language {english}
\defcounter {refsection}{0}\relax
\contentsline {chapter}{\numberline {1}Introduction}{1}{chapter.1}
\defcounter {refsection}{0}\relax
\contentsline {section}{\numberline {1.1} Expansion Project}{1}{section*.11}
\defcounter {refsection}{0}\relax
\contentsline {section}{\numberline {1.2} Safety Management}{2}{section*.12}
\defcounter {refsection}{0}\relax
Best Answer
It's possible to include an external
.toc
file, but tedious and the usability is limited, since the page numbers etc. are not consistent, most likely.The shown
.toc
file was made withhyperref
, which complicats the whole issue.But here's a way:
And the
otherdoc.toc
:Please note that
mcode
changes the section headings etc and seems to be incompatible withKOMA
.