text-crossrefs: automatically add a rule to suppress Typst's “page” prefixes

This commit is contained in:
Bastien Dumont
2025-12-22 10:12:10 +01:00
parent a5c484e3df
commit d02e18c903

View File

@ -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