Skip to content

Instantly share code, notes, and snippets.

@michaelfortunato
Last active January 8, 2025 00:04
Show Gist options
  • Save michaelfortunato/81a807f8b8b8206e8fcdae7d36c0f4fc to your computer and use it in GitHub Desktop.
Save michaelfortunato/81a807f8b8b8206e8fcdae7d36c0f4fc to your computer and use it in GitHub Desktop.
Makefile for building TeX pdfs
# This Makefile is to run commands. While justfiles are better purposed
# It is unlikely Make will go away and it works well enough for my needs.
TEX_FILE ?= main.tex
AUX_DIR := aux
.PHONY: pdf open clean
refresh: pdf reload
pdf:
docker run -v ".:/app" -w /app texlive/texlive:latest \
latexmk -aux-directory=$(AUX_DIR) -pdf -synctex=true $(TEX_FILE)
open: pdf reload
sioyek $(shell basename $TEX_FILE).pdf
reload:
sioyek --execute-command reload
clean:
rm -rf $(AUX_DIR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment