Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pandoc markdown to PDF

I'm looking to convert my Markdown book to a PDF.

I've done a lot of research and it seems that Pandoc is the best choice for this. It seems pandoc converts the markdown to latex and then to a PDF.

The problem I am running into is including external images. Ideally I would have the process grab the remote images off the net and put them into the pdf.

I'm hitting this error:

pandoc: Error producing PDF from TeX source.
! Package pdftex.def Error: File `http://wes.io/QYGG/content.png' not found.

See the pdftex.def package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.84 ...degraphics{http://wes.io/QYGG/content.png}

I have MacTex installed and the command I'm running is pandoc test.md -o test.pdf

I've never used latex before, so I'm a bit at a loss of how to fix this.

like image 610
wesbos Avatar asked Sep 13 '25 09:09

wesbos


1 Answers

According to this LaTex question, you can't directly reference URL images from within LaTeX, though they have a potential LaTeX-hacking option available at the link.

Local image files are probably your best bet.

like image 139
David Alan Hjelle Avatar answered Sep 15 '25 21:09

David Alan Hjelle