Created
March 20, 2022 18:15
-
-
Save sstallion/9b43e9779c8fb222e06e63ade3624c92 to your computer and use it in GitHub Desktop.
LaTeX Makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (C) 2022 Steven Stallion <[email protected]> | |
# | |
# This work is licensed under a Creative Commons Attribution 4.0 | |
# International License. | |
# | |
# You should have received a copy of the license along with this | |
# work. If not, see <http://creativecommons.org/licenses/by/4.0/>. | |
LATEXMK = latexmk | |
LATEXMKFLAGS = -xelatex -use-make | |
SOURCES ?= $(wildcard *.tex) | |
TARGETS ?= $(SOURCES:.tex=.pdf) | |
TARGET ?= $(basename $(firstword $(TARGETS))) | |
.PHONY: all | |
all: $(TARGETS) | |
.PHONY: clean | |
clean: | |
-$(LATEXMK) $(LATEXMKFLAGS) -C | |
.PHONY: preview | |
preview: | |
$(LATEXMK) $(LATEXMKFLAGS) -pvc $(TARGET) | |
.PHONY: watch | |
watch: | |
$(LATEXMK) $(LATEXMKFLAGS) -pvc -view=none $(TARGET) | |
# Latexmk tracks several dependencies that are not known to this Makefile. | |
# The following suffix rule will always be out-of-date to force delegation: | |
%.pdf: %.tex FORCE | |
$(LATEXMK) $(LATEXMKFLAGS) $< | |
.PHONY: FORCE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment