- 系統(tǒng):macOs Sierra 10.12.6
安裝
得到xelatex路徑:
/Library/TeX/texbin/xelatex
常用命令
- markdown、html生成pdf
//test.md為你需要轉(zhuǎn)換的markdown或html文件
$:pandoc test.md --latex-engine=/Library/TeX/texbin/xelatex -V CJKmainfont='STHeitiSC-Light' -o example13.pdf
- md->html
$pandoc -f markdown -t html -o demo.html demo.md
- 章節(jié)標(biāo)題生成超文本書簽(--toc)(帶書簽PDF)
$ pandoc -N -s --toc --smart --latex-engine=/Library/TeX/texbin/xelatex -V CJKmainfont='PingFang SC' -V mainfont='Monaco' -V geometry:margin=1in test.md -o output.pdf
//**注意事項,中文顯示需要在命令中指定字體(CJKmainfont),使用字體的PostScript 名稱**
PostScript查看方式:在mac 字體冊 應(yīng)用中查看,如下圖:
生成的pdf預(yù)覽:
QQ20171104-200604@2x.png
參考https://www.zhihu.com/question/20849824
參考https://www.zhihu.com/question/22906637/answer/32816910