Render algorithm, assumption, criterion and property in LaTeX export - #3031
Render algorithm, assumption, criterion and property in LaTeX export#3031alanlujan91 wants to merge 1 commit into
Conversation
kindToEnvironment mapped 11 of the 15 PROOF_KINDS. The other four matched no case and were dropped from the .tex output along with their labels, so cross-references to them rendered as ??. Adds the four cases, their \newtheorem declarations, and fixture coverage for each. Also corrects proof:criteria to proof:criterion in the proof-kinds table, since the registered kind is criterion.
🦋 Changeset detectedLatest commit: b92adbb The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Pull request overview
Fixes LaTeX export omissions for four proof directive kinds (algorithm, assumption, criterion, property) by mapping them to LaTeX environments and ensuring corresponding theorem-like environments are declared in the TeX preamble. This aligns myst-to-tex behavior with the full PROOF_KINDS set and prevents dropped labels / broken cross-references.
Changes:
- Extend
kindToEnvironmentand the generated LaTeX preamble (\newtheoremlist) to supportalgorithm,assumption,criterion, andproperty. - Add fixture coverage for the four proof kinds and add a targeted preamble unit test.
- Fix documentation typo:
proof:criteria→proof:criterion, and add a changeset for a patch release.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| packages/myst-to-tex/src/proof.ts | Adds environment mappings and \\newtheorem declarations for the four missing proof kinds. |
| packages/myst-to-tex/tests/proofs.yml | Adds LaTeX output fixtures for algorithm, assumption, criterion, and property proofs. |
| packages/myst-to-tex/tests/proofs.spec.ts | Adds a vitest check that the preamble declares \\newtheorem for the new environments. |
| docs/proofs-and-theorems.md | Corrects directive list entry to proof:criterion. |
| .changeset/olive-donkeys-shave.md | Declares a patch release note for the LaTeX export fix. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Closes #3030
Closes #2680
kindToEnvironmentmapped 11 of the 15PROOF_KINDS. The other four matched no case, so they were dropped from the export along with their labels.Adds the four cases, their
\newtheoremdeclarations, and fixture coverage for each. Also correctsproof:criteriatoproof:criterionin the proof-kinds table, since the registered kind iscriterionand the example further down the same page uses it.One note:
\newtheorem{algorithm}clashes with\usepackage{algorithm}if a template loads it. No bundled template does, and the current behaviour for those users is silent content loss, but I am happy to guard the declarations instead if you prefer.