SublimeText插件Pandoc导出PDF中文报错或者中文不显示解决方法

本文介绍了一种自定义配置方法,通过指定本机字体(如微软雅黑)来设置LaTeX文档的字体样式。该配置适用于使用XeLaTeX引擎进行编译的场景,并详细展示了如何在Markdown到PDF的转换过程中应用这些设置。

按照如下自定义配置(主要是指定latex的字体[仅限本机字体])

{ 
  "user": {
       // "pandoc-path":"C:\\Program Files (x86)\\Pandoc\\pandoc.exe" ,
      // transformations
    "transformations": {
           // @see http://johnmacfarlane.net/pandoc/README.html#creating-a-pdf
       "PDF": {
          "scope": {
            "text.html": "html",
            "text.html.markdown": "markdown"
          },
          "pandoc-arguments": [
            "-t", "pdf",
            // use --latex-engine=engine where engine is
            // pdflatex|lualatex|xelatex. This may need to be specified with a
            // full path, e.g. on a mac with BasicTeX
            // "--latex-engine=/usr/texbin/pdflatex"
            // or on Windows with MiKTeX
            "--latex-engine=xelatex",
            "-M","mainfont:微软雅黑","-M","sansfont:微软雅黑", "-M", "monofont:微软雅黑"
             //"--latex-engine=C:/Program Files/MiKTeX 2.9/miktex/bin/x64/pdflatex.exe",
            // "--latex-engine=C:/Program Files/MiKTeX 2.9/miktex/bin/x64/xelatex.exe",
            // "--latex-engine=C:/Program Files/MiKTeX 2.9/miktex/bin/x64/lualatex.exe",
            // if -o or --output missing, will write to a temporary file
             // "--output=C:/Users/xyzhuzhou/Desktop/output.pdf"
          ]
        }
      }
  }
}

 

转载于:https://www.cnblogs.com/xyzhuzhou/p/7805392.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值