Template
mirror of
https://github.com/kenryuS/report-temp.git
synced 2026-08-13 20:51:42 +09:00
28 lines
533 B
Makefile
28 lines
533 B
Makefile
PANDOC:=pandoc
|
|
TEX:=xelatex
|
|
|
|
OUTPUT:=./out
|
|
|
|
SRC:=$(wildcard *.md)
|
|
SRC_MAIN_TEX:=report.tex
|
|
TEX_OUT:=$(SRC:.md=.tex)
|
|
|
|
TEMPLATE:=./template.tex
|
|
|
|
all: report.pdf
|
|
|
|
generate-template:
|
|
pandoc --from markdown --to latex --template=${TEMPLATE} -o ${TEMPLATE:.tex=.sty} *.md
|
|
sed -i '/====/,/++++/d' ${TEMPLATE:.tex=.sty}
|
|
|
|
%.tex: %.md
|
|
pandoc --from markdown --to latex --strip-comments -o $@ $^
|
|
|
|
# for multi-file report
|
|
report.pdf: ${TEX_OUT}
|
|
@mkdir -p ${OUTPUT}
|
|
${TEX} --output-directory=${OUTPUT} ${SRC_MAIN_TEX}
|
|
|
|
clean:
|
|
rm ${TEX_OUT}
|