Closely Related:
- Mimicking LaTeX's "table of contents" functionality
Using documentclass{minimal}, what is the shortest way to write a low-level asynchronous Table of Contents, (without minitoc, etc.)?
I am hoping to understand the low level API functionality. (I already know how to use the higher level packages, (tocloft, minitoc, etc).
Currently, I have created a "wrapper" around tocloft with an easier to use interface. However, Eventually I would like to remove that dependency.
Note: I am using the term Asynchronous Table of Contents in the sense of a dynamic artifact that is generated as input files are read, (\chapter headings and so on), rather than a static table that is defined and rendered manually.
This question really is related to how to use the write command, or how to use some other asynchronous method to dynamically generate a basic Table of Contents.
Pseudocode:
\ChapterMacroDefinition % Is this where the `\write` magic occurs?
\TableOfContentsPlaceHolder % Is there an "End Document" handler?
\Chapter{My First Chapter}
... Chapter One Contents
\Chapter{My Second Chapter}
... Chapter Two Contents
Notes: This is apart from any formatting or section levels, etc.
minimal? It's essentially a test class. Are you interested in the detail of how TOCs work, or is this a more practical question? – Joseph Wright Mar 15 '19 at 11:50auxandtocfiles on the first compiler pass, and then reading theauxandtocfiles in on the second compiler pass? – Steven B. Segletes Mar 15 '19 at 13:30\tableofcontentsdoes? Just drop the minimal class – daleif Mar 15 '19 at 13:31\tableofcontentsdoes. As mentioned in the previous comments, I am trying to understand the low level API functionality. (I already know how to use the higher level packages, (tocloft,minitoc, etc). – elika kohen Mar 15 '19 at 13:34\documentclass{article} \begin{document} \tableofcontents \section{HERE} \end{document}and compile it ONCE. Then, look at the output, and look at theauxfile, and look at thetocfile. Then compile it AGAIN. See how it works? – Steven B. Segletes Mar 15 '19 at 13:37