Rewrite patterns#
- cr
\matrix{#1 \cr #2}\begin{matrix} #1 \\ #2 \end{matrix} - linebreak-arguments
\matrix{#1 \\*[#2] #3}\begin{matrix} #1 \\*[#2] #3 \end{matrix} - newline
\matrix{#1 \newline #2}\begin{matrix} #1 \\ #2 \end{matrix} - leading-row-scripts
\matrix{#1 \cr_{#2}^{#3}#4}\begin{matrix} #1 \\{}_{#2}^{#3}#4 \end{matrix} - leading-row-primes
\matrix{#1 \cr'#2}\begin{matrix} #1 \\{}'#2 \end{matrix}
Examples#
Each example shows this rule applied in isolation. A complete normalization profile may make additional changes.
Three by three upper triangular#
The rendered result has pixel differences from the input.
Ams matrix env out of scope#
Rendering verified with the declared packages.
Related rules#
Same family#
ams/Bmatrix-env-to-brace-matrixRewrite the fenced Bmatrix environment to explicit braces around a core matrix environment.ams/Vmatrix-env-to-Vert-matrixRewrite the fenced Vmatrix environment to explicit double bars around a core matrix environment.ams/bmatrix-env-to-bracket-matrixRewrite the fenced bmatrix environment to explicit brackets around a core matrix environment.ams/pmatrix-env-to-paren-matrixRewrite the fenced pmatrix environment to explicit parens around a core matrix environment.ams/vmatrix-env-to-vert-matrixRewrite the fenced vmatrix environment to explicit vertical bars around a core matrix environment.base/cases-to-cases-envRewrite plain-TeX cases to the standard cases environment with row breaks.base/eqalign-to-aligned-envRewrite eqalign to the standard aligned environment.base/eqalignno-to-align-envRewrite eqalignno to the standard align* environment.base/pmatrix-to-pmatrix-envRewrite plain-TeX pmatrix to the standard pmatrix environment with row breaks.physics/antidiagonalmatrix-to-admatCollapse antidiagonalmatrix to the shorter admat helper.physics/diagonalmatrix-to-dmatCollapse diagonalmatrix to the shorter dmat helper.physics/matrixdeterminant-to-mdetCollapse matrixdeterminant to the shorter mdet determinant helper.physics/bmqty-to-mqtyExpand bmqty to the core mqty builder with bracket fence syntax.physics/mdet-to-vmqtyExpand mdet to the vmqty determinant-style builder.physics/pmqty-to-mqtyExpand pmqty to the core mqty builder with paren fence syntax.physics/zmat-to-xmatExpand zmat to the explicit xmat zero-filled builder.
Notes#
Convert only known body-level \cr, \\, and \newline row separators. Normalize \cr and \newline to an unstarred linebreak with no spacing argument; preserve the original star and optional spacing slots on \\ (including \\*, \\[2pt], and \\*[2pt]). Split a separator through any Scripted base chain, transfer its leading subscript, superscript, and Prime content to a fresh empty base at the start of the next row, and preserve nested script layers. Do not split separators inside explicit groups or nested environments, and leave unknown names such as \crcr untouched. Preserve real internal empty rows and the body sequence, including trailing separators. Only the plain-TeX source command is eliminated; existing AMS environments are out of scope.
Disable this rule#
TransformEngine(profile="corpus", disable_rules=["base/matrix-to-matrix-env"])new TransformEngine({ profile: 'corpus', disableRules: ['base/matrix-to-matrix-env'] })