Created
June 24, 2021 19:10
-
-
Save darsnack/a643c2154bf5bef6479938331c7aeb8f to your computer and use it in GitHub Desktop.
Pandoc makefile for academic writing
This file contains 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
MDSRC = $(wildcard ./markdown/*.md) | |
BIB = ./ref.bib | |
TEXPATH = ./tex | |
TEXSRC = main | |
OUTDIR = ./output | |
debug: | |
@echo $(MDSRC) | |
@echo $(MDOUT) | |
clean: | |
rm -f $(OUTDIR)/markdown/*.md | |
rm -f $(OUTDIR)/*.* | |
rm -f $(TEXPATH)/text.tex | |
pandoc: clean $(MDSRC) | |
pandoc --filter pandoc-xnos --filter pandoc-crossref --citeproc -M cref=true --top-level-division=chapter --bibliography $(BIB) --biblatex -o $(TEXPATH)/text.tex $(MDSRC) | |
latex: pandoc | |
cd $(TEXPATH) && pdflatex -interaction=nonstopmode --output-directory=../$(OUTDIR) ./$(TEXSRC).tex | |
cd $(TEXPATH) && biber --output-directory ../$(OUTDIR) $(TEXSRC) | |
cd $(TEXPATH) && pdflatex -interaction=nonstopmode --output-directory=../$(OUTDIR) ./$(TEXSRC).tex | |
all: latex |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment