tbfisher/sublimetext-Pandoc

Pandoc --parse-raw

Closed this issue · 3 comments

Trying to export markdown as pdf with TOC results in error:

Error when running:

[...]\AppData\Local\Pandoc\pandoc.exe -f markdown -V geometry:margin=1.25in -s --toc --number-sections --parse-raw -o [...]\appdata\local\temp\tmp38nn6v.pdf

--parse-raw/-R has been removed. Use +raw_html or +raw_tex extension.


Try pandoc.exe --help for more information.
  • happens only with PDF TOC or PDF TOC (Narrow Margins)
  • pandoc version used: pandoc 2.0.5
p-m-j commented

As a quick fix add this to Pandoc.sublime-settings -- User

{
    "user":
    {
        "transformations":
        {
            "PDF TOC (Narrow margins)":
            {
                "scope":
                {
                    "text.html": "html",
                    "text.html.markdown": "markdown+raw_html",
                },
                "pandoc-arguments": [
                    "-V", "geometry:margin=1.25in",
                    "-s", "--toc", "--number-sections",
                    "-t", "pdf",
                ],
            },
            "PDF TOC":
            {
                "scope":
                {
                    "text.html": "html",
                    "text.html.markdown": "markdown+raw_html",
                },
                "pandoc-arguments": [
                    "-s", "--toc", "--number-sections",
                    "-t", "pdf",
                ],
            }
        }
    }
}

Will submit a PR later

@rustybox It works, PR should be a good choice for new users. :-) Thanks!

Thank-you. ST pandoc package worked, then didn't. Found this and added the code to the pandoc user settings and back in business.