How to prepare a LaTeX project for submissions
This is a post on how to prepare a LaTeX project for arXiv/journal submission in my current workflow.
My LaTeX workflow
Out of necessity, my workflow is entierely offline.
I have TeXLive installed on my Macbook, along with all the packages and the utilities
in the standard version. I use git
for versioning, and private Github repositories
for backup and collaboration. My Github CI and githooks are heavily inspired from
Pieter Belmans’s latex template, but for
the purposes of this post all of that is irrelevant, so I will ignore everything not
related to LaTeX compilation.
The directory of one of my projects, excluding CI and githooks, contains exactly three files:
main.tex
, preamble.tex
and bibliography.bib
.
The file preamble.tex
contains, among all the code that goes in a preamble,
the following two lines:
\usepackage[backend=biber]{biblatex}
\addbibresource{bibliography.bib}
My main.tex
file contains (of course) the command
\input{preamble.tex}
before the document
environment, and
\printbibliography
at the end of the document
environment, where the references should be rendered.
To compile the project, I use latexrun.
This means that a long time ago I downloaded the python script latexrun
from its repo,
dropped it in the bin
folder of my machine along with all my scripts, and now
whenever I want to compile a LaTeX file I simply run
latexrun --bibtex-cmd=biber main.tex
At this point, latexrun
runs pdflatex
exactly as many times as it needs to be ran,
and creates a folder called latex.out/
where it hides all of LaTeX intermediary files.
After it runs, a main.pdf
file appears in the root directory. Pretty neat.
Whenever something weird happens, deleting latex.out/
and all the auxiliary files and running latexrun
again usually solves the problem.
My projects compile almost in real time, without online activity, I see no annoying auxiliary files, and life is good.
Submitting to arXiv
Life is good, we were saying, until it isn’t and I need to submit .tex
files to the
arXiv, or to a journal.
I have spent too much time looking up the problem on Google, only finding outdated
Stackexchange posts, thinkering with auxiliary files and dubious BibTeX commands,
uploading projects and letting the platform compile them, only to be greeted by
a document without citations, broken links or a badly rendered bibliography.
After some time, I eventually realised that the solution is very simple. Behold.
Solution
- Compile the project and ensure it looks as intended.
- Find the
.bbl
auxiliary file and include it in the submission.
That’s it.
No other action is needed, no modifications of the .tex
files in the project are necessary.
Literally just include the new file in the submission.
And don’t use BibTeX. It’s 2024, move on.