Quarto has excellent built-in support for standard theorem-like environments (theorem, lemma, corollary, etc.), but currently doesn't provide a way to define custom amsthm environments like "Problem", "Claim", or "Observation". This extension fills that gap by allowing you to define custom theorem-like environments that work seamlessly with both HTML and LaTeX output.
quarto add MateusMolina/custom-amsthm-environmentsDefine custom environments in your YAML frontmatter:
---
title: "My Document"
custom-amsthm:
- key: prm
name: Problem
- key: clm
name: Claim
numbering-style: global
- key: nota
name: Notation
numbered: false
filters:
- custom-amsthm-environments
---Use them in your document:
::: {#prm-problem1}
Show that $2 + 2 = 4$.
:::
See @prm-problem1 for details.Each environment requires:
key: Short identifier (e.g.,prm)name: Display name (e.g., "Problem")
Optional fields (automatically derived if not specified):
reference-prefix: Cross-reference text (defaults toname)latex-name: LaTeX environment name (defaults to lowercasename)numbered: Whether to number (defaults totrue)numbering-style:"section"(default) or"global"
For complete examples, configuration options, and usage patterns, see example.qmd.
- Works with both HTML and LaTeX output
- Compatible with Quarto's built-in amsthm environments
- Automatic cross-referencing support
- Configurable numbering styles