Skip to content

Instantly share code, notes, and snippets.

@yoshimov
Created March 25, 2014 09:15
Show Gist options
  • Select an option

  • Save yoshimov/9757892 to your computer and use it in GitHub Desktop.

Select an option

Save yoshimov/9757892 to your computer and use it in GitHub Desktop.
Makefile for paper with Markdown
# Makefile for paper with Markdown
#
# * Time-stamp: "2014-03-25 18:10:01 nomura"
#
# requires:
# * Cygwin texlive packages
# - texlive
# - texlive-collection-basic
# - texlive-collection-bibtexextra
# - texlive-collection-langcjk
# - texlive-collection-latex
# - texlive-collection-latexextra
# - texlive-collection-latexrecommended
# - texlive-collection-pictures
# * Ruby gem
# - kramdown
.SUFFIXES: .tex .md .pdf .bib .dvi .bib
TARGET=paper
TEXFILES=src/intro.tex\
src/abstract.tex\
src/eabstract.tex
FIGFILES=
BIBFILES=biblist.bib
MD2TEX=cmd /c kramdown -o latex
CONVPUNC=sed -i -e 's/、/,/g' -e 's/。/./g'
DVI2PDF=dvipdfmx -l
LATEX=platex
.md.tex:
$(MD2TEX) $< > $@
if [ ! -s $@ ]; then rm -fv $@ && false; fi
$(CONVPUNC) $@
.dvi.pdf:
$(DVI2PDF) $*
all:\
$(TARGET).pdf
clean:
rm -vf src/*.tex
rm -vf src/*.aux
rm -vf *.aux
rm -vf *.dvi
rm -vf *.out
rm -vf *.log
# rm -v *.pdf
$(TARGET).dvi: $(TARGET).tex $(TEXFILES) $(FIGFILES) $(BIBFILES)
$(LATEX) $(TARGET).tex
$(LATEX) $(TARGET).tex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment