Rewrite Rulesbase/mskip-to-mspace

base/mskip-to-mspace

Collapse mskip to the explicit mspace command.

Rewrite patterns#

  1. \mskip #1\mspace{#1}

Examples#

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

mskip between text words#

Before

\text{Left\mskip 1em Right}

After this rule

\text{Left\mspace{1em}Right}

Rendering verified with the declared packages.

mskip mu length#

Before

X\mskip 3mu Y

After this rule

X\mspace{3mu} Y

Rendering verified with the declared packages.

Text mskip braced space loss#

Before

\text{A\mskip{1em} B}

After this rule

\text{A\mspace{1em}B}

The rendered result has pixel differences from the input.

Same family#

Notes#

MathJax's unbraced Hskip dimension scanner consumes one ASCII space after the unit in text content, while a braced dimension preserves following text space. TeXForm's AST does not retain whether a scalar dimension was braced, so this rule canonicalizes the common primitive form by consuming one following U+0020 in text content. A braced text source can therefore lose an intentional space, making worst-case fidelity approximate. The base record remains the single owner.

Disable this rule#

TransformEngine(profile="corpus", disable_rules=["base/mskip-to-mspace"])
new TransformEngine({ profile: 'corpus', disableRules: ['base/mskip-to-mspace'] })

Open in Playground