tbfisher / sublimetext-Pandoc

A Sublime Text plugin that uses Pandoc to convert text from one markup format into another. Pandoc can convert documents in markdown, reStructuredText, textile, HTML, DocBook, LaTeX, MediaWiki markup, OPML, or Haddock markup to XHTML, HTML5, HTML slide shows using Slidy, reveal.js, Slideous, S5, or DZSlides, Microsoft Word docx, OpenOffice/LibreOffice ODT, OpenDocument XML, EPUB version 2 or 3, FictionBook2, DocBook, GNU TexInfo, Groff man pages, Haddock markup, OPML, LaTeX, ConTeXt, LaTeX Beamer slides, PDF via LaTeX, Markdown, reStructuredText, AsciiDoc, MediaWiki markup, Emacs Org-Mode, Textile, or custom writers can be written in lua.
MIT License
137 stars 26 forks source link

Pandoc --parse-raw #67

Closed jandob closed 4 years ago

jandob commented 6 years ago

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.
p-m-j commented 6 years ago

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

tan-wei commented 4 years ago

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

cagrimes commented 1 year ago

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