Rewrite Rulesbase/prime-to-prime-node

base/prime-to-prime-node

Convert the prime control sequence to the Prime AST node.

Rewrite patterns#

  1. ordinary-symbol\prime\prime
  2. pure-superscriptf^\primef'

Examples#

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

Script superscript shorthand#

Before

f^\prime

After this rule

f'

Rendering verified with the declared packages.

Subscripted symbol prime#

Before

F_\nu^\prime

After this rule

F_\nu'

Rendering verified with the declared packages.

Ordinary prime symbol#

Before

\prime

After this rule

\prime

Rendering verified with the declared packages.

prime after superscript#

Before

x^2\prime

After this rule

x ^ { 2 } \prime

Rendering verified with the declared packages.

Mixed superscript symbol#

Before

f^{\prime 2}

After this rule

f ^ { \prime 2 }

Rendering verified with the declared packages.

Same family#

Notes#

The rewrite changes Command("prime") to Prime(1) in any math position; the source text may stay unchanged for ordinary symbols. produces is empty because Prime is an AST node, not a builtin command or character target. Authoring preserves script binding; Reading remains the conservative fidelity floor because subsequent multi-prime serialization can select a different glyph than separate prime symbols.

Disable this rule#

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

Open in Playground