Is there a way to manually create a Table of Contents (by writing each item one by one), instead of using \tableofcontents
which automatically generates one?
Here is why I need this. I need to compile several different PDF files into one single one. And those files are written by different document classes and in different settings; it is hard to put them into one single LaTeX file. So, I will put those PDF files together and only change page numbers. But then I need a table of contents page and I need to create this one out of nothing.
Best Answer
Assume you have files
file1.pdf
(3 pages),file2.pdf
(6 pages) andfile3.pdf
(9 pages) that you want to compile into a single PDF containing 19 pages, where the first page is a Table of Contents.Construct the contents using a set of manual function for (say)
\section
s and\subsection
s. The idea would be to write directly to the.toc
file the sectional unit number, title and page number:You can expand the structure to lower levels, if needed.