Skip to content

Instantly share code, notes, and snippets.

@keuv-grvl
Last active September 23, 2024 16:00
Show Gist options
  • Save keuv-grvl/12f386624061672637997790fc2d0472 to your computer and use it in GitHub Desktop.
Save keuv-grvl/12f386624061672637997790fc2d0472 to your computer and use it in GitHub Desktop.
Convert Markdown to PDF within Sublime Text using Pandoc
{
"cmd": ["pandoc --latex-engine=xelatex --filter=pandoc-citeproc -o '$file_base_name.pdf' '$file_name'"],
"selector": "text.html.markdown",
"shell": true
}
@promicrobial
Copy link

I'm using pandoc v2.9.2.1 on Linux Mint (21.3) and by changing --latex-engine=xelatex to --pdf-engine=pdflatex things were back in working order:

{
	"cmd": ["pandoc --pdf-engine=pdflatex --filter=pandoc-citeproc -o '$file_base_name.pdf' '$file_name'"],
	"selector": "text.html.markdown",
	"shell": true
}

There are several pdf engines you can use, including xelatex as used above: https://pandoc.org/MANUAL.html#option--pdf-engine

@gkunwar
Copy link

gkunwar commented Jun 28, 2024

This is the error in my MacOS.

pandoc: : withBinaryFile: does not exist (No such file or directory)

Screenshot 2024-06-28 at 11 09 10

@jsaraviadrago
Copy link

I actually had problems with previous solutions but this worked for me:

{ "cmd": ["pandoc --pdf-engine=pdflatex --citeproc -o '$file_base_name.pdf' '$file_name'"], "selector": "text.html.markdown", "shell": true }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment