TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In addition to the .tex and .dvi or .pdf files, TeX/LaTeX/ConTeXt produces and uses lots of other files. What do they do? Which ones are used to create the document and which ones are automatically created by the compiler. What files can I safely delete?

share|improve this question
up vote 53 down vote accepted

.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 (e.g., about cross-references), and can contain other things as well. This file is created by running LaTeX but also used the next time LaTeX is run. It can be deleted, but then you may need to run multiple times in the future to regenerate it.

.bbl = Bibliography; this is what is outputted by BibTeX for insertion into LaTeX the next time LaTeX is run.

.blg = Bibliography (BiBTeX) log -- just like .log but for BibTeX; generated by BibTeX and can be safely deleted if there's no need to check it for errors.

.brf = BackReference file for the backref package, I think. I'm not very familiar with these, but I suspect they're created by LaTeX when a file using that package is compiled.

.cls = Documentclass (like article, or report - if you have them cluttering up your folders, you must use a lot of custom classes for individual journals or universities, etc.) This is obviously used to generate the output.

.dtx = Documented source file; can be used to generate a LaTeX package or other file along with its associated documentation.

Of these, .aux and .blg can be safely deleted. Probably .bbl too if you don't mind rerunning BibTeX and have access to the .bib files needed. The rest shouldn't be deleted but maybe moved somewhere more appropriate. In particular .df, .cls, and .dtx are better taking up space on a (personal) TeX tree, not in the folder of the document you're working on.

share|improve this answer
Thanks very much. Actually, I forgot another extension which is .lbl. Could you please edit your answer to tell me what it is? – Rafid Dec 26 '10 at 16:50
I'm afraid I don't know what a .lbl file is. Probably something specific to a package, like .brf, and the letters suggest something having to do with labels. What packages are you using for things like that? Almost all of these are plain text files, so you could open it and see what's inside. – frabjous Dec 26 '10 at 17:19


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: bibliography environment, generated by BibTeX.
    This is what the call to bibtex produces and what is included into your document by the \bibliography command.
  • .blg: bibtex and biber log file.
    Created by bibtex/biber.
  • .bcf: biblatex control file.
  • .run.xml: biber XML file.
  • -blx.bib: biblatex control file.
share|improve this answer


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 that stores the Table of Contents, read in on subsequent runs to create the actual ToC.
    Created by (pdf)latex, xe(la)tex.

  • .lof: An auxiliary file that stores the List of Figures, read in on subsequent runs to create the actual LoF.
    Created by (pdf)latex, xe(la)tex.

  • .lot: An auxiliary file that stores the List of Tables, read in on subsequent runs to create the actual LoT.
    Created by (pdf)latex, xe(la)tex.

  • .log: Stors all messages of the compilation, like errors and warnings. It’s used by most Editors / LaTeX IDEs to show the errors in you document.
    Created by (pdf)latex, xe(la)tex.

  • .pdf: The common output format for your document.
    Created by pdflatex, xelatex, ps2pdf, dvipdf.

share|improve this answer

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 use ".sty" extension and when to use ".def".

  • .dtx: Source file containing template files, like classes and styles and their documentation.
    Created by users.

  • .ins: installation file to extract template files out of a dtx file. Created by users.

  • .sty: Style file containing macro definitions and other extensions for your document. Created by users or latex with an ins file.

Automatically created

share|improve this answer
These are not templates! – Joseph Wright May 14 '12 at 7:00
@JosephWright: Maybe it’s the wrong word, I’m no native speaker. Pleas change it if you find a better title :-) – Tobi May 14 '12 at 7:27

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 by \pgfimage to include actual slides when using the beamerarticle package.

  • .out: contains information about the sectional units that will be used to write the outlines.

share|improve this answer

I think you don't need to worry about files other than *.tex, *.cls and *.sty.

  1. *.tex is the extension for input files in which you put your document content and format. You can have more than one input file for your project. But only one input file can contain \documentclass call. The input file contains \documentclass call is called as your main input file.

  2. *.cls is the extension for documentclass containing layout settings and commands. There are many documentclass, such as article, book, minimal, report, etc. From within your main input file, you call this document class using the command \documentclass{book}, for example. Calling \documentclass{book} means you want to create a book project. In book project, you will have some settings such as chapter, section, subsection, subsubsection, frontmatter, mainmatter, backmatter, etc. Other documentclass also has different settings.

  3. *.sty is the extension for package containing class-agnostic commands. There are many packages. Each provides different purposes and works indendepently. For example, if you want to draw Euclid diagram for your project, you can use pst-eucl.sty. From within your main input file, you call this package by using \usepackage{pst-eucl}.

As the rule of thumbs: You may accidently lose files other than your input files, image files, data files. If you lost *.cls and *.sty, download again from the internet. If you lost *.aux, just compile again your input file.

share|improve this answer
I don't understand why someone wouldn't need to worry about .bst or .fd files, etc. Deleting those could definitely cause problems. – frabjous Dec 26 '10 at 15:58
@frabjous. I don't say the other files are not important. :-) – xport Dec 26 '10 at 16:02
@frabjous: I would read "don't worry about them" as "leave them be: don't try to understand what's going on with them, for now, just treat them as part of the magic of TeX", certainly not as "they're not important; you may as well delete them"! – Peter LeFanu Lumsdaine Dec 26 '10 at 21:04
Fair enough! Just so long as it is clear, which it wasn't to me, and may not have been to others. (It is now, thank!.) – frabjous Dec 26 '10 at 22:06

ConTeXt MkIV related files:

User-Input Files

  • .tex: For content and typesetting instructions.
  • .cld: For ConTeXt Lua Documents
  • .xml: For XML data (related: .xhtml)

Macro package files

  • .mkiv: Code for MkIV
  • .mkvi: Code for MkIV written with named variables \def\macro#{val1}#{val2} rather than \def\macro#1#2, etc.)
  • .lua: Lua code for MkIV
  • .lfg: Goodies for fonts (used for creating virtual fonts and changing parameters defined in fonts)

  • .mpiv: Metapost code for MkIV

Automatically generated

  • .tuc: Data stored for multiple passes, ToC, etc.
  • .log: Log file

You can safely delete the .tuc and .log files. These can be automatically deleted if you run

context --purgeall
share|improve this answer

Some further extension you might encounter depending on what packages you are using:

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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