aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Krewinkel <[email protected]>2022-12-14 16:18:41 +0100
committerAlbert Krewinkel <[email protected]>2022-12-14 16:31:52 +0100
commite08958a66deadbdfd1a26643e3f35c5c637b5dd0 (patch)
tree0da9227eafdf0522e3452783ca813efa20a612b6
parent3be34077f513b51a8ad397f1695917f0542ce215 (diff)
T.P.App: unify check for standalone output
-rw-r--r--src/Text/Pandoc/App.hs12
1 files 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