12

I've been using MiKTeX for a while, but I haven't really understood what all the output files are. I'm using pdflatex and I've just started using biber for bibliography. When I compile a .tex file I get 9 output files. These 2 I understand:

  • .pdf
  • .log

But I didn't really grasp what is the function of these 7:

  • .synctex.gz
  • .aux
  • .bbl
  • .bcf
  • .blg
  • .out
  • .run
  • .xml
1
17
  • .synctex.gz: Synctex stores a correspondence between the output PDF and the .tex source. Some editors use it to show your cursor position in the PDF or PDF scroll position in the .tex source. See What exactly is SyncTeX?

  • .aux: Open it in a text editor, you'll see this file is used mostly for reference information.

    For example, if you use \ref{} but the corresponding \label{} is only later in the document, LaTeX has not seen it, and won't look ahead. Instead, each time there is a \label{}, a command gets written to the .aux file. Next time you compile your .tex, that .aux is inputted right before the document gets started, and the command you had written to it then registers the value for \ref{}.

  • .toc (bonus): If you use \tableofcontents, this will create a .toc file as well, because just as for the .aux file: there is no looking ahead. The .toc records a \contentsline for each section encountered. Upon use of \tableofcontents, this file is inputted, and each \contentsline constitutes a line in the contents table.

  • .bbl: Is outputted by biber (or bibtex), contains the prepared data to be used by biblatex (or natbib).

  • .bcf: Is outputted by biblatex (or natbib), contains which citations biber (or bibtex) should prepare.

  • .blg: The log file of biber (or bibtex).

  • .out: Used by hyperref to store a list of PDF bookmarks. Note how the information can differ from that in .toc. For example when adding \pdfbookmark without a corresponding one for the TOC, or when using \texorpdfstring. This latter one allows for a different title in the PDF toc. See the following example:

    \section[\texorpdfstring{I'm in document toc!}{I'm in PDF toc!}]{I'm in \TeX!}
    \section{I'm in \texorpdfstring{\TeX{} or toc! $\cos(\theta)$}{PDF toc! cos(\texttheta)}}
    

    You see \texorpdfstring string can be used to provide a fallback for math, which can't be typeset in a PDF toc. I'm using the package \textgreek here.

  • .run.xml: The header of this file contains "logreq request file". According to CTAN, this package logs a couple of useful messages, like "please rerun LaTeX". (https://www.ctan.org/pkg/logreq)

5
  • 1
    Nice summary. Would add that .blg is also the name of the BibTeX log file. May 19 '21 at 9:18
  • @StevenB.Segletes yep, good catch May 19 '21 at 9:20
  • @Teepeemm yes it does. TOC is generator only from .toc. As soon as you use \tableofcontents it setups a file handle to write to a .toc-file, or similar for \tableoffigures. As he didn't mention a .toc-extension, and the .aux-system is a bit interwoven with the .toc files and such, I thought I would give this example anyway May 19 '21 at 19:28
  • @Teepeemm in fact, the reason why there are separate files for each table of ..., is because they are inputted when you use \tableof.... The aux file is read at document load, and generates these files I think, and does other things like setting reference numbers May 19 '21 at 19:32
  • @Teepeemm I've updated my answer to disambiguate between the .toc and .aux. I had kind of hastely written my answer. May 19 '21 at 19:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.