# base/duplicate-mathrel-wrapper-drop

Drop one directly nested duplicate mathrel wrapper.

https://texform.dev/rules/base/duplicate-mathrel-wrapper-drop

## Metadata

| Field | Value |
| --- | --- |
| Key | base/duplicate-mathrel-wrapper-drop |
| Level | authoring |
| Fidelity | render |
| Enabled by packages | base |
| Profiles | Authoring, Faithful, Corpus, Equiv |

## Rewrite patterns

From:

```latex
\mathrel{\mathrel{#1}}
```

To:

```latex
\mathrel{#1}
```

## Examples

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

### Direct duplicate

Before:

```latex
a\mathrel{\mathrel{=}}b
```

After this rule:

```latex
a\mathrel{=}b
```

Packages: base.

Rendering verified with the declared packages.

## Triggers

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

## Touches

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

## Upstream

- [base/stackrel-expand](https://texform.dev/rules/base/stackrel-expand): Expand stackrel to an explicit relation-level stacked operator form.

## Same family

- [ams/substack-expand](https://texform.dev/rules/ams/substack-expand): Expand substack directly to the explicit centered subarray environment.
- [base/buildrel-to-stackrel](https://texform.dev/rules/base/buildrel-to-stackrel): Rewrite plain TeX buildrel syntax to stackrel.
- [base/widehat-to-hat](https://texform.dev/rules/base/widehat-to-hat): Drop stretchiness from \widehat by rewriting it to \hat.
- [base/widetilde-to-tilde](https://texform.dev/rules/base/widetilde-to-tilde): Drop stretchiness from \widetilde by rewriting it to \tilde.
- [base/stackbin-expand](https://texform.dev/rules/base/stackbin-expand): Expand stackbin to an explicit binary-level stacked operator form.
- [base/stackrel-expand](https://texform.dev/rules/base/stackrel-expand): Expand stackrel to an explicit relation-level stacked operator form.

## Notes

Match only a direct same-name wrapper whose outer and inner MathContent slots each contain exactly the required structure. Other TeX-class wrappers, mixed wrapper names, extra siblings, and nested structural boundaries remain unchanged. Every Applied result removes one directly nested cmd:mathrel wrapper, so both the wrapper count and duplicate-wrapper nesting depth strictly decrease; non-duplicate shapes return Skipped.

## Disable this rule

```python
TransformEngine(profile="corpus", disable_rules=["base/duplicate-mathrel-wrapper-drop"])
```

```javascript
new TransformEngine({ profile: 'corpus', disableRules: ['base/duplicate-mathrel-wrapper-drop'] })
```

[Open in Playground](https://play.texform.dev/?input=a%5Cmathrel%7B%5Cmathrel%7B%3D%7D%7Db)
