Skip to content

fea (crossref): add axiom and assumption theorem types, fix algorithm style - #14800

Open
luifrancgom wants to merge 5 commits into
quarto-dev:mainfrom
luifrancgom:feat/theorems-axiom-assumption-algorithm
Open

fea (crossref): add axiom and assumption theorem types, fix algorithm style#14800
luifrancgom wants to merge 5 commits into
quarto-dev:mainfrom
luifrancgom:feat/theorems-axiom-assumption-algorithm

Conversation

@luifrancgom

@luifrancgom luifrancgom commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Description

According to the AMS documentation Using the amsthm Package axiom and assumption are standard mathematical environments used in mathematics (e.g. Zermelo-Frankel axioms in set theory) and statistics (e.g Gauss-Markov assumptions of linear regression model)

This PR adds native cross-referencing for axiom and assumption, fixes algorithm typography and wires full localisation.

Related issues

Documentation PR in quarto-web

Summary of changes

  • Added axm (Axiom) and asm (Assumption) to theorem_types table in theorem.lua
  • Set alg (Algorithm) style to definition and mapped colors (orange, fuchsia) for axm and asm
  • Added *-title, *-prefix and *-labels options to definitions.yml and document-crossref.yml
  • Rebuilt schema intelligence artifacts via build-artifacts
  • Added test cases in theorem-types.qmd and assertions in thereoms.test.ts

Testing and verification

  • smoke/crossref/thereoms.test.ts passed locally
  • docs/smoke-all/typst/theorem/*.qmd passed locally across all appereances
  • Verified rendering across HTML, Typst, LaTeX, LibreOffice (odt), Word (docx), EPub (epub)
  • Verified spanish localisation with lang:es (Axioma, Supuesto, Algoritmo)

Example 1

---
title: Theorem Test
number-sections: true
format:
  html: default
  latex: default
  typst:
    theorem-appearance: clouds
  docx: default
  odt: default
  epub: default
crossref:
  alg-title: "Procedure"
  alg-prefix: "Proc."
  axm-title: "Postulate"
  axm-prefix: "Post."
  asm-title: "Hypothesis"
  asm-prefix: "Hyp."
---

::: {#alg-test}
## Algorithm

This is an algorithm

$$
y = mx + b
$$
:::

See @alg-test.

::: {#axm-test}
## Axiom

This is an axiom

$$
y = mx + b
$$
:::

See @axm-test.

::: {#asm-test}
## Assumption

This is an assumption

$$
y = mx + b
$$
:::

See @asm-test.


::: {#alg-a}
## Algorithm A
First algorithm.
:::
    
::: {#alg-b}
## Algorithm B
Second algorithm.
:::
    
::: {#axm-a}
## Axiom A
First axiom.
:::

::: {#asm-a}
## Assumption A
First assumption.
:::

We compare @alg-a and @alg-b under @axm-a and @asm-a.

@alg-a, @alg-b, @axm-a, @asm-a.   

Example 2

---
title: Theorem Test Spanish
number-sections: true
format:
  html: default
  latex: default
  typst:
    theorem-appearance: clouds
  docx: default
  odt: default
  epub: default
lang: es
---

::: {#alg-test}
## Algorithm

This is an algorithm

$$
y = mx + b
$$
:::

See @alg-test.

::: {#axm-test}
## Axiom

This is an axiom

$$
y = mx + b
$$
:::

See @axm-test.

::: {#asm-test}
## Assumption

This is an assumption

$$
y = mx + b
$$
:::

See @asm-test.

Checklist

I have (if applicable):

  • referenced the GitHub issue this PR closes
  • updated the appropriate changelog in the PR
  • ensured the present test suite passes
  • added new tests
  • created a separate documentation PR in Quarto's website repo and linked it to this PR
AI-assisted PR
  • AI tool used: Antigravity (Google DeepMind)
  • Codebase grounding: Local clone of quarto-cli
  • Human review: I personally reviewed, tested, rendered and verified all code and test changes across multiple formats. The AI assistant was used for architectural guidance to understand the internal structure of quarto-cli (navigating Lua custom AST filters, TypeScript parameter passing, YAML schema validation and test runners) to identify and correctly update the relevant files.

… style

- Add axm (Axiom) and asm (Assumption) to theorem_types table in theorem. lua

- Set alg (Algorithm) style to definition

- Add axm and asm Typst colors (orange and fuchsia)

- Register constants and wire title-to-prefix inheritance for alg, axm, and asm

- Add English and Spanish language defaults
…ypes

- Add crossref-*-title and crossref-*-prefix to format-language schema

- Add title, prefix, and labels options to document-crossref schema

- Rebuild schema artifacts and TypeScript types via build-artifacts
@posit-snyk-bot

posit-snyk-bot commented Aug 23, 2026

Copy link
Copy Markdown
Collaborator

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@luifrancgom luifrancgom changed the title Feat/theorems axiom assumption algorithm fea (crossref): add axiom and assumption theorem types, fix algorithm style Aug 23, 2026
@luifrancgom

luifrancgom commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

The existing smoke test in tests/docs/smoke-all/crossrefs/theorem/algorithm.qmd failed because it was written asserting the old abbreviation: alg. 1 and Alg.~ ref{...}

Since this PR wires title-to-prefix inheritance so that alg- resolves to the full title Algorithm 1 (consistent with Theorem 1, Lemma 1 and other theorem types), I would like to know if it is appropiate to update that test so it expects Algorithm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants