summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2023-12-07 14:39:21 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2023-12-07 14:39:21 -0800
commit5bd301ef4589f30d0b18899a91df094aec74bf90 (patch)
tree104c00c1fcf5dee6512f3ab8a2d34b27d2d5005d /src
parente7348b4f769eb79973cdf52b11ec2a89bbca4a7f (diff)
Typst writer/template: support `--toc-depth` as in other writers.
Closes #9242.
Diffstat (limited to 'src')
-rw-r--r--src/Text/Pandoc/Writers/Typst.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Text/Pandoc/Writers/Typst.hs b/src/Text/Pandoc/Writers/Typst.hs
index fcdd037f2..20521af28 100644
--- a/src/Text/Pandoc/Writers/Typst.hs
+++ b/src/Text/Pandoc/Writers/Typst.hs
@@ -26,7 +26,7 @@ import qualified Data.Text as T
import Control.Monad.State ( StateT, evalStateT, gets, modify )
import Text.Pandoc.Writers.Shared ( metaToContext, defField, resetField,
toLegacyTable, lookupMetaString )
-import Text.Pandoc.Shared (isTightList, orderedListMarkers)
+import Text.Pandoc.Shared (isTightList, orderedListMarkers, tshow)
import Text.Pandoc.Writers.Math (convertMath)
import qualified Text.TeXMath as TM
import Text.DocLayout
@@ -76,6 +76,7 @@ pandocToTypst options (Pandoc meta blocks) = do
Right l ->
resetField "lang" (langLanguage l) .
maybe id (resetField "region") (langRegion l))
+ $ defField "toc-depth" (tshow $ writerTOCDepth options)
$ (if writerNumberSections options
then defField "numbering" ("1.1.1.1.1" :: Text)
else id)