Skip to content

Instantly share code, notes, and snippets.

@quartorz
Created January 24, 2016 19:27
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 quartorz/1952254c9d05ab464dfc to your computer and use it in GitHub Desktop.
Save quartorz/1952254c9d05ab464dfc to your computer and use it in GitHub Desktop.
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