From e08958a66deadbdfd1a26643e3f35c5c637b5dd0 Mon Sep 17 00:00:00 2001 From: Albert Krewinkel Date: Wed, 14 Dec 2022 16:18:41 +0100 Subject: T.P.App: unify check for standalone output --- src/Text/Pandoc/App.hs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/Text/Pandoc/App.hs b/src/Text/Pandoc/App.hs index a87fece66..42b541ae0 100644 --- a/src/Text/Pandoc/App.hs +++ b/src/Text/Pandoc/App.hs @@ -184,16 +184,12 @@ convertWithOpts' scriptingEngine istty datadir opts = do let writerNameBase = T.takeWhile (\c -> c /= '+' && c /= '-') writerName let writerOptions = outputWriterOptions outputSettings + -- whether we are targeting PDF. let pdfOutput = isJust $ outputPdfProgram outputSettings + -- whether standalone output should be produced. + let bibOutput = format `elem` ["bibtex", "biblatex", "csljson"] + let standalone = isJust (writerTemplate writerOptions) || bibOutput - let bibOutput = writerNameBase == "bibtex" || - writerNameBase == "biblatex" || - writerNameBase == "csljson" - - let standalone = optStandalone opts || - not (isTextFormat format) || - pdfOutput || - bibOutput when (pdfOutput && readerNameBase == "latex") $ case optInputFiles opts of -- cgit v1.2.3