Skip to content

Commit

Permalink
allow non-latex intermediaries for pdf generation
Browse files Browse the repository at this point in the history
  • Loading branch information
ashi-agrawal committed Nov 19, 2024
1 parent 8bc3c51 commit 1692b6e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pypandoc/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,7 @@ def _validate_formats(format, to, outputfile):
)

if base_to_format == "pdf":
# pdf formats needs to actually have a to format of latex and a
# filename with an ending pf .pdf
# pdf formats need a filename with an ending of .pdf
if isinstance(outputfile, str):
if outputfile[-4:] != ".pdf":
raise RuntimeError(
Expand All @@ -351,11 +350,9 @@ def _validate_formats(format, to, outputfile):
raise RuntimeError(
'PDF output needs an outputfile with ".pdf" as a fileending.'
)
# to is not allowed to contain pdf, but must point to latex
# it's also not allowed to contain extensions according to the docs
if to != base_to_format:
raise RuntimeError("PDF output can't contain any extensions: %s" % to)
to = "latex"

return format, to

Expand Down

0 comments on commit 1692b6e

Please sign in to comment.