Sublime Text,Pandoc和将Markdown导出为PDF

时间:2017-11-07 23:25:43

标签: pdf-generation sublimetext3 sublimetext pandoc

所以,我使用pandoc package设置了Sublime Text。当我尝试使用此包将markdown文件(扩展名为.md)导出为PDF时,出现以下错误:

Fail to generate output. Can't convert 'bytes' object to str implicitly

当我从命令行使用pandoc时,它生成一个PDF就好了。所以我假设这是包的问题。当我使用pandoc包生成不是PDF的东西时,比如html或docx,它运行得很好。谁知道我错了什么?

供参考,我的pandoc包用户设置:

{
  "default": {

    "pandoc-path": "C:/Program Files (x86)/Pandoc/pandoc.exe",

    "transformations": {

      "HTML 5": {
        "scope": {
          "text.html.markdown": "markdown"
        },
        "syntax_file": "Packages/HTML/HTML.tmLanguage",
        "pandoc-arguments": [
          "-t", "html",
          "--to=html5",
          "--no-highlight", 
        ]
      },

      "PDF": {
        "scope": {
          "text.html": "html",
          "text.html.markdown": "markdown"
        },
        "pandoc-arguments": [
          "-t", "pdf", 
          "-s", "--toc", "--number-sections",
        "--variable", "geometry:margin=1.25in",
        "-t", "pdf",
           "--latex-engine=C:/Program Files/MiKTeX 2.9",
        ]
      },

  "Microsoft Word": {
    "scope": {
      "text.html": "html",
      "text.html.markdown": "markdown"
    },
    "pandoc-arguments": [
      "-t", "docx",
      "-s", "--toc", "--number-sections"
    ]
  },

    },
    "pandoc-format-file": ["docx", "epub", "pdf", "odt", "html"]

  }

}

0 个答案:

没有答案