Rewrite Rulesbase/buildrel-to-stackrel

base/buildrel-to-stackrel

Rewrite plain TeX buildrel syntax to stackrel.

Rewrite patterns#

  1. operator\buildrel #1 \over #2\stackrel{#1}{#2}
  2. operator-external-scripts\buildrel #1 \over #2_{#3}^{#4}\stackrel{#1}{#2}_{#3}^{#4}

Examples#

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

Asymptotic relation stack#

Before

A_n \buildrel n\to\infty \over = B_n

After this rule

A_n \stackrel{n\to\infty}{=} B_n

Rendering verified with the declared packages.

Arrow relation stack#

Before

X \buildrel \phi \over \longrightarrow Y

After this rule

X \stackrel{\phi}{\longrightarrow} Y

Rendering verified with the declared packages.

Downstream rules#

Same family#

Notes#

buildrel has argspec u{\over} m: the annotation is read up to a level-0 \over and the operator is the following mandatory argument, so \over is ArgumentKind::Until delimiter metadata rather than a sibling infix node and touches is empty. As for a TeX delimited parameter, an annotation that is exactly one braced group loses that brace layer at parse time; a \over inside braces is not a terminator. Scripts after the operator argument stay attached to the whole stackrel, while scripts inside a braced operator stay inside it. stackrel is the accepted Authoring form; Faithful expands it further through stackrel-expand. Like other unbraced mandatory arguments, an unbraced compound operator such as \frac{a}{b} is accepted as one argument even though TeX would reject it.

Disable this rule#

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

Open in Playground