Rewrite Rulesphysics/eval-expand

physics/eval-expand

Expand eval notation to the explicit fence-and-bar form.

Rewrite patterns#

  1. braced\eval{#1}#2\left.#1\vphantom{\int}\right|#2
  2. braced-star\eval*{#1}#2\left.\smash{#1}\vphantom{\int}\right|#2
  3. paren\eval(#1|#2\left(#1\vphantom{\int}\right|#2
  4. paren-star\eval*(#1|#2\left(\smash{#1}\vphantom{\int}\right|#2
  5. bracket\eval[#1|#2\left[#1\vphantom{\int}\right|#2
  6. bracket-star\eval*[#1|#2\left[\smash{#1}\vphantom{\int}\right|#2

Examples#

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

Braced eval antiderivative#

Before

\eval{\frac{x^2}{2}}_0^1=\frac{1}{2}

After this rule

\left.\frac{x^2}{2}\vphantom{\int}\right|_0^1=\frac{1}{2}

Rendering verified with the declared packages.

Braced eval star#

Before

\eval*{F(x)}_a^b

After this rule

\left.\smash{F(x)}\vphantom{\int}\right|_a^b

Rendering verified with the declared packages.

Paren eval trig#

Before

\eval(\sin x|_0^{\pi}=0

After this rule

\left(\sin x\vphantom{\int}\right|_0^{\pi}=0

Rendering verified with the declared packages.

Paren eval star#

Before

\eval*(\sin x|_0^{\pi}=0

After this rule

\left(\smash{\sin x}\vphantom{\int}\right|_0^{\pi}=0

Rendering verified with the declared packages.

Bracket eval point#

Before

\eval[f(x)|_{x=0}=1

After this rule

\left[f(x)\vphantom{\int}\right|_{x=0}=1

Rendering verified with the declared packages.

Bracket eval star#

Before

\eval*[f(x)|_{x=0}=1

After this rule

\left[\smash{f(x)}\vphantom{\int}\right|_{x=0}=1

Rendering verified with the declared packages.

Upstream rules#

Same family#

Notes#

Merged from eval-braced-expand and eval-paren-expand so cmd:eval has one eliminates owner.

Disable this rule#

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

Open in Playground