2

I'm currently trying to run TOC while combining multiple PDF documents, however i have to run it twice before TOC shows up. I was wondering if there is anyway to avoid running it twice to generate the TOC.

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. Others can explain (or link to) reasons for the multiple passes, but some tools to help automate the process include latexmk, texify, and arara. – Mike Renfro Sep 26 '16 at 14:10
  • Hey, i have read up on texify but that still runs it twice as it will be too time consuming to run it twice – DOGGIES52 Sep 26 '16 at 14:13
  • Then you have a different question: why does the document compile so slowly? And how long does it take to compile? – Mike Renfro Sep 26 '16 at 14:16
  • Im compiling alot of documents over a couple hundred pages i just dont want to re compile each time i want to compile different documents – DOGGIES52 Sep 26 '16 at 14:37
  • see http://tex.stackexchange.com/questions/255957/generate-table-of-contents-pages-without-a-full-recompile – touhami Sep 26 '16 at 15:38
  • Aside from what touhami linked and explained, "a lot" and "time consuming" is somewhat vague and difficult to give advice on. Ten documents? Hundreds of documents? How different are the final documents: could you get away with compiling sub-documents to PDFs and including the PDFs without regenerating the whole document from scratch? Is the build time a matter of seconds, tens of seconds, several minutes? – Mike Renfro Sep 26 '16 at 22:04

1 Answers1

3

Have you noticed that when you make a TeX file that you get several files back after running it for the first time? One file is your .tex file, another is the .pdf. Other files do other things, but one of the files created is a .toc file. The information that stores page numbers for the TOC is in that file.

You need to run the code once in order to store those pages in the proper place. Then you need to run the code again for that information to be printed into the TOC on your PDF.

wolf_math
  • 357