dfinke / vscode-pandoc

Visual Studio Code extension lets you render markdown to pdf, word doc or html with pandoc
125 stars 36 forks source link

No output #9

Open DaveyD opened 8 years ago

DaveyD commented 8 years ago

Hi, I just installed Pandoc and your pandoc extension for vs-code After installing, I opened a markdown file and tested all 3 formats I wasnt able to get any of them to work!

Is there a setting that I am missing?

Please let me know Thanks, David

BenjaminAbt commented 8 years ago

Same here. Did you fixed it Davey?

dfinke commented 8 years ago

If you run pandoc against your md file at the command line, do you get errors?

pandoc test.md -o test.pdf

BenjaminAbt commented 8 years ago

Pandoc works fine to convert markdown to docx. pandoc test.md -o test.docx

The extension says "Generating.." but nothing happened.

dfinke commented 8 years ago

Thanks for trying. Could you post the md and the version of the ext and vs code you're running.

BenjaminAbt commented 8 years ago

I could reproduce and fix it to the same time.

I've installed this extension yesterday and also installed pandoc afterwards (without Latex, because I do not need PDF here). After the installation I instantly tested the stuff via extension and it failed. CLI worked fine.

Now, back at home the extension works. Weird..

Well, I have now installed this extension and pandoc on my Laptop and: it does not work. CLI works here too. Then - just to have the same workflow - I've rebooted the laptop and here we go: it works.

It seems that there is at any point a restart required.

DaveyD commented 8 years ago

@dfinke - Good news this time! :) I just updated my VScode and retried your exension - This time it seems to work great for HTML and DOCX. However, for PDF it does not work.

Running from the command line returns the following error: pandoc: pdflatex not found. pdflatex is needed for pdf output.

I am not sure what that is - is that an additional resource necessary to run?

Thanks, David

BenjaminAbt commented 8 years ago

Dave, see pandoc installation note: you need LaTeX for PDF export. image

DaveyD commented 8 years ago

Ok, got it - never went over pandoc docs Thanks for that pointing that out Benjamin

divillysausages commented 8 years ago

Just to chime in here with some possible causes

PaulinB commented 8 years ago

Hi there,

I was experiencing the same issue as DaveyD: I couldn't get any PDF output using this extension, but HTML and DOCX output worked fine.

I think the issue (at least on Windows) might be permission (write) related. More information bellow.

Software configuration

I am using Windows 10 with the following software (installed in this order):

Issue

I tried to run Pandoc from the command line in the folder containing the markdown file (test.md, attached, renamed to test.txt as GitHub doesn't support MD files) with the following command: pandoc test.md -s -o test.pdf. Test.txt

This output a proper PDF file (renamed to test_pandoc_command_line.pdf, attached). test_pandoc_command_line.pdf

I had to install three LaTeX packages (as I use the basic version of MiKTeX, but I don't remember which ones) in order to get this file on the first time I ran Pandoc. After that, I could get a PDF file from every MD file I tested using this method without any additional install.

I tried to run the extension again, but to no avail. When pressing F1 then typing Pandoc render then choosing pdf, I had a message at the bottom of the Visual Code Studio window saying Generating [pdf] 12:27:16 (current time) and nothing happened (no PDF created in the folder).

However, I might have found the source of the issue.

Fix?

In the log of the Dev Tools Console (-1469503621744.log, attached) there are the following errors:

"(Acc�s refus�.)" should be "(Accès refusé)"; this is a French expression meaning "permission denied", as Windows is in French (but I installed Visual Studio Code in English, so this is strange...).

I think the problem comes from here, but I have no idea why. The folder is not protected in any way and I ran cmd using Shift + Right Click inside the folder When I use pandoc in command line to generate the PDF, a folder with the same name pattern (tex2pdf.XXXX where X is a digit) is created and deleted a second later in the folder containing the test.md file.
See Pandoc_Command_line.gif (the timing of the GIF is not in real time) pandoc_command_line

I therefore ran Visual Studio Code as Admin, opened test.md and managed to get a PDF output (renamed to test_vscode-pandoc.pdf attached) opening in Sumatra. This file is exactly the same as the one generated using Pandoc in command line. test_vscode-pandoc.pdf

Running Visual Code Studio as admin fixes the issue of no PDF output, but running the program as admin every time might not be the best solution.

Hope this will help to solve the issue.

Thanks again for this great extension.

Best regards,

Paulin

PS: sorry for the lengthy message. This is the first time I report an issue and as I am not really into programming I am not sure how to do it in a proper way.
And sorry for the possible grammar mistakes, English is not my mother tongue.

po5i commented 6 years ago

Yeah, I'm working on a total different project and just realized that this tex2pdf.XXXX tries to be created on the directory where pandoc was executed.

furicle commented 5 years ago

This is related to #21

I just tested and discovered if I install the plug in as administrator, it works fine. But as a standard user, it can't find pandoc.

It must be looking at the wrong path.

Note I have a system wide VS Code install

furicle commented 5 years ago

Hmmm - but the path is correct for both users....