Rewrite Rulesphysics/abs-to-vert-fence

physics/abs-to-vert-fence

Rewrite abs to explicit vertical bar fences.

Rewrite patterns#

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

Examples#

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

abs inequality#

Before

\abs{x-y}<\varepsilon

After this rule

\left| x-y \right|<\varepsilon

Rendering verified with the declared packages.

abs fraction body#

Before

\abs{\frac{x}{y}}=1

After this rule

\left| \frac{x}{y} \right|=1

Rendering verified with the declared packages.

abs star fixed size#

Before

\abs*{x-y}<\varepsilon

After this rule

| x-y |<\varepsilon

Rendering verified with the declared packages.

Upstream rules#

Same family#

Notes#

The star branch is the fixed-size form emitted by physics Quantity for braced arguments.

Disable this rule#

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

Open in Playground