Rewrite patterns#
- operator-brace
\exp{#1}\exp\left\{#1\right\} - operator-bracket
\exp[#1]\exp\left[#1\right] - operator-paren
\exp(#1)\exp\left(#1\right)
Examples#
Each example shows this rule applied in isolation. A complete normalization profile may make additional changes.
Operator brace#
The rendered result has pixel differences from the input.
Operator bracket literal paren#
The rendered result has pixel differences from the input.
Operator paren#
The rendered result has pixel differences from the input.
Operator paren ordinary after#
The rendered result has pixel differences from the input.
Related rules#
Upstream rules#
ams/operatorname-to-named-functionRewrite plain operatorname arguments to equivalent base named-function or named-operator commands.physics/probability-to-prCollapse a bare Probability helper to the standard Pr operator.
Same family#
ams/operatorname-to-named-functionRewrite plain operatorname arguments to equivalent base named-function or named-operator commands.ams/idotsint-expandExpand idotsint to explicit repeated integral surfaces.base/limits-dropDrop explicit limits from an audited operator while preserving attached scripts.base/nolimits-dropDrop explicit nolimits from an audited operator while preserving attached scripts.physics/cosine-to-cosCollapse a bare cosine helper to the standard cos operator.physics/naturallogarithm-to-lnCollapse a bare natural logarithm helper to the standard ln operator.physics/probability-to-prCollapse a bare Probability helper to the standard Pr operator.physics/sine-to-sinCollapse a bare sine helper to the standard sin operator.physics/trace-capital-to-TrCollapse a bare Trace with no following argument group to the local Tr anchor.physics/trace-to-trCollapse a bare trace with no following argument group to the local tr anchor.physics/named-fn-paren-expandExpand physics power and auto-sized parenthesis arguments of standard named functions.physics/named-fn-to-operatornameRewrite physics-only named functions to operatorname and expand their auto-sized arguments.physics/rank-to-operatorname-rankRewrite rank to an explicit operatorname form instead of a package-local alias.
Notes#
Semantics follow LaTeX physics.sty 1.3. These names use \opbraces (g o d()): only the first of \exp{...}, \exp[...], \exp(...) and the matching forms of \det and \Pr becomes an auto-sized fence; later brackets or parentheses stay literal. The physics records hold that first group as one paired d<(,)><[,]><{,}> slot, so the parser attaches it, matching nested delimiters as xparse does, and a group that separates the name from the delimiter, as in {\exp}(x), keeps the delimiter literal. The rule leaves unchanged a bare name and a command that carries scripts (\det_A(x)); an unclosed delimiter is a parse error, as in LaTeX. Touches-only convergence: every Applied removes one physics operator with an attached argument (the argument becomes a \left...\right fence); non-matching nodes return Skipped. Only the physics records of these names carry that slot, so enabled_by_packages derives to physics and the rule key belongs to physics; a base-only context keeps \exp(x) unchanged. Fidelity is reading: physics closes the fence inside \mathopen{}\mathclose\bgroup...\egroup, which acts as a closing atom, while an explicit \left...\right fence is an inner atom. The explicit fence therefore adds about 1/6 em before the opening delimiter and another 1/6 em after the fence when an ordinary atom or an opening delimiter follows, about 1/3 em in the worst case; script styles show no difference. No compensating space is inserted. MathJax differs: MathJax physics hides the braces of \exp{...} and prints \exp[...] literally, while LaTeX shows auto-sized braces and brackets. In display style, LaTeX places the scripts of \det_A and \Pr_X below the operator and MathJax places them beside it; the rule does not rewrite these scripted commands.
Disable this rule#
TransformEngine(profile="corpus", disable_rules=["physics/physics-operator-fence-expand"])new TransformEngine({ profile: 'corpus', disableRules: ['physics/physics-operator-fence-expand'] })