# Tag Info

70

You might not care about these files, but pdflatex does quite a bit. These files hold information collected during the first run(s) and are needed to build the final PDF with correct ToC, references, PDF bookmarks, etc. Your can delete these files afterwards, e.g. manually or using a front-end tool like latexmk (-c option). However, future compilations of ...

52

With MiKTeX and TeX Live you can use --output-directory=dir. This will put all output files including .log and .pdf/.dvi in this directory (and append it to the search path so that auxiliary files are found). In MiKTeX you can additionally set --aux-directory=dir which will put only the auxiliary files in this directory.

52

.fd = Font definition; used in generating the output. .bst = BiBTeX Style File (e.g., a certain journal's preferred Bibliography layout settings); used by BibTeX when generating the bibliography. .aux = LaTeX auxiliary file; created when LaTeX is run, these contain information LaTeX records which is then used by either BibTeX or LaTeX itself on later runs ...

51

You can write to the aux file with \write\@auxout{hello} or \immediate\write\@auxout{hello2} or \protected@write\@auxout{}{hello3} Depending on requirements. \immediate\write writes to the specified file at that point, expanding the supplied tokens (like \edef) so fragile commands will do the wrong thing. \write does not write at that point it ...

41

In addition to Martin's answer, I thought it might be useful to explain why LaTeX creates all these extra files. Let's take the example of the .aux file. Let's say you have a \label in your document and a reference to it somewhere above where the label occurs. When pdflatex reads your .tex file, it reads the \ref first. Now, it doesn't know what to do with ...

40

There is a user friendly LaTeX package: newfile. You can use it to read and write files easily. It provides normal file IO functions, and also verbatim file IO functions. It is more suitable for your example, than those low-level macros. The package document has some good examples. A naive example (similar to table of contents): \documentclass{article} ...

39

if you want get rid of those files in your document directory then use the optional argument -output-directory=whatever. Then all auxiliary files and the pdf are saved in that directory. For example what I use: pdflatex -output-directory=target <file> then my <file>.pdf is also in target, but I always use a softlink ln -s ...

36

The reason for an ignore file list is the following. When your VCS spots a file in the directory that it isn't versioning, it tells you about it (politely). For example, in one of my directories then running bzr status, I get the following message: tex.SE% bzr status unknown: Project/ braids.sty@ bzr_test/ lessonplan.cls@ lessonplan.sty@ ...

35

Based on this example on texample.net I have created this diagram: This infographic is an attempt to visualize the interaction of 'User level' and 'Software/file level' in LaTeX workflow. Sources available here. This is not exactly an answer. To give an idea of the files involved in the compilation, the node named ".tex file" should be elaborated further. ...

29

If you have one write handle left you can do it with the following commands which are also used for .toc, .lof, .lot, etc. \@starttoc{<extension>} Reads the file with the given extension (\jobname.<extension>) and opens it for writing afterwards. The file is initially empty. Creates the output file handle \tf@<extension> . ...

27

No, TeX itself can't delete files, just create or overwrite them. You need to use an external tool, like a LaTeX editor or Makefile to delete it for you. For example latexmk has a -c option which cleans up all auxiliary files. I also use Makefiles under Linux which contain a clean rule which remove all auxiliary files. However, this isn't really a good way ...

26

Bibliographies Manually created .bib: The data base file containing your bibliography entries. Created by you. .bst: BibTeX style file. Determines how the bibliography looks (usually downloaded from somewhere). .bbx: A biblatex bibliography style. Created by users. .cbx: A biblatex cite style. Created by users. Automatically created .bbl: ...

25

You already got lots of very good answers explaining why pdflatex needs all those auxiliary files. However you might still feel frustrated about having to live with all those files polluting a directory where (I'm guessing) you would like to keep all your LaTeX documents and their corresponding .pdf outputs. The best solution is to keep one directory for ...

25

How does LaTeX implement UTF-8? The Unicode character é is encoded as two byte in UTF-8, precisely <C3><A9> (I'll use throughout this to denote bytes, also when they are character tokens for TeX). When \usepackage[utf8]{inputenc} is loaded, the byte <C3> is made active and defined to look for the following byte, because <C3> in UTF-8 ...

24

Each document in a different folder, is a good archiving. Though I usually remove auxiliary files, keeping the tex source and pdf output, for convenience. The dedicated document folder keeps your file system clean if you compile again. I organize my documents in topic folders, first such as letters, articles, books, and below subfolders such as job, private ...

24

You want the macro \jobname. This isn't quite the filename; to quote from the TeX FAQ: TeX retains what it considers the name of the job, only, in the primitive \jobname; this is the name of the file first handed to TeX, stripped of its directory name and of any extension (such as .tex). If no file was passed (i.e., you're using TeX interactively), ...

24

TeX writes the .log file. It contains more information about processing the job than what is shown on the console. It's very useful for debugging. LaTeX writes the .aux and .toc files. They are used for managing cross-references and table-of-contents information. Since TeX's organism digests the input document from beginning to end, once per job, ...

23

General Manually created .tex: The document itself Created by you. Automatically created .aux: An auxiliary file that saves information for the creation of ToC, references, indices, bibliographies and other things like that. It is reread in the next compiling to create the ToC, references etc. Created by (pdf/xe/lua)(la)tex .toc: An auxiliary file ...

23

Writing balanced braces doesn't require anything special, as the following transcript of an interactive TeX session shows: $tex This is TeX, Version 3.1415926 (TeX Live 2011) **\relax *\newwrite\mywr *\immediate\openout\mywr=temp.dat *\immediate\write\mywr{{}} *\bye No pages of output. Transcript written on texput.log.$ cat temp.dat {} If you want to ...

21

LaTeX and its packages produce a variety of auxiliary files. There are also some external tools which create their own files. Then there is the set of output files generated by (La)TeX like DVI, PS and PDF files which you may or may not want to put under version control. Normally you don't. The reason some extension are missing in some lists is because the ...

20

For portability purposes, as well as keeping things clean/tidy, I use embedfile to attach the source .tex (as well as other required sources) to the output .pdf. The attachment is compressed, which also saves some space. Then, once a project is complete, you can erase everything but the .pdf. The requirement though is that you use pdflatex. Here is a ...

19

This may be a job easily done with the help of your tex editor. With winedt, it is done like this (for miktex only ): Go to winedt menu Options ---> Execution Modes. In the window that opens choose TeX Options: Make the modifications as shown in the picture. Give OK and come out. Now all the auxiliary files will be stored inside a folder TeXAux inside ...

19

The files that you are talking about (.log, .aux., .bbl., .blg, .toc, etc.) are created by LaTeX (or BibTeX, or any other auxiliary program) “on the fly.” They are usually dependent on the source .tex file. Since there's no information in those files that's unique to them (i.e., that can't be recovered from the source .tex file) and you would never edit ...

19

It depends on how paranoid your settings in texmf.cnf are. Mine (default texlive 2014) says: % Allow TeX \openin, \openout, or \input on filenames starting with .' % (e.g., .rhosts) or outside the current tree (e.g., /etc/passwd)? % a (any) : any file can be opened. % r (restricted) : disallow opening "dotfiles". % p (paranoid) : as r' and ...

19

You can use the draft mode: -draftmode Sets \pdfdraftmode so pdfTeX doesn't write a PDF and doesn't read any included images, thus speeding up execution. Arara also supports it, here's an example for TeXworks: % arara: pdflatex: { draft : yes } I use the following snippet to compile a large document with hundreds of pages and ...

18

I've made a new version of latexmk, which supports -aux-directory and -output-directory. It's v. 4.27a and can be found at http://www.phys.psu.edu/~collins/latexmk/versions.html This version will be submitted to CTAN fairly soon, but some feedback would be useful, since I have not tested the new features extensively, especially as I don't have current ...

18

General Layout and Package files Manually created .cls: Class files containing settings for you document and providing the basic macros for the mark up, e.g \section. Created by users or latex with an ins file. .def: Collection of a list of similar definitions, that would make a sty file long and unreadable. See What does the .def file do?, and When to ...

17

If you change this in \protected@write the side effects are severe. For example, \protected@write is used in \label. The page number is not known right away in general. The delay of the \write without \immediate writes the entry at page shipout time, when the page number is known. Thus do not change \protected@write. If you need immediate writing, use a new ...

17

beamer special files In addition to the standard .aux, .log, and .toc files, a beamer document will also create the following auxiliary files: .nav: contains the information needed for the navigation bar hyperlinks. .vrb: will contain the verbatim material when fragile (containing verbatim material) frames. .snm: will contain information that will be used ...

17

The .aux file is read as part of the \document macro (\begin{document}) but before the \AtBeginDocument hook is used. (You can check this by inserting some 'test code' into the .aux file and the hook.) Writing to the .aux file takes place both 'immediately' and at shipout. The latter is important to get for example the correct page numbers for ...

Only top voted, non community-wiki answers of a minimum length are eligible