Skip to content

Instantly share code, notes, and snippets.

@slashinfty
Last active December 27, 2019 03:17
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 slashinfty/5b6149945d40d35137ce06a340b2c8b0 to your computer and use it in GitHub Desktop.
Save slashinfty/5b6149945d40d35137ce06a340b2c8b0 to your computer and use it in GitHub Desktop.
A Windows batch file for simple LaTeX PDF compiling with clean up
rem this batch file compiles all tex files to pdf files in the folder this file is in
for %%i in (*.tex) do (if not exist "%%~ni.pdf" xelatex "%%i")
rem this will delete any extraneous files from the compilation process
del *.log && del *.aux
rem this will delete original tex files and leave only pdf files - delete rem below if you want to enable
rem del *.tex
@slashinfty
Copy link
Author

slashinfty commented Dec 27, 2019

Linux version in .bash_aliases:

alias tex-pdf='makepdf'

function makepdf() {
	for T in *.tex; do if ! [[ -f "${T%.*}.pdf" ]]; then xelatex ${T}; fi; done
	for A in *.aux; do rm ${A}; done
	for L in *.log; do rm ${L}; done
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment