Rewrite Rulesphysics/bqty-to-bracket-fence

physics/bqty-to-bracket-fence

Rewrite bqty to explicit bracket fences.

Rewrite patterns#

  1. auto-sized\bqty{#1}\left[ #1 \right]
  2. fixed-size\bqty*{#1}[ #1 ]

Examples#

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

bqty#

Before

\bqty{a+b}

After this rule

\left[ a+b \right]

Rendering verified with the declared packages.

bqty subscript index#

Before

A_{\bqty{i,j}}

After this rule

A_{\left[ i,j \right]}

Rendering verified with the declared packages.

bqty star subscript index#

Before

A_{\bqty*{i,j}}

After this rule

A_{[ i,j ]}

Rendering verified with the declared packages.

Same family#

Notes#

The star branch preserves fixed-size brackets instead of introducing left/right fences.

Disable this rule#

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

Open in Playground