# physics/eval-expand

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

https://texform.dev/rules/physics/eval-expand

## Metadata

| Field | Value |
| --- | --- |
| Key | physics/eval-expand |
| Level | faithful |
| Fidelity | render |
| Enabled by packages | physics |
| Profiles | Faithful, Corpus, Equiv |

## Rewrite patterns

### braced

From:

```latex
\eval{#1}#2
```

To:

```latex
\left.#1\vphantom{\int}\right|#2
```

### braced-star

From:

```latex
\eval*{#1}#2
```

To:

```latex
\left.\smash{#1}\vphantom{\int}\right|#2
```

### paren

From:

```latex
\eval(#1|#2
```

To:

```latex
\left(#1\vphantom{\int}\right|#2
```

### paren-star

From:

```latex
\eval*(#1|#2
```

To:

```latex
\left(\smash{#1}\vphantom{\int}\right|#2
```

### bracket

From:

```latex
\eval[#1|#2
```

To:

```latex
\left[#1\vphantom{\int}\right|#2
```

### bracket-star

From:

```latex
\eval*[#1|#2
```

To:

```latex
\left[\smash{#1}\vphantom{\int}\right|#2
```

## Examples

Examples show the rule in isolation, not a complete normalization profile.

### Braced eval antiderivative

Before:

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

After this rule:

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

Packages: base, physics.

Rendering verified with the declared packages.

### Braced eval star

Before:

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

After this rule:

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

Packages: base, physics.

Rendering verified with the declared packages.

### Paren eval trig

Before:

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

After this rule:

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

Packages: base, physics.

Rendering verified with the declared packages.

### Paren eval star

Before:

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

After this rule:

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

Packages: base, physics.

Rendering verified with the declared packages.

### Bracket eval point

Before:

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

After this rule:

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

Packages: base, physics.

Rendering verified with the declared packages.

### Bracket eval star

Before:

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

After this rule:

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

Packages: base, physics.

Rendering verified with the declared packages.

## Triggers

- [\\eval](https://texform.dev/latex/commands/eval)

## Eliminates

- [\\eval](https://texform.dev/latex/commands/eval)

## Produces

- [\\left](https://texform.dev/latex/commands/left)
- [\\right](https://texform.dev/latex/commands/right)
- [\\vphantom](https://texform.dev/latex/commands/vphantom)
- [\\smash](https://texform.dev/latex/commands/smash)
- [\\int](https://texform.dev/latex/symbols/int)

## Upstream

- [physics/evaluated-to-eval](https://texform.dev/rules/physics/evaluated-to-eval): Collapse evaluated to the shorter eval helper before eval expansion.

## Same family

- [base/Big-class-variants-to-Big](https://texform.dev/rules/base/Big-class-variants-to-Big): Collapse \Bigl, \Bigr, \Bigm to \Big.
- [base/Bigg-class-variants-to-Bigg](https://texform.dev/rules/base/Bigg-class-variants-to-Bigg): Collapse \Biggl, \Biggr, \Biggm to \Bigg.
- [base/big-class-variants-to-big](https://texform.dev/rules/base/big-class-variants-to-big): Collapse \bigl, \bigr, \bigm to \big.
- [base/bigg-class-variants-to-bigg](https://texform.dev/rules/base/bigg-class-variants-to-bigg): Collapse \biggl, \biggr, \biggm to \bigg.
- [base/Big-delimiter-size-drop](https://texform.dev/rules/base/Big-delimiter-size-drop): Drop the fixed delimiter size imposed by \Big.
- [base/Bigg-delimiter-size-drop](https://texform.dev/rules/base/Bigg-delimiter-size-drop): Drop the fixed delimiter size imposed by \Bigg.
- [base/big-delimiter-size-drop](https://texform.dev/rules/base/big-delimiter-size-drop): Drop the fixed delimiter size imposed by \big.
- [base/bigg-delimiter-size-drop](https://texform.dev/rules/base/bigg-delimiter-size-drop): Drop the fixed delimiter size imposed by \bigg.
- [physics/absolutevalue-to-abs](https://texform.dev/rules/physics/absolutevalue-to-abs): Collapse absolutevalue to the shorter abs helper before fence expansion.
- [physics/evaluated-to-eval](https://texform.dev/rules/physics/evaluated-to-eval): Collapse evaluated to the shorter eval helper before eval expansion.
- [physics/quantity-to-qty](https://texform.dev/rules/physics/quantity-to-qty): Collapse quantity to the shorter qty helper.
- [physics/Bqty-to-brace-fence](https://texform.dev/rules/physics/Bqty-to-brace-fence): Rewrite Bqty to explicit brace fences.
- [physics/abs-to-vert-fence](https://texform.dev/rules/physics/abs-to-vert-fence): Rewrite abs to explicit vertical bar fences.
- [physics/bqty-to-bracket-fence](https://texform.dev/rules/physics/bqty-to-bracket-fence): Rewrite bqty to explicit bracket fences.
- [physics/norm-to-double-vert-fence](https://texform.dev/rules/physics/norm-to-double-vert-fence): Rewrite norm to explicit double-vertical-bar fences.
- [physics/pqty-to-paren-fence](https://texform.dev/rules/physics/pqty-to-paren-fence): Rewrite pqty to explicit parenthesis fences.

## Notes

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

## Disable this rule

```python
TransformEngine(profile="corpus", disable_rules=["physics/eval-expand"])
```

```javascript
new TransformEngine({ profile: 'corpus', disableRules: ['physics/eval-expand'] })
```

[Open in Playground](https://play.texform.dev/?input=%5Ceval%7B%5Cfrac%7Bx%5E2%7D%7B2%7D%7D_0%5E1%3D%5Cfrac%7B1%7D%7B2%7D)
