Skip to content

Commit 07db3f3

Browse files
claude: Remove quarto- prefix from Typst numbering variables
Rename Typst variables to follow convention of not using quarto- prefix in generated output: - quarto-equation-numbering → equation-numbering - quarto-callout-numbering → callout-numbering - quarto-subfloat-numbering → subfloat-numbering - quarto-theorem-inherited-levels → theorem-inherited-levels - quarto-theorem-numbering → theorem-numbering - quarto-theorem-render → theorem-render - quarto-simple-theorem-render → simple-theorem-render Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent d3a6df5 commit 07db3f3

15 files changed

Lines changed: 37 additions & 37 deletions

File tree

‎src/resources/filters/crossref/equations.lua‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,10 +123,10 @@ function renderEquation(eq, label, alt, order)
123123
escaped_alt = escaped_alt:gsub('"', '\\"')
124124
alt_param = ", alt: \"" .. escaped_alt .. "\""
125125
end
126-
-- Use quarto-equation-numbering variable defined in template
126+
-- Use equation-numbering variable defined in template
127127
-- (simple "(1)" for articles, chapter-based function for books)
128128
result:insert(pandoc.RawInline("typst",
129-
"#math.equation(block: " .. is_block .. ", numbering: quarto-equation-numbering" .. alt_param .. ", [ "))
129+
"#math.equation(block: " .. is_block .. ", numbering: equation-numbering" .. alt_param .. ", [ "))
130130
result:insert(eq)
131131
result:insert(pandoc.RawInline("typst", " ])<" .. label .. ">"))
132132

‎src/resources/filters/customnodes/callout.lua‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ function _callout_main()
314314
caption = pandoc.Plain(pandoc.Str("")),
315315
kind = "quarto-callout-" .. _quarto.modules.callouts.displayName(callout.type),
316316
supplement = param("crossref-" .. callout.type .. "-prefix") or category.name,
317-
numbering = nil, -- handled by quarto-callout-numbering in template
317+
numbering = nil, -- handled by callout-numbering in template
318318
identifier = callout.attr.identifier
319319
}
320320
end)

‎src/resources/filters/customnodes/floatreftarget.lua‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ end, function(float)
11091109
end
11101110

11111111
if float.has_subfloats then
1112-
-- subrefnumbering defaults to quarto-subfloat-numbering in quarto_super
1112+
-- subrefnumbering defaults to subfloat-numbering in quarto_super
11131113
-- (simple "1a" for articles, chapter-based "1.1a" for books)
11141114
return _quarto.format.typst.function_call("quarto_super", {
11151115
{"kind", kind},

‎src/resources/filters/customnodes/theorem.lua‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ local function ensure_typst_theorems(reftype)
149149
#import "@preview/theorion:0.4.1": make-frame
150150
151151
// Simple theorem render: bold title with period, italic body
152-
#let quarto-simple-theorem-render(prefix: none, title: "", full-title: auto, body) = {
152+
#let simple-theorem-render(prefix: none, title: "", full-title: auto, body) = {
153153
if full-title != "" and full-title != auto and full-title != none {
154154
strong[#full-title.]
155155
h(0.5em)
@@ -188,16 +188,16 @@ local function ensure_typst_theorems(reftype)
188188
local color = theme_colors[reftype] or "gray"
189189
render_code = " render: rainbow-render.with(fill: " .. color .. ".darken(20%)),\n"
190190
else -- simple
191-
render_code = " render: quarto-simple-theorem-render,\n"
191+
render_code = " render: simple-theorem-render,\n"
192192
end
193193

194194
-- Use theorion's make-frame with appropriate render
195195
quarto.doc.include_text("in-header", "#let (" .. theorem_type.env .. "-counter, " .. theorem_type.env .. "-box, " ..
196196
theorem_type.env .. ", show-" .. theorem_type.env .. ") = make-frame(\n" ..
197197
" \"" .. theorem_type.env .. "\",\n" ..
198198
" text(weight: \"bold\")[" .. title .. "],\n" ..
199-
" inherited-levels: quarto-theorem-inherited-levels,\n" ..
200-
" numbering: quarto-theorem-numbering,\n" ..
199+
" inherited-levels: theorem-inherited-levels,\n" ..
200+
" numbering: theorem-numbering,\n" ..
201201
render_code ..
202202
")")
203203
quarto.doc.include_text("in-header", "#show: show-" .. theorem_type.env)

‎src/resources/filters/layout/typst.lua‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,10 @@ function make_typst_figure(tbl)
220220
pandoc.RawInline("typst", "]), "),
221221
pandoc.RawInline("typst", "kind: \"" .. kind .. "\", "),
222222
pandoc.RawInline("typst", supplement and ("supplement: \"" .. supplement .. "\", ") or ""),
223-
-- For callouts, use quarto-callout-numbering variable defined in template
223+
-- For callouts, use callout-numbering variable defined in template
224224
-- (simple "1" for articles, chapter-based "1.1" with appendix support for books)
225225
pandoc.RawInline("typst", (kind and kind:find("^quarto%-callout%-")) and
226-
"numbering: quarto-callout-numbering, " or
226+
"numbering: callout-numbering, " or
227227
(numbering and ("numbering: \"" .. numbering .. "\", ") or "")),
228228
pandoc.RawInline("typst", ")"),
229229
pandoc.RawInline("typst", identifier and ("<" .. identifier .. ">") or ""),
@@ -331,7 +331,7 @@ end, function(layout)
331331
local is_margin = hasMarginColumn(layout.float)
332332

333333
if has_subfloats then
334-
-- subrefnumbering defaults to quarto-subfloat-numbering in quarto_super
334+
-- subrefnumbering defaults to subfloat-numbering in quarto_super
335335
-- (simple "1a" for articles, chapter-based "1.1a" for books)
336336
local super_call = _quarto.format.typst.function_call("quarto_super", {
337337
{"kind", kind},

‎src/resources/formats/typst/pandoc/quarto/definitions.typ‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
{
9393
show figure.where(kind: kind): set figure(numbering: _ => {
9494
let subfloat-idx = quartosubfloatcounter.get().first() + 1
95-
quarto-subfloat-numbering(n-super, subfloat-idx)
95+
subfloat-numbering(n-super, subfloat-idx)
9696
})
9797
show figure.where(kind: kind): set figure.caption(position: position)
9898

‎src/resources/formats/typst/pandoc/quarto/numbering.typ‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
// Simple numbering for non-book documents
2-
#let quarto-equation-numbering = "(1)"
3-
#let quarto-callout-numbering = "1"
4-
#let quarto-subfloat-numbering(n-super, subfloat-idx) = {
2+
#let equation-numbering = "(1)"
3+
#let callout-numbering = "1"
4+
#let subfloat-numbering(n-super, subfloat-idx) = {
55
numbering("1a", n-super, subfloat-idx)
66
}
77

88
// Theorem configuration for theorion
99
// Simple numbering for non-book documents (no heading inheritance)
10-
#let quarto-theorem-inherited-levels = 0
10+
#let theorem-inherited-levels = 0
1111

1212
// Theorem numbering format (can be overridden by extensions for appendix support)
1313
// This function returns the numbering pattern to use
14-
#let quarto-theorem-numbering(loc) = "1.1"
14+
#let theorem-numbering(loc) = "1.1"
1515

1616
// Default theorem render function
17-
#let quarto-theorem-render(prefix: none, title: "", full-title: auto, body) = {
17+
#let theorem-render(prefix: none, title: "", full-title: auto, body) = {
1818
if full-title != "" and full-title != auto and full-title != none {
1919
strong[#full-title.]
2020
h(0.5em)

‎tests/docs/smoke-all/crossrefs/equations/equations-alt.qmd‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ _quarto:
3939
typst:
4040
ensureTypstFileRegexMatches:
4141
-
42-
- "#math\\.equation\\(block: true, numbering: quarto-equation-numbering, \\[ \\$ E = m c\\^2 \\$ \\]\\)<eq-display-math>"
43-
- "#math\\.equation\\(block: true, numbering: quarto-equation-numbering, alt: \"Einsteins mass-energy equivalence equation\", \\[ \\$ E = m c\\^2 \\$ \\]\\)<eq-display-alt>"
44-
- "#math\\.equation\\(block: true, numbering: quarto-equation-numbering, alt: \"Einsteins mass-energy equivalence equation\", \\[ \\$ E = m c\\^2 \\$ \\]\\)<eq-display-alt-spaces>"
45-
- "#math\\.equation\\(block: true, numbering: quarto-equation-numbering, alt: \"Newton's second law of motion\", \\[ \\$ F = m a \\$ \\]\\)<eq-single-quote>"
46-
- "#math\\.equation\\(block: true, numbering: quarto-equation-numbering, alt: \"The \\\\\"Pythagorean\\\\\" theorem\", \\[ \\$ a\\^2 \\+ b\\^2 = c\\^2 \\$ \\]\\)<eq-double-quote>"
47-
- "#math\\.equation\\(block: true, numbering: quarto-equation-numbering, alt: \"This is using \\\\\"quotes\\\\\" but I'm sure it works\", \\[ \\$ x \\+ y = z \\$ \\]\\)<eq-mixed-quotes>"
48-
- "#math\\.equation\\(block: true, numbering: quarto-equation-numbering, alt: \"This is using 'single quotes' around the \\\\\"quotes\\\\\" but I'm sure it works\", \\[ \\$ x \\+ y = z \\$ \\]\\)<eq-single-quote-alt>"
42+
- "#math\\.equation\\(block: true, numbering: equation-numbering, \\[ \\$ E = m c\\^2 \\$ \\]\\)<eq-display-math>"
43+
- "#math\\.equation\\(block: true, numbering: equation-numbering, alt: \"Einsteins mass-energy equivalence equation\", \\[ \\$ E = m c\\^2 \\$ \\]\\)<eq-display-alt>"
44+
- "#math\\.equation\\(block: true, numbering: equation-numbering, alt: \"Einsteins mass-energy equivalence equation\", \\[ \\$ E = m c\\^2 \\$ \\]\\)<eq-display-alt-spaces>"
45+
- "#math\\.equation\\(block: true, numbering: equation-numbering, alt: \"Newton's second law of motion\", \\[ \\$ F = m a \\$ \\]\\)<eq-single-quote>"
46+
- "#math\\.equation\\(block: true, numbering: equation-numbering, alt: \"The \\\\\"Pythagorean\\\\\" theorem\", \\[ \\$ a\\^2 \\+ b\\^2 = c\\^2 \\$ \\]\\)<eq-double-quote>"
47+
- "#math\\.equation\\(block: true, numbering: equation-numbering, alt: \"This is using \\\\\"quotes\\\\\" but I'm sure it works\", \\[ \\$ x \\+ y = z \\$ \\]\\)<eq-mixed-quotes>"
48+
- "#math\\.equation\\(block: true, numbering: equation-numbering, alt: \"This is using 'single quotes' around the \\\\\"quotes\\\\\" but I'm sure it works\", \\[ \\$ x \\+ y = z \\$ \\]\\)<eq-single-quote-alt>"
4949
- []
5050
---
5151

‎tests/docs/smoke-all/crossrefs/theorem/theorem-1.qmd‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ _quarto:
2323
- "#ref\\(<thm-line>, supplement: \\[Theorem\\]\\)"
2424
- "#theorem\\(title: \"Line\"\\)"
2525
- "#import \"@preview/theorion:0\\.4\\.1\": make-frame"
26-
- "quarto-simple-theorem-render"
26+
- "simple-theorem-render"
2727
-
2828
- "cosmos"
2929
- "fancy-box"

‎tests/docs/smoke-all/typst/orange-book/_extensions/orange-book/numbering.typ‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
// Chapter-based numbering for books with appendix support
2-
#let quarto-equation-numbering = it => {
2+
#let equation-numbering = it => {
33
let pattern = if state("appendix-state", none).get() != none { "(A.1)" } else { "(1.1)" }
44
numbering(pattern, counter(heading).get().first(), it)
55
}
6-
#let quarto-callout-numbering = it => {
6+
#let callout-numbering = it => {
77
let pattern = if state("appendix-state", none).get() != none { "A.1" } else { "1.1" }
88
numbering(pattern, counter(heading).get().first(), it)
99
}
10-
#let quarto-subfloat-numbering(n-super, subfloat-idx) = {
10+
#let subfloat-numbering(n-super, subfloat-idx) = {
1111
let chapter = counter(heading).get().first()
1212
let pattern = if state("appendix-state", none).get() != none { "A.1a" } else { "1.1a" }
1313
numbering(pattern, chapter, n-super, subfloat-idx)
1414
}
1515
// Theorem configuration for theorion
1616
// Chapter-based numbering (H1 = chapters)
17-
#let quarto-theorem-inherited-levels = 1
17+
#let theorem-inherited-levels = 1
1818

1919
// Appendix-aware theorem numbering
20-
#let quarto-theorem-numbering(loc) = {
20+
#let theorem-numbering(loc) = {
2121
if state("appendix-state", none).at(loc) != none { "A.1" } else { "1.1" }
2222
}
2323

2424
// Theorem render function
2525
// Note: brand-color is not available at this point in template processing
26-
#let quarto-theorem-render(prefix: none, title: "", full-title: auto, body) = {
26+
#let theorem-render(prefix: none, title: "", full-title: auto, body) = {
2727
block(
2828
width: 100%,
2929
inset: (left: 1em),

0 commit comments

Comments
 (0)