I am working on a document that requires multiple compilations as it has a TOC, page numbers and fancy headers with section titles in header.
How do I do this using AUCTeX? I am running spacemacs. And the only options available are
Since AUCTeX version 11.89, AUCTeX comes with a command called
TeX-command-run-all. From the manual:
C-c C-a) Compile the current document until an error occurs or it is finished. If compilation finishes successfully, run the viewer at the end.
N.B. I don't use Spacemacs.
When you have multiple compilations to go through, latexmk is your friend. From its CTAN description
Latexmk completely automates the process of generating a LaTeX document. Given the source files for a document, latexmk issues the appropriate sequence of commands to generate a .dvi, .ps, .pdf or hardcopy version of the document.
An important feature is the “preview continuous mode”, where the script watches all of the source files (primary file and included TeX and graphics files), and reruns LaTeX, etc., whenever a source file has changed. Thus a previewer can offer a display of the document’s latest state.
Works with most TeX engines (not context). IMO the best is to start latekmk once in the background, in your shell : you don't need to type any combo, each save makes latexmk running. If you run an Unix, my advice would be not to deal with AucTeX integration.
Anyway, there is an emacs package for AucTeX and latexmk interaction : auctex-latexmk. You can install it with MELPA
install-package. I did not tried it but looks like it does the job. Changes in your .emacs are described in the project page.