Skip to content

Instantly share code, notes, and snippets.

@maweigert
Last active March 2, 2023 14:42
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 maweigert/6e8e482b92013891b202399a98151f21 to your computer and use it in GitHub Desktop.
Save maweigert/6e8e482b92013891b202399a98151f21 to your computer and use it in GitHub Desktop.
# Makefile to create arxiv submission conforming single latex files. Created originaly by Uwe Schmidt
all: pdf
pdf: main.tex
pdflatex main.tex
# http://stackoverflow.com/a/21935690
-biber main
pdflatex main.tex
pdflatex main.tex
pdflatex main.tex
clean:
find "." -name "*.aux" -exec rm -f {} \; -print
# rm -f tikz/*
rm -f main.pdf *.log *.dvi *.bbl *.blg *.lof *.toc *.ind *.brf *.maf *.mtc* *.synctex* *.tdo *.gnuplot *.fls *.out *.fdb_latexmk
arxiv: clean pdf
# ### option 1
# mkdir -p arxiv
# rm -rf arxiv/latest
# mkdir arxiv/latest
# cp -r *.sty *.bst figs arxiv/latest
# find "." -name "*.tex" -exec latexpand --verbose --keep-includes --empty-comments --output arxiv/latest/{} {} \; -print
# latexpand --verbose --keep-includes --empty-comments --expand-bbl main.bbl --output arxiv/latest/main.tex main.tex
# cd arxiv/latest && zip -r latest.zip *.tex *.sty *.bst *.bbl figs
### option 2
rm -f arxiv.zip
latexpand --verbose --empty-comments --expand-bbl main.bbl main.tex > arxiv.tex
mv main.bbl arxiv.bbl
zip -r arxiv.zip arxiv.tex *.cls *.sty *.bst *.bbl figs
# remove non image files
zip -d arxiv.zip "figs/*ai" "figs/*svg"
rm arxiv.tex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment