# 安装 LaTeX

brew install --cask basictex

# 配置环境变量

export PATH=/Library/TeX/texbin:$PATH

# 尝试此模板时安装的 eisvogel 相关依赖

sudo tlmgr install adjustbox babel-german background bidi collectbox csquotes everypage filehook footmisc footnotebackref framed fvextra letltxmacro ly1 mdframed mweights needspace pagecolor sourcecodepro sourcesanspro titling ucharcat ulem unicode-math upquote xecjk xurl zref

# 最关键的依赖,配置 CJKmainfont 需要这个依赖,实际上提示的错误是 ! LaTeX Error: File ctexhook.sty' not found.`

sudo tlmgr install ctex --repository http://mirrors.aliyun.com/CTAN/systems/texlive/tlnet/

# 此处字体自行更换,配置了 CJKmainfont 中文长行自动换行才正常

pandoc demo.md -o ~/Downloads/demo.pdf --pdf-engine=xelatex -V mainfont='PingFang SC' -V sansfont='PingFang SC' -V CJKmainfont="PingFang SC"

# 使用 eisvogel

pandoc demo.md -o ~/Downloads/demo.pdf --pdf-engine=xelatex -V mainfont='PingFang SC' -V sansfont='PingFang SC' -V CJKmainfont="PingFang SC" --template=eisvogel.tex