@@ -51,6 +51,11 @@ function render_typst_brand_yaml()
5151 end
5252 end
5353
54+ local function quote_string (value )
55+ if type (value ) ~= ' string' then return value end
56+ return ' "' .. value .. ' "'
57+ end
58+
5459 return {
5560 Pandoc = function (pandoc )
5661 local brand = param (' brand' )
@@ -82,10 +87,6 @@ function render_typst_brand_yaml()
8287 local decl = ' // theme colors at opacity ' .. BACKGROUND_OPACITY .. ' \n #let brand-color-background = ' .. to_typst_dict_indent (themebk )
8388 quarto .doc .include_text (' in-header' , decl )
8489 end
85- local function quote_string (value )
86- if type (value ) ~= ' string' then return value end
87- return ' "' .. value .. ' "'
88- end
8990 local function conditional_entry (key , value , quote_strings )
9091 if quote_strings == null then quote_strings = true end
9192 if not value then return ' ' end
@@ -98,7 +99,7 @@ function render_typst_brand_yaml()
9899 quarto .doc .include_text (' in-header' , table.concat ({
99100 ' #set text(' ,
100101 -- '#show par: set text(', overrules #show heading!
101- conditional_entry (' weight' , base .weight ),
102+ conditional_entry (' weight' , _quarto . modules . typst . css . translate_font_weight ( base .weight ) ),
102103 ' )'
103104 }))
104105 end
@@ -117,7 +118,7 @@ function render_typst_brand_yaml()
117118 quarto .doc .include_text (' in-header' , table.concat ({
118119 ' #show heading: set text(' ,
119120 conditional_entry (' font' , headings .family ),
120- conditional_entry (' weight' , headings .weight ),
121+ conditional_entry (' weight' , _quarto . modules . typst . css . translate_font_weight ( headings .weight ) ),
121122 conditional_entry (' style' , headings .style ),
122123 conditional_entry (' fill' , headings .color , false ),
123124 ' )'
@@ -138,7 +139,7 @@ function render_typst_brand_yaml()
138139 quarto .doc .include_text (' in-header' , table.concat ({
139140 ' #show raw.where(block: false): set text(' ,
140141 conditional_entry (' font' , monospaceInline .family ),
141- conditional_entry (' weight' , monospaceInline .weight ),
142+ conditional_entry (' weight' , _quarto . modules . typst . css . translate_font_weight ( monospaceInline .weight ) ),
142143 conditional_entry (' size' , monospaceInline .size , false ),
143144 conditional_entry (' fill' , monospaceInline .color , false ),
144145 ' )'
@@ -157,7 +158,7 @@ function render_typst_brand_yaml()
157158 quarto .doc .include_text (' in-header' , table.concat ({
158159 ' #show raw.where(block: true): set text(' ,
159160 conditional_entry (' font' , monospaceBlock .family ),
160- conditional_entry (' weight' , monospaceBlock .weight ),
161+ conditional_entry (' weight' , _quarto . modules . typst . css . translate_font_weight ( monospaceBlock .weight ) ),
161162 conditional_entry (' size' , monospaceBlock .size , false ),
162163 conditional_entry (' fill' , monospaceBlock .color , false ),
163164 ' )'
@@ -187,7 +188,7 @@ function render_typst_brand_yaml()
187188 link = link or {}
188189 quarto .doc .include_text (' in-header' , table.concat ({
189190 ' #show link: set text(' ,
190- conditional_entry (' weight' , link .weight ),
191+ conditional_entry (' weight' , _quarto . modules . typst . css . translate_font_weight ( link .weight ) ),
191192 conditional_entry (' fill' , link .color or primaryColor , false ),
192193 ' )'
193194 }))
@@ -312,9 +313,11 @@ function render_typst_brand_yaml()
312313 headings = headings or {}
313314 local color = headings .color or foregroundColor
314315 color = color and pandoc .RawInline (' typst' , color )
316+ local weight = _quarto .modules .typst .css .translate_font_weight (headings .weight or base .weight )
317+ weight = weight and pandoc .RawInline (' typst' , tostring (quote_string (weight )))
315318 meta .brand .typography .headings = {
316319 family = headings .family or base .family ,
317- weight = headings . weight or base . weight ,
320+ weight = weight ,
318321 style = headings .style or base .style ,
319322 decoration = headings .decoration or base .decoration ,
320323 color = color ,
0 commit comments