Rewrite Rulesphysics/vectorunit-to-vu

physics/vectorunit-to-vu

Collapse vectorunit to the short vu helper.

Rewrite patterns#

  1. vectorunit\vectorunit{#1}\vu{#1}
  2. vectorunit-star\vectorunit*{#1}\vu*{#1}

Examples#

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

vectorunit radial basis#

Before

\vectorunit{e}_r\cdot\vb{r}=r

After this rule

\vu{e}_r\cdot\vb{r}=r

Rendering verified with the declared packages.

vectorunit star bold italic#

Before

\vectorunit*{\alpha}\cdot\vectorunit*{p}

After this rule

\vu*{\alpha}\cdot\vu*{p}

Rendering verified with the declared packages.

Downstream rules#

Same family#

Notes#

Star is preserved on the short alias; physics StarMacro propagates it into the nested vb branch used under hat.

Disable this rule#

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

Open in Playground