Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Git: .gitignore file for LaTeX projects
*.aux
*.glo
*.idx
*.log
*.toc
*.ist
*.acn
*.acr
*.alg
*.bbl
*.blg
*.dvi
*.glg
*.gls
*.ilg
*.ind
*.lof
*.lot
*.maf
*.mtc
*.mtc1
*.out
*.synctex.gz
@cflewis

Excellent! Thanks for this!

I might consider adding '*.synctex.gz'.

@kogakure
Owner

Thank you! Good idea, I added it.

@quantumelixir

Why not use this instead:

$ cat .gitignore
*
!myfile.tex
@cflewis

Because it's decently rare that a .tex file exists by itself, there's BibTeX files, figures, usually some sort of misc notes you want (I even have a rake file using rake-latex from Oxford Uni).

All that said, if you really do have a .tex file in isolation, that's a good solution :)

@bilderbuchi

excellent, just what i need! thanks.

@rbochet

Thank you for this great file !
I forked it for Mac users : https://gist.github.com/871983

@welldan97

Cool! Thank you!

@jberger

If using latexmk to manage the compile process, add *.fdb_latexmk

@Gecko136

I added *\#* to my list to not track the emacs backup files.

@aramk

I added *.pdf since this is an output file and not a source file. The same could apply to *.dvi.

@luisibanez

Thanks !, very useful.

@TKAB

if using the pagebackref option of the hyperref package you also get a *.brf file.

@jaseemabid

I would sort it alphabetically :) Good one!

@restrepo

While for AUCTeX you also get files like:
region.*
prv_.fmt
prv_
.log

@agravier

Thank you Stefan, this is nice and useful. You may also want to include *.lol (List of Listings), produced by the listings package.

@ernie-cordell

Thank You, indeed. My "manuscript" got rather large and manually tracking changes piecemeal got unmanageable, thankfully I opted way back then to compose it in \LaTeX so now that I've been able to regenerate it from ancient source, I'll be able to track it, too.

@dr0bz

Just what i was looking for, great! What about adding *.pdf? And for TexMaker users

*.bak
build/

is useful also.

@clemenskroell

nice. thanks!

@nasenatmer

Yay! Cheers!

@pquentin

Thanks!

BTW, biber creates *.bcf and *.run.xml files.

@palday

*.snm and *.nav for beamer!

@johnedvard

Thanks

@sauloperez

Thanks for cleaning up my fat repo!

@joostrijneveld

I see multiple comments suggesting adding *.pdf, but as of yet it was not included.. Is there an argument to leave it out?

@willfrew

This is perfect, Thanks!

@denisrmp

Thanks!

@mmrko

Thanks :)

@jostjernberg

joostrijneveld: adding *.pdf to a standard .gitignore is a bad idea since pictures in latex documents often are included in pdf format.

I would also argue that it's pretty convenient for someone not interested in editing the document to have easy access to the output pdf file, without having to download any non-common packages and building it manually.

@pSub

Thanks!

@blckshrk

Hi,

Thanks for your sharing. I propose to add *.run.xml which is generated by biber.

@pSub

I propose to add *.xdy which is created by xindy, an index processor. You can find the addition in my fork.

@ConX

Thank you!

@ahsegar

Thank you from a very new git and latex user!

@faheemawan

i am new to git, and i want to share latex project over here, with all the figures, bib files and tex file.

@alfred-s

thanks as well!
would it be possible to add a line that excludes the .pdf file if there is a corrisponding .tex file?

@HBadertscher

Nice, thanks for sharing. I suggest adding *eps-converted-to.pdf to remove the PDF files generated by epstopdf.

@magnli10

Thanks a bunch!

@rumpelsepp

Thx. Some things to add:

  • *.fdb_latexmk
  • *.xml
  • *.pdf
  • *.fls
  • *.bcf
  • *.pyg
@trodrigu

Thank you

@shreyaspotnis

Thanks! This is very useful

@jan-glx

*.bcf
*.run.xml

@cciotti-ge

This is great, thanks.

@bispojr

Thanks... very good!

I might consider adding '*.brf'.

@SuzanaK

I usually add *.tex~ and *.tex.backup.

@HarryLong

Thanks !

@oliviaguest

I needed to also add:

    *.nav
    *.snm
    *.vrb
@rodolphopivetta

I add:

*.ps
@felixfbecker

I added

*.log
*.pdf
@klauswarzecha

Excellent! Thank you very much for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.