雖然 markdown 最初是用來作為生成 html 文件的前端的,但是用熟悉了之后,也想用在其它地方。例如用來生成 pdf 文件。
pandoc
在mac下用brew install pandoc來安裝。
還需要xelatex。
使用如下命令
pandoc --pdf-engine=xelatex -V mainfont="Heiti SC Light" hello.md -o hello.pdf
其中 --pdf-engine 是說明使用 xelatex 引擎。而 -V 是給 xelatex 傳遞參數(shù)。