Renderer support
| Package | MathJax | KaTeX | XeTeX |
|---|---|---|---|
physics | MathJax: Full | KaTeX: None | XeTeX: Full |
Syntax#
\comms*starm{}{a}math contentm{b}math contentArgspec s m{} m — one optional and two mandatory arguments. Reading argspecs
Examples#
In TeXForm#
TeXForm parses this entry as prefix syntax; the package determines its argument specification.
Expands to#
\comm{#1}#2 \left[#1,#2\right]If a neighboring \big, \bigg, \Big, or \Bigg follows the command, that size command is used instead of \left...\right; if starred, the result is fixed [#1,#2] and any such size modifier is consumed but ignored in the final rewrite.
Expand commutators to explicit square-bracket fences.
\comm{#1}{#2} \left[#1,#2\right]Equivalent forms#
\commutator{#1}#2exact\left[#1,#2\right]exactMatches the unstarred form when no intervening
\big/\bigg/\Big/\Biggsize modifier is used.
See also#
\acommphysics\anticommutatorphysics\commutatorphysics\pbphysics\poissonbracketphysics
Test cases#
| Input | Case | MathJax | KaTeX | XeTeX |
|---|---|---|---|---|
\comm{a}{b} | Positive · baseline | Pass | Fail | Pass |
\comm*{a}{b} | Positive · vary:s[0] | Pass | Fail | Pass |
\comm{a}b | Positive · bare[2] | Pass | Fail | Pass |