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 package fails to make pdf #21

Closed a59 closed 10 years ago

a59 commented 10 years ago

I am trying SublimeText3 on OS X and have installed the Pandoc package.

I don't know if I have to do anything else to set this up and can't find any other instructions but when I select Pandoc I only get four options

PDF Microsoft Word HTML5 Markdown (Pandoc)

I tried PDF and got this error.

Error when running:

/usr/local/bin/pandoc -f markdown -o /var/folders/cr/4qc8w69d2v17nvgmt0phxxh80000gp/T/tmp25n8ls.pdf

pandoc: pdflatex not found. pdflatex is needed for pdf output.

I also tried Microsoft Word, but it seem to want to open Word, which I don't have on my Mac.

Where can I look for instructions on how to fix these problems?

py commented 10 years ago

Glad you are interested in the package. To generate PDFs you need LaTeX installed on your machine. I believe mactex is the easiest option (I am a Windows user so you may do more research).

Give that a shot and see if it let's you generate PDFs. You can create your own output transformations by following the examples in the default settings. I usually copy the default transformations into my user settings file and edit from there.

Hope that helps. On Apr 29, 2014 6:04 PM, "a59" notifications@github.com wrote:

I am trying SublimeText3 on OS X and have installed the Pandoc package.

I don't know if I have to do anything else to set this up and can't find any other instructions but when I select Pandoc I only get four options

PDF Microsoft Word HTML5 Markdown (Pandoc)

I tried PDF and got this error.

Error when running:

/usr/local/bin/pandoc -f markdown -o /var/folders/cr/4qc8w69d2v17nvgmt0phxxh80000gp/T/tmp25n8ls.pdf

pandoc: pdflatex not found. pdflatex is needed for pdf output.

I also tried Microsoft Word, but it seem to want to open Word, which I don't have on my Mac.

Where can I look for instructions on how to fix these problems?

— Reply to this email directly or view it on GitHubhttps://github.com/tbfisher/sublimetext-Pandoc/issues/21 .

a59 commented 10 years ago

I should have said I do have LaTeX installed and can successfully run pandoc from the command line to create PDFs and docx files. On Apr 29, 2014 8:38 PM, "Peter Yates" notifications@github.com wrote:

Glad you are interested in the package. To generate PDFs you need LaTeX installed on your machine. I believe mactex is the easiest option (I am a Windows user so you may do more research).

Give that a shot and see if it let's you generate PDFs. You can create your own output transformations by following the examples in the default settings. I usually copy the default transformations into my user settings file and edit from there.

Hope that helps. On Apr 29, 2014 6:04 PM, "a59" notifications@github.com wrote:

I am trying SublimeText3 on OS X and have installed the Pandoc package.

I don't know if I have to do anything else to set this up and can't find any other instructions but when I select Pandoc I only get four options

PDF Microsoft Word HTML5 Markdown (Pandoc)

I tried PDF and got this error.

Error when running:

/usr/local/bin/pandoc -f markdown -o /var/folders/cr/4qc8w69d2v17nvgmt0phxxh80000gp/T/tmp25n8ls.pdf

pandoc: pdflatex not found. pdflatex is needed for pdf output.

I also tried Microsoft Word, but it seem to want to open Word, which I don't have on my Mac.

Where can I look for instructions on how to fix these problems?

— Reply to this email directly or view it on GitHub< https://github.com/tbfisher/sublimetext-Pandoc/issues/21> .

— Reply to this email directly or view it on GitHubhttps://github.com/tbfisher/sublimetext-Pandoc/issues/21#issuecomment-41749039 .

tbfisher commented 10 years ago

if you can use pandoc to create pdf's you should be able to configure this plugin to run pandoc in the same way.

This plugin tells you what command it is trying to run. How does that differ from how you are generating pdf's with pandoc?

a59 commented 10 years ago

The plugin is trying to run

/usr/local/bin/pandoc -f markdown -o /var/folders/cr/4qc8w69d2v17nvgmt0phxxh80000gp/T/tmpymz_vc.pdf

when I run

/usr/local/bin/pandoc -f markdown -o test.pdf test.md

on the same file from the command line, it works.

Is this a PATH problem from within the Sublime Text environment?

a59 commented 10 years ago

It was a PATH problem.

The default path in Sublime Text is

/usr/bin:/bin:/usr/sbin:/sbin

and I have pdflatex in

/usr/texbin

so I added a python script to modify the default path as described here

http://robdodson.me/blog/2012/05/14/hacking-the-path-variable-in-sublime-text/

a59 commented 10 years ago

Maybe there is a better way of setting the PATH in Sublime Text or within the Pandoc plugin.

a59 commented 10 years ago

Ah. I found the right line in the preferences to set

"--latex-engine=/usr/texbin/pdflatex",

maccouch commented 9 years ago

where is this added? I have the exact same problem and can't manage to fix it. Already changed every pdflatex path I found to the current correct one: "/Library/TeX/texbin/pdflatex" (yosemit/el capitan changes) but I still can't manage it to run. Always complaining about not finding pdflatex. Any hints?

codenoxi commented 7 years ago

I changed in the user Pandoc.sublime-settings the following lines:

"pandoc-path": "/usr/local/bin/pandoc", and "PDF": { "scope": { "text.html": "html", "text.html.markdown": "markdown" }, "pandoc-arguments": [ "-t", "pdf", "--latex-engine=/Library/TeX/texbin/pdflatex"

works fine now!