% Markdown test % nekketsuuu % 2015年10月6日
The quick brown fox jumps over the lazy dog.
Yes! Brown fox!
why jump? にゃん
lazy >< cat
ちりぬるを
$import(./hello.c)
にゃんにゃん
(#^.^#)
#include <stdio.h> | |
int main(int argc, char *argv[]) { | |
printf("Hello, pandoc!"); | |
return 0; | |
} |
PANDOC = pandoc | |
IMPORT_JS = $(HOME)/.pandoc/pandoc_import_code_filter/import.js | |
MD = example | |
TOC = | |
# 入力はGitHub Markdown + タイトルブロック | |
# http://sky-y.github.io/site-pandoc-jp/users-guide/#title-block | |
FLAGS = -f markdown_github+pandoc_title_block | |
# standalone: 適切なヘッダ・フッタをつける(実は出力がpdfなら勝手にこのモードになる) | |
# http://sky-y.github.io/site-pandoc-jp/users-guide/#general-writer-options | |
FLAGS += -s | |
# 出力ファイルは1つにまとめる | |
FLAGS += --self-contained | |
# 日本語でLaTeXを使うための設定 | |
# pandocだとpdfLaTeXで日本語がうまくいかないのでLuaLaTeXを使う | |
# Tex Live 2015で成功 | |
# デフォルト設定だと余白が広いので調整する | |
FLAGS += -V documentclass=ltjarticle \ | |
--latex-engine=lualatex \ | |
-V geometry:a4paper \ | |
-V geometry:margin=2.5cm \ | |
-V geometry:nohead | |
# import.jsをフィルターに入れる | |
# http://efcl.info/2014/0301/res3692/ | |
# https://github.com/azu/pandoc_import_code_filter | |
FLAGS += --filter $(IMPORT_JS) | |
# TOCフラグが立ってるなら目次も入れる | |
# usage: make TOC=1 | |
ifdef TOC | |
FLAGS += --toc | |
endif | |
$(MD).pdf: $(MD).md | |
$(PANDOC) $(FLAGS) $< -o $@ | |
.PHONY: clean | |
clean: | |
rm -f $(MD).pdf |