Skip to content

Instantly share code, notes, and snippets.

@quartorz

quartorz/Makefile

Created Jan 24, 2016
Embed
What would you like to do?
PANDOC_EXTENSIONS = ignore_line_breaks tex_math_dollars raw_tex latex_macros
PANDOC_FILTERS = pandoc-crossref
CHAPTERS = src/intro.tex src/example.tex
EMPTY :=
SPACE = $(EMPTY) $(EMPTY)
PANDOC_FORMAT = markdown$(strip $(if $(PANDOC_EXTENSIONS),\
+$(subst $(SPACE),+,$(PANDOC_EXTENSIONS)),))
all: sotsuron.tex $(CHAPTERS)
platex -synctex=1 -kanji=utf8 -guess-input-enc sotsuron.tex
dvipdfmx sotsuron
clean:
rm *.aux *.dvi *.log *.out *.pdf *.synctex.gz *.toc src/*.tex
%.tex: %.md
pandoc -f $(PANDOC_FORMAT) -t latex $< -o $@\
$(if $(PANDOC_FILTERS),\
--filter $(subst $(SPACE), --filter ,$(PANDOC_FILTERS)),) \
-M "crossrefYaml=pandoc-crossref.yaml" \
-M "chapters=True"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment