From d02e18c9038b59ace85fff314a79099c7a030a57 Mon Sep 17 00:00:00 2001 From: Bastien Dumont Date: Mon, 22 Dec 2025 10:12:10 +0100 Subject: [PATCH] =?UTF-8?q?text-crossrefs:=20automatically=20add=20a=20rul?= =?UTF-8?q?e=20to=20suppress=20Typst's=20=E2=80=9Cpage=E2=80=9D=20prefixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- text-crossrefs/text-crossrefs.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/text-crossrefs/text-crossrefs.lua b/text-crossrefs/text-crossrefs.lua index f083c5c..511877d 100644 --- a/text-crossrefs/text-crossrefs.lua +++ b/text-crossrefs/text-crossrefs.lua @@ -171,6 +171,17 @@ local function configure(metadata) end end +local function remove_prefixes_typst(metadata) + if TYPST_VARIANT:get() == 'ref' then + local label_macro_def = '\n#set page(supplement: [])\n' + if not metadata['header-includes'] then + metadata['header-includes'] = pandoc.MetaBlocks(pandoc.RawBlock('typst', '')) + end + metadata['header-includes']:insert(pandoc.RawBlock('typst', label_macro_def)) + end + return metadata +end + -- End of configuration -- Preprocessing of identifiers on notes