Rewrite Rulesams/pmatrix-env-to-paren-matrix

ams/pmatrix-env-to-paren-matrix

Rewrite the fenced pmatrix environment to explicit parens around a core matrix environment.

Rewrite patterns#

  1. \begin{pmatrix} #1 \end{pmatrix}\left(\begin{matrix} #1 \end{matrix}\right)

Examples#

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

pmatrix#

Before

\begin{pmatrix} a & b \\ c & d \end{pmatrix}

After this rule

\left(\begin{matrix} a & b \\ c & d \end{matrix}\right)

Rendering verified with the declared packages.

pmatrix env ams only#

Before

\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}

After this rule

\left(\begin{matrix} 1 & 0 \\ 0 & 1 \end{matrix}\right)

Rendering verified with the declared packages.

Plain pmatrix command out of scope#

Before

\pmatrix{x \cr y}

After this rule

\pmatrix{x \cr y}

Rendering verified with the declared packages.

Upstream rules#

Same family#

Disable this rule#

TransformEngine(profile="corpus", disable_rules=["ams/pmatrix-env-to-paren-matrix"])
new TransformEngine({ profile: 'corpus', disableRules: ['ams/pmatrix-env-to-paren-matrix'] })

Open in Playground