aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <[email protected]>2023-04-07 08:23:32 -0700
committerJohn MacFarlane <[email protected]>2023-04-07 08:24:47 -0700
commite89a3edf24a025d5bb0fe8c4c7a8e6e0208fa846 (patch)
treec495c5f15094583ee3900fd37838649a3167dc29 /src
parent483bfa4b7fad2e9f8f7ae9c8227255bf462a5851 (diff)
Typst writer: omit bibliography if `citations` not enabled.
With this change, the typst writer will omit the `#bibliography` command when `citations` is not enabled. (If you want to use pandoc's own `--citeproc`, you should combine it with `-t typst-citations` to disable native typst citations. Closes #8763.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/Typst.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Writers/Typst.hs b/src/Text/Pandoc/Writers/Typst.hs
index b290506a8..a3267f911 100644
--- a/src/Text/Pandoc/Writers/Typst.hs
+++ b/src/Text/Pandoc/Writers/Typst.hs
@@ -78,6 +78,9 @@ pandocToTypst options (Pandoc meta blocks) = do
let context = defField "body" main
$ defField "notes" notes
$ defField "toc" (writerTableOfContents options)
+ $ (if isEnabled Ext_citations options
+ then defField "citations" True
+ else id)
$ (case lookupMetaString "lang" meta of
"" -> id
lang ->