Replies: 2 comments 1 reply
-
Pandoc doesn't produce a PDF directly: it first generates an intermediary file, which it post-processes with the program set by `--pdf-engine`. When the output file has the `.pdf` extension, the `-t` option specifies the format of the intermediary file. So a full command would be e.g.:
pandoc -o myfile.pdf -t html --pdf-engine=prince myfile.md
Now, you can omit some parts of the command, and Pandoc will guess how to fill the blanks. For instance, the manual says that if you write something like `pandoc -o myfile.pdf -t context myfile.md`, without setting `--pdf-engine`, Pandoc will guess that the value of `--pdf-engine` is `context`. If you omit `--pdf-engine=prince` in the example above, it will fall back to `wkhtmltopdf`. If you just write `pandoc -o myfile.pdf myfile.md`, Pandoc will do as if you had written `pandoc -o myfile.pdf -t latex --pdf-engine=pdflatex myfile.md`.
Of course, if you simply write `-o myfile.html` without `--pdf-engine`, Pandoc will simply generate an HTML file. Set `--pdf-engine` only if you want to make a PDF file from it.
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jsx97
-
Thank you very much. This answer is really very useful to better
understand how Pandoc works.
You're welcome!
Could I kindly ask you to copy and then
paste it back so that the formatting will be fixed?
Sorry, but I receive all discussions in my mailbox and I am simply a bit tired of having to open my web browser and connect to Github just to be able to add rich text formatting to my message. If it seems important to you, I suggest that you write to Github's support and ask them to make Markdown markup be taken into account in replies sent by email ;-) In any case, thank you for having taken the time to do it yourself.
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm very confused.
The first question. Isn't it the most appropriate use of
--pdf-engine
is when we are going to produce a PDF file, e.g.And if yes, then why
-t pdf
is not mentioned in the list above?The second question. Any for what purpose
--pdf-engine
in the list above is listed for e.g. producing HTML file? As far as I understand, it isn't required to use a pdf engine to produce an HTMl file, isn't it?Beta Was this translation helpful? Give feedback.
All reactions