From 5704b068501afb04fb218632727099de3b1185a3 Mon Sep 17 00:00:00 2001 From: Ashi Agrawal <17105294+ashi-agrawal@users.noreply.github.com> Date: Wed, 8 Jan 2025 12:20:24 -0500 Subject: [PATCH] allow non-latex intermediaries for pdf generation (#381) Co-authored-by: Jessica Tegner --- pypandoc/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pypandoc/__init__.py b/pypandoc/__init__.py index 76cb29e..4610c02 100644 --- a/pypandoc/__init__.py +++ b/pypandoc/__init__.py @@ -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( @@ -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