Rewrite Rulesbase/eqalignno-to-align-env

base/eqalignno-to-align-env

Rewrite eqalignno to the standard align* environment.

Rewrite patterns#

  1. parenthesized-numeric-number\eqalignno{#1&#2&(#3)}\begin{align*} #1&#2 \tag{#3} \end{align*}
  2. raw-numeric-number\eqalignno{#1&#2&#3}\begin{align*} #1&#2 \tag*{#3} \end{align*}
  3. parenthesized-math-number\eqalignno{#1&#2&(#3)}\begin{align*} #1&#2 \tag{$#3$} \end{align*}
  4. raw-math-number\eqalignno{#1&#2&#3}\begin{align*} #1&#2 \tag*{$#3$} \end{align*}
  5. empty-number-cell\eqalignno{#1&#2&}\begin{align*} #1&#2 \end{align*}
  6. missing-number-cell\eqalignno{#1&#2}\begin{align*} #1&#2 \end{align*}
  7. final-row-terminator\eqalignno{#1&#2&(#3)\cr}\begin{align*} #1&#2 \tag{#3} \end{align*}
  8. internal-empty-row\eqalignno{#1&#2&(#3)\cr\cr#4&#5&(#6)}\begin{align*} #1&#2 \tag{#3}\\\\#4&#5 \tag{#6} \end{align*}
  9. linebreak-arguments\eqalignno{#1&#2&(#3)\\*[#4]}\begin{align*} #1&#2 \tag{#3}\\*[#4] \end{align*}
  10. newline\eqalignno{#1&#2&(#3)\newline#4&#5&(#6)}\begin{align*} #1&#2 \tag{#3}\\#4&#5 \tag{#6} \end{align*}
  11. leading-row-scripts\eqalignno{#1&#2&(#3)\cr_{#4}^{#5}#6&#7&(#8)}\begin{align*} #1&#2 \tag{#3}\\{}_{#4}^{#5}#6&#7 \tag{#8} \end{align*}

Examples#

Each example shows this rule applied in isolation. A complete normalization profile may make additional changes.

eqalignno right tag branch#

Before

\eqalignno{F(x)&=\int_0^x f(t)\,dt&(1)\cr F'(x)&=f(x)&(2)\cr F''(x)&=f'(x)&(3)}

After this rule

\begin{align*} F(x)&=\int_0^x f(t)\,dt \tag{1}\\ F'(x)&=f(x) \tag{2}\\ F''(x)&=f'(x) \tag{3} \end{align*}

The rendered result has pixel differences from the input.

Same family#

Notes#

The second body-level AlignmentTab separates the third mathematical numbering cell; nested alignment tabs do not create new cells, and a row with more than three cells returns a normal transform error. Rows with a missing or empty number cell and actual empty rows get no tag, because \eqalignno never numbers rows automatically; the target is align* so no automatic numbers appear. A single complete outer parenthesis pair becomes \tag; otherwise retain the number verbatim with \tag*, without adding parentheses. Numeric patterns apply to ASCII-digit-only content after removal of that outer pair; all other numbering content retains its mathematical subtree inside a $...$ text-mode tag argument, including scripts, groups, fractions, text commands, and nested environments. Only a complete outer pair is removed, so (n)+(m) remains raw. Split only known body-level \cr, \\, and \newline; copy the original \\ star and optional spacing arguments, including \\*[2pt]. Remove exactly the artificial empty segment after a final terminator and omit a final default separator; retain final starred or spaced separators, consecutive internal empty rows, and explicitly terminated final empty rows. Transfer scripts and primes on a parsed separator to an empty base in the next row rather than to the preceding tag. Do not descend into explicit groups or nested environments when identifying separators.

Disable this rule#

TransformEngine(profile="corpus", disable_rules=["base/eqalignno-to-align-env"])
new TransformEngine({ profile: 'corpus', disableRules: ['base/eqalignno-to-align-env'] })

Open in Playground