Skip to content

Instantly share code, notes, and snippets.

@cjlovering
Last active April 24, 2018 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cjlovering/b7ccabb6f30fd6089b60e7a165ff0542 to your computer and use it in GitHub Desktop.
Save cjlovering/b7ccabb6f30fd6089b60e7a165ff0542 to your computer and use it in GitHub Desktop.
Compile a latex file with a bibliography.

For some time I have blindly run latex commands until I got a PDF file with the correct references. After reading some source and SF posts, I believe I have figured out the correct way to do it.

latexmk -c main.tex; pdflatex main.tex; bibtex main; pdflatex main.tex;
  1. latexmk -c main.tex cleans the directory.
  2. pdflatex main.tex generates auxillary files and figures out what bib entries it needs.
  3. bibtex main compiles the bibliography.
  4. pdflatex main.tex generates the final PDF.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment