From 2c5d66cb5cecaec273c3575a1a45b9683f7d924b Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 17 Mar 2024 11:39:32 -0700 Subject: Typst writer: use `kind: image` for image figures. --- src/Text/Pandoc/Writers/Typst.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Text/Pandoc/Writers/Typst.hs b/src/Text/Pandoc/Writers/Typst.hs index 9f3c9a0bf..09bc65e8c 100644 --- a/src/Text/Pandoc/Writers/Typst.hs +++ b/src/Text/Pandoc/Writers/Typst.hs @@ -201,14 +201,16 @@ blockToTypst block = _ -> brackets <$> blocksToTypst blocks let lab = toLabel FreestandingLabel ident let kind = case blocks of - Table{}:_ -> "table" - CodeBlock{}:_ -> "code" - _ -> "auto" + Table{}:_ -> "kind: table" + CodeBlock{}:_ -> "kind: code" + Para [Image{}]:_ -> "kind: image" + Plain [Image{}]:_ -> "kind: image" + _ -> mempty return $ "#figure(" <> nest 2 ((contents <> ",") $$ ("caption: [" $$ nest 2 caption $$ "],") $$ - "kind: " <> literal kind + kind ) $$ ")" $$ lab $$ blankline Div (ident,_,_) (Header lev ("",cls,kvs) ils:rest) -> -- cgit v1.2.3