Found while adopting qe-v9 in the LaTeX→MyST converter (QuantEcon/claude-latex-to-myst#186). Verified against myst v1.10.1 (qe-v9).
Summary
A labelled align* takes a real equation number. align* is unnumbered in amsmath, and #81's own description says "align* and friends: unnumbered" — but that only holds when the node has no identifier.
Reproduce
With numbering: {book: {enabled: true}}:
$$
z_0 = 0
$$ (eq-base0)
(eq-star-outer)=
$$
\begin{align*}
a &= b \\
c &= d
\end{align*}
$$
$$
z_1 = 1
$$ (eq-base1)
Built AST:
| node |
enumerator |
eq-base0 |
1 |
eq-star-outer (the align*) |
2 |
eq-base1 |
3 |
The starred environment consumed number 2 and pushed everything after it along. Without the (eq-star-outer)= anchor the same block is correctly unnumbered.
Cause
packages/myst-transforms/src/math.ts sets the unnumbered flag only when the node has no identifier:
if (node.enumerated == null && !node.identifier) node.enumerated = false;
Once a label is attached the !node.identifier guard fails, so the starred env falls through to normal numbering and also loses node.rows.
Expected
A starred environment is unnumbered regardless of whether it carries a label. In LaTeX, \label inside align* is legal — it just refers to whatever the enclosing counter last was — and it certainly does not cause the environment to be numbered.
Why it matters downstream
This is a live shape: book-dp1's ch_ctime.tex has a labelled align* (eq:vgctp), the only one across the three QuantEcon books. The converter currently emits starred envs as a {math} directive with :enumerated: false to force the correct behaviour; that workaround exists precisely because of this. If this is fixed we can drop it and pass starred envs through like the non-starred ones.
Found while adopting
qe-v9in the LaTeX→MyST converter (QuantEcon/claude-latex-to-myst#186). Verified againstmyst v1.10.1 (qe-v9).Summary
A labelled
align*takes a real equation number.align*is unnumbered in amsmath, and #81's own description says "align*and friends: unnumbered" — but that only holds when the node has no identifier.Reproduce
With
numbering: {book: {enabled: true}}:Built AST:
eq-base0eq-star-outer(thealign*)eq-base1The starred environment consumed number 2 and pushed everything after it along. Without the
(eq-star-outer)=anchor the same block is correctly unnumbered.Cause
packages/myst-transforms/src/math.tssets the unnumbered flag only when the node has no identifier:Once a label is attached the
!node.identifierguard fails, so the starred env falls through to normal numbering and also losesnode.rows.Expected
A starred environment is unnumbered regardless of whether it carries a label. In LaTeX,
\labelinsidealign*is legal — it just refers to whatever the enclosing counter last was — and it certainly does not cause the environment to be numbered.Why it matters downstream
This is a live shape:
book-dp1'sch_ctime.texhas a labelledalign*(eq:vgctp), the only one across the three QuantEcon books. The converter currently emits starred envs as a{math}directive with:enumerated: falseto force the correct behaviour; that workaround exists precisely because of this. If this is fixed we can drop it and pass starred envs through like the non-starred ones.