Skip to content

Instantly share code, notes, and snippets.

@deecewan
Created June 3, 2017 05:15
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 deecewan/bb778a089586dee58928cef386e60018 to your computer and use it in GitHub Desktop.
Save deecewan/bb778a089586dee58928cef386e60018 to your computer and use it in GitHub Desktop.
Makefile for a pandoc project converting markdown to latex
SHELL=zsh
.PHONY: all copy clean
all: copy out/main.tex
clean:
rm -r out/*
copy:
zsh -c 'setopt extendedglob; cp -r src/^(template.tex|*.md) out/'
src/%.md:
pandoc\
-o out/main.tex\
--toc\
--to latex\
--from markdown\
--template src/template.tex\
--latex-engine xelatex\
--biblatex\
--bibliography src/bib.bib\
src/*_*.md
out/main.tex: src/%.md
cd out/ && \
xelatex -interaction=nonstopmode main > /dev/null && \
biber main > /dev/null && \
xelatex -interaction=nonstopmode main > /dev/null && \
xelatex -interaction=nonstopmode main > /dev/null && \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment