Skip to content

Commit ed1dea4

Browse files
committed
crossref - always use supplement in typst refs. Closes #12258
1 parent 40e447a commit ed1dea4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/resources/filters/crossref/refs.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function resolveRefs()
1313
local function add_ref_prefix(ref, ref_type, prefix)
1414
local category = crossref.categories.by_ref_type[ref_type]
1515
ref:extend(prefix)
16-
if category == nil or category.space_before_numbering ~= false then
16+
if (category == nil or category.space_before_numbering ~= false) and not _quarto.format.isTypstOutput() then
1717
ref:extend({nbspString()})
1818
end
1919
end
@@ -82,12 +82,13 @@ function resolveRefs()
8282
-- so we don't get the fallthrough else clause in latex when custom ref commands
8383
-- are in play
8484
if category == nil or category.custom_ref_command == nil then
85-
ref:extend({pandoc.RawInline('latex', '\\ref{' .. label .. '}')})
85+
ref:extend(pandoc.List({pandoc.RawInline('latex', '\\ref{' .. label .. '}')}))
8686
end
8787
elseif _quarto.format.isAsciiDocOutput() then
8888
ref = pandoc.List({pandoc.RawInline('asciidoc', '<<' .. label .. '>>')})
8989
elseif _quarto.format.isTypstOutput() then
90-
ref = pandoc.List({pandoc.RawInline('typst', '@' .. label)})
90+
ref:insert(1, pandoc.RawInline('typst', '#ref(<' .. label .. '>, supplement: ['))
91+
ref:insert(pandoc.RawInline('typst', '])'))
9192
else
9293
if not resolve then
9394
local refClasses = pandoc.List({"quarto-unresolved-ref"})

0 commit comments

Comments
 (0)