.gitignore for TeX

167 ignore rules for TeX, ready to copy into your repository.

Typesetting system

The complete .gitignore for TeX

# Generated by LFGitignore - https://lfgitignore.com
# Created: 2025-11-18 09:20:36 UTC
# Technologies: TeX

### TeX ###
*.lof
*.lot
*.fls
*.toc
*.fmt
*.fot
# Log file
*.log
*.cb
*.cb2
.*.lb
*.dvi
*.xdv
*-converted-to.*
*.aux
.pdf
*.bbl
*.bbl-SAVE-ERROR
# generic executable outputs
*.out
*.bcf
*.bcf-SAVE-ERROR
*.blg
*-blx.aux
*-blx.bib
*.run.xml
*.fdb_latexmk
*.synctex
*.synctex(busy)
*.synctex.gz
*.synctex.gz(busy)
*.pdfsync
*.rubbercache
rubber.cache
latex.out/
*.alg
*.loa
acs-*.bib
*.thm
*.atfi
*.nav
*.pre
*.snm
*.vrb
*.soc
*.loc
*.cut
*.cpt
*.spl
*.ent
*.lox
*.mf
*.mp
*.t[1-9]
*.t[1-9][0-9]
*.tfm
*.end
*.?end
*.[1-9]
*.[1-9][0-9]
*.[1-9][0-9][0-9]
*.[1-9]R
*.[1-9][0-9]R
*.[1-9][0-9][0-9]R
*.eledsec[1-9]
*.eledsec[1-9]R
*.eledsec[1-9][0-9]
*.eledsec[1-9][0-9]R
*.eledsec[1-9][0-9][0-9]
*.eledsec[1-9][0-9][0-9]R
*.acn
*.acr
*.glg
*.glg-abr
*.glo
*.glo-abr
*.gls
*.gls-abr
*.glsdefs
*.lzo
*.lzs
*.slg
*.slo
*.sls
*.gnuplot
*.table
*-gnuplottex-*
*.gaux
*.glog
*.gtex
*.4ct
*.4tc
*.idv
*.lg
*.trc
*.xref
*.hd
*.brf
*-concordance.tex
*-tikzDictionary
*.lol
*.ltjruby
*.idx
*.ilg
*.ind
*.maf
*.mlf
*.mlt
*.mtc[0-9]*
*.slf[0-9]*
*.slt[0-9]*
*.stc[0-9]*
_minted*
*.data.minted
*.pyg
*.mw
*.newpax
*.nlg
*.nlo
*.nls
*.pax
*.pdfpc
*.sagetex.sage
*.sagetex.py
*.sagetex.scmd
*.wrt
*.spell.bad
*.spell.txt
svg-inkscape/
*.sout
*.sympy
sympy-plots-for-*.tex/
*.upa
*.upb
*.pytxcode
pythontex-files-*/
*.listing
*.loe
*.dpth
*.md5
*.auxlock
*.ptc
*.tdo
*.hst
*.ver
*.lod
*.xcp
*.xmpi
*.xdy
*.xyc
*.xyd
*.ttt
*.fff
TSWLatexianTemp*
# Backup file
*.bak
*.sav
*.bak[0-9]*
.texpadtmp
*.lyx~
# Backup file
*.backup
# Vim hidden swap file
.*.swp
*~[0-9]*
*.tps
./auto/*
*.el
*-tags.tex
*.sta
*.lpz
*.xwm

What these TeX rules actually ignore

Every pattern below, and why it belongs in your .gitignore.

General

Pattern What it ignores
*.lof General
*.lot General
*.fls General
*.toc General
*.fmt General
*.fot General
*.log Log file
*.cb General
*.cb2 General
.*.lb General
*.dvi # Intermediate documents:
*.xdv General
*-converted-to.* General
.pdf # Generated if empty string is given at "Please type another file name for output:"
*.aux General
*.bbl # Bibliography auxiliary files (bibtex/biblatex/biber):
*.bbl-SAVE-ERROR General
*.out generic executable outputs
*.bcf General
*.bcf-SAVE-ERROR General
*.blg General
*-blx.aux General
*-blx.bib General
*.run.xml General
*.fdb_latexmk # Build tool auxiliary files:
*.synctex General
*.synctex(busy) General
*.synctex.gz General
*.synctex.gz(busy) General
*.pdfsync General
*.rubbercache General
rubber.cache General
latex.out/ # Build tool directories for auxiliary files latexrun
*.alg # Auxiliary and intermediate files from other packages: algorithms
*.loa General
acs-*.bib achemso
*.thm amsthm
*.atfi attachfile2
*.nav beamer
*.pre General
*.snm General
*.vrb General
*.soc changes
*.loc General
*.cut comment
*.cpt cprotect
*.spl elsarticle (documentclass of Elsevier journals)
*.ent endnotes
*.lox fixme
*.mf feynmf/feynmp
*.mp General
*.t[1-9] General
*.t[1-9][0-9] General
*.tfm General
*.end (r)(e)ledmac/(r)(e)ledpar
*.?end General
*.[1-9] General
*.[1-9][0-9] General
*.[1-9][0-9][0-9] General
*.[1-9]R General
*.[1-9][0-9]R General
*.[1-9][0-9][0-9]R General
*.eledsec[1-9] General
*.eledsec[1-9]R General
*.eledsec[1-9][0-9] General
*.eledsec[1-9][0-9]R General
*.eledsec[1-9][0-9][0-9] General
*.eledsec[1-9][0-9][0-9]R General
*.acn glossaries
*.acr General
*.glg General
*.glg-abr General
*.glo General
*.glo-abr General
*.gls General
*.gls-abr General
*.glsdefs General
*.lzo General
*.lzs General
*.slg General
*.slo General
*.sls General
*.gnuplot gnuplot
*.table General
*-gnuplottex-* gnuplottex
*.gaux gregoriotex
*.glog General
*.gtex General
*.4ct htlatex
*.4tc General
*.idv General
*.lg General
*.trc General
*.xref General
*.hd hypdoc
*.brf hyperref
*-concordance.tex knitr
*-tikzDictionary TODO Uncomment the next line if you use knitr and want to ignore its generated tikz files *.tikz
*.lol listings
*.ltjruby luatexja-ruby
*.idx makeidx
*.ilg General
*.ind General
*.maf minitoc
*.mlf General
*.mlt General
*.mtc[0-9]* General
*.slf[0-9]* General
*.slt[0-9]* General
*.stc[0-9]* General
_minted* minted
*.data.minted General
*.pyg General
*.mw morewrites
*.newpax newpax
*.nlg nomencl
*.nlo General
*.nls General
*.pax pax
*.pdfpc pdfpcnotes
*.sagetex.sage sagetex
*.sagetex.py General
*.sagetex.scmd General
*.wrt scrwfile
*.spell.bad spelling
*.spell.txt General
svg-inkscape/ svg
*.sout sympy
*.sympy General
sympy-plots-for-*.tex/ General
*.upa pdfcomment
*.upb General
*.pytxcode pythontex
pythontex-files-*/ General
*.listing tcolorbox
*.loe thmtools

TikZ & PGF

Pattern What it ignores
*.dpth TikZ & PGF
*.md5 TikZ & PGF
*.auxlock TikZ & PGF
*.ptc titletoc
*.tdo todonotes
*.hst vhistory
*.ver TikZ & PGF
*.lod easy-todo
*.xcp xcolor
*.xmpi xmpincl
*.xdy xindy
*.xyc xypic precompiled matrices and outlines
*.xyd TikZ & PGF
*.ttt endfloat
*.fff TikZ & PGF

Latexian

Pattern What it ignores
TSWLatexianTemp* Latexian

WinEdt

Pattern What it ignores
*.bak Backup file
*.sav WinEdt
*.bak[0-9]* latexindent.pl

Texpad

Pattern What it ignores
.texpadtmp Texpad

LyX

Pattern What it ignores
*.lyx~ LyX

Kile

Pattern What it ignores
*.backup Backup file
.*.swp Vim hidden swap file

KBibTeX

Pattern What it ignores
*~[0-9]* KBibTeX

TeXnicCenter

Pattern What it ignores
*.tps TeXnicCenter
./auto/* auto folder when using emacs and auctex
*.el TeXnicCenter
*-tags.tex expex forward references with \gathertags
*.sta standalone packages

Makeindex log files

Pattern What it ignores
*.lpz Makeindex log files
*.xwm xwatermark package

How to use this .gitignore for TeX

  1. Copy the TeX rules above, or download the file directly.
  2. Create a file named .gitignore at the root of your Git repository and paste the rules into it.
  3. If some of those files are already tracked, run git rm -r --cached . then commit again — Git only applies ignore rules to untracked files.
  4. Commit the .gitignore so everyone on the team shares the same rules.

Other Tool .gitignore templates

See every Tool template