Rewrite Rulesbase/duplicate-mathrel-wrapper-drop

base/duplicate-mathrel-wrapper-drop

Drop one directly nested duplicate mathrel wrapper.

Rewrite patterns#

  1. \mathrel{\mathrel{#1}}\mathrel{#1}

Examples#

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

Direct duplicate#

Before

a\mathrel{\mathrel{=}}b

After this rule

a\mathrel{=}b

Rendering verified with the declared packages.

Upstream rules#

Same family#

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#

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

Open in Playground