Renderer support
| Package | MathJax | KaTeX | XeTeX |
|---|---|---|---|
base | MathJax: Full | KaTeX: Full | XeTeX: Full |
textmacros | MathJax: Full | KaTeX: Full | XeTeX: Full |
Syntax#
\smashO{}:N[\cs]optional control sequencem{a}math contentArgspec O{}:N m — one optional and one mandatory argument. In base. Reading argspecs
\smashO{}:N[\cs]optional control sequencem:T{a}text contentArgspec O{}:N m:T — one optional and one mandatory argument. In textmacros. Reading argspecs
Examples#
Package variants#
| Package | Signature | Allowed mode | Notes |
|---|---|---|---|
base | O{}:N m | math | Used to suppress an expression’s height and/or depth so it does not affect surrounding layout, such as line spacing or delimiter sizing. |
textmacros | O{}:N m:T | text | Used to typeset content while suppressing its recorded height/depth, often to prevent tall or deep material from affecting line spacing or box measurements in text. |
In TeXForm#
TeXForm parses this entry as prefix syntax; the package determines its argument specification.
Test cases#
| Input | Case | MathJax | KaTeX | XeTeX |
|---|---|---|---|---|
\smash{a} | Positive · baseline | Pass | Pass | Pass |
\smash[a]{b} | Positive · vary:o[0] | Pass | Pass | Pass |
\smash a | Positive · bare[1] | Pass | Pass | Pass |
\smash[\alpha]{a} | Negative · neg:N[0] | Pass | Pass | Pass |
| Input | Case | MathJax | KaTeX | XeTeX |
|---|---|---|---|---|
\smash{a} | Positive · baseline | Pass | Pass | Pass |
\smash[a]{b} | Positive · vary:o[0] | Pass | Pass | Pass |
\smash a | Positive · bare[1] | Pass | Pass | Pass |
\smash[\alpha]{a} | Negative · neg:N[0] | Pass | Fail | Fail |
\smash{a^2} | Negative · neg:T[1] | Fail | Fail | Fail |