Skip to content

Render algorithm, assumption, criterion and property in LaTeX export - #3031

Open
alanlujan91 wants to merge 1 commit into
jupyter-book:mainfrom
alanlujan91:fix/tex-proof-kinds
Open

Render algorithm, assumption, criterion and property in LaTeX export#3031
alanlujan91 wants to merge 1 commit into
jupyter-book:mainfrom
alanlujan91:fix/tex-proof-kinds

Conversation

@alanlujan91

@alanlujan91 alanlujan91 commented Aug 19, 2026

Copy link
Copy Markdown

Closes #3030
Closes #2680

kindToEnvironment mapped 11 of the 15 PROOF_KINDS. The other four matched no case, so they were dropped from the export along with their labels.

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 and 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.

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.
Copilot AI lite review requested due to automatic review settings August 19, 2026 15:29
@changeset-bot

changeset-bot Bot commented Aug 19, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b92adbb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
myst-to-tex Patch
tex-to-myst Patch
mystmd-docs Patch

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

@github-actions github-actions Bot added the bug Something isn't working label Aug 19, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 kindToEnvironment and the generated LaTeX preamble (\newtheorem list) to support algorithm, assumption, criterion, and property.
  • Add fixture coverage for the four proof kinds and add a targeted preamble unit test.
  • Fix documentation typo: proof:criteriaproof: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.

Comment thread packages/myst-to-tex/src/proof.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Four proof kinds are dropped from LaTeX export Missing assumption environment in LaTeX

2 participants