Opened 5 years ago

Last modified 17 months ago

#48971 new defect

pandoc fails to convert Markdown to PDF due to missing dependencies

Reported by: markus.mahlberg@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.3.3
Keywords: Cc: mojca (Mojca Miklavec)
Port: pandoc

Description

When converting markdown to PDF, pandoc threw an error:

machine:Documents markus$ pandoc -o backlog_srpt_24_09_15.pdf backlog_srpt_24_09_15.md
! LaTeX Error: File `lmodern.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name:
! Emergency stop.
<read *>

l.3 \usepackage

pandoc: Error producing PDF from TeX source

So I had to install texlive-fonts-recommended, after which the conversion worked flawless.

However, since pandoc uses pdflatex an additional dependency to texlive-latex is required, which I had installed but is not a dependency of texlive-fonts-recommended.

Furthermore, the pandoc documentation for creating PDFs states that the following TeX packages are required:

If necessary, I can create a mapping to the ports providing the listed packages.

Additionally, pandoc provides several options for creating PDFs using different flavors of LaTeX binaries, namely pdflatex, luatex and xelatex. luatex and xelatex would need additional dependencies. I am not sure wether this warrants special port variants.

Change History (6)

comment:1 Changed 5 years ago by gnw3

Not all pandoc users want PDF's, and those who do have lots of options. For most users who want PDF's it is simpler to just install all the texlive packages than to work out a minimal list that fits their requirements.

A mapping from a list of package to the specific ports could be useful beyond pandoc -- a typical "use case" is some port that fails to build docs because some macros package isn't installed. In this case the user may just want the fastest route to getting the docs for the original port. One of the downsides to macports is that many Portfiles (R, nco come to mind) omit PDF docs that would require TeX/LaTeX to format, so there is a wider need for guidance on how to manage texlive ports than just pandoc so Portfile authors can enable PDF doc building without going to a lot of extra work.

comment:2 Changed 5 years ago by mf2k (Frank Schima)

Port: pandoc added

In the future, please fill in the Port field.

comment:3 in reply to:  1 Changed 5 years ago by markus.mahlberg@…

Replying to gnwiii@…:

Not all pandoc users want PDF's, and those who do have lots of options. For most users who want PDF's it is simpler to just install all the texlive packages than to work out a minimal list that fits their requirements.

I dare to object. The PDF creation of pandoc is enabled and documented in the manpage, so the port should provide said capabilities as per POLS.

A mapping from a list of package to the specific ports could be useful beyond pandoc -- a typical "use case" is some port that fails to build docs because some macros package isn't installed. In this case the user may just want the fastest route to getting the docs for the original port. One of the downsides to macports is that many Portfiles (R, nco come to mind) omit PDF docs that would require TeX/LaTeX to format, so there is a wider need for guidance on how to manage texlive ports than just pandoc so Portfile authors can enable PDF doc building without going to a lot of extra work.

I was just referring to the package-to-port mapping for pandoc's dependencies. ;)

For the general problem I am not sure what you have in mind. A tutorial would be rather easy("Do a port provides on the missing STY."). An automation for this (eg in for of a wrapper) would require rather costly recursive file parsing and constant port provides queries.

comment:4 Changed 17 months ago by neverpanic (Clemens Lang)

Please try again with the latest pandoc (see #48324). I believe this may still be a problem, though. I'm not sure it's a good idea to fix this in the way you are proposing – people might use pandoc for all sorts of conversions and might be annoyed if it pulls in an entire latex installation even though they just want to convert docbook XML to asciidoc.

comment:5 Changed 17 months ago by mojca (Mojca Miklavec)

Cc: mojca added

comment:6 Changed 17 months ago by mojca (Mojca Miklavec)

I don't see a way to really fix this, other than specifying the dependency on the full texlive. Even if you somehow manage to figure out what to use in one scenario, it's easy to come up with a different scenario of user needing a completely different toolset like [texlive-]context.

What we can do at best is add port notes suggesting users to install texlive when they need conversion to pdf with math support.

Note: See TracTickets for help on using tickets.