Rewrite Rulesphysics/norm-to-double-vert-fence

physics/norm-to-double-vert-fence

Rewrite norm to explicit double-vertical-bar fences.

Rewrite patterns#

  1. auto-sized\norm{#1}\left\| #1 \right\|
  2. fixed-size\norm*{#1}\| #1 \|

Examples#

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

norm#

Before

\norm{v}

After this rule

\left\| v \right\|

Rendering verified with the declared packages.

norm subscripted#

Before

\norm{A x-b}_2

After this rule

\left\| A x-b \right\|_2

Rendering verified with the declared packages.

norm star subscripted#

Before

\norm*{A x-b}_2

After this rule

\| A x-b \|_2

Rendering verified with the declared packages.

Same family#

Notes#

The star branch preserves fixed-size double bars instead of introducing left/right fences.

Disable this rule#

TransformEngine(profile="corpus", disable_rules=["physics/norm-to-double-vert-fence"])
new TransformEngine({ profile: 'corpus', disableRules: ['physics/norm-to-double-vert-fence'] })

Open in Playground