Rewrite patterns#
- trig-paren
\sin(#1)\sin\left(#1\right) - trig-power-paren
\sin[#1](#2)\sin^{#1}\left(#2\right)
Examples#
Each example shows this rule applied in isolation. A complete normalization profile may make additional changes.
Trig paren nested#
The rendered result has pixel differences from the input.
Trig power paren#
The rendered result has pixel differences from the input.
Trig paren scripted close#
Rendering verified with the declared packages.
Trig 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/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/sine-to-sinCollapse a bare sine helper to the standard sin 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-to-operatornameRewrite physics-only named functions to operatorname and expand their auto-sized arguments.physics/physics-operator-fence-expandExpand the physics auto-sized argument of exp, det, and Pr into an explicit fence.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 \trigbraces (o d()): \sin[n](...), \sinh[n](...), \arcsin[n](...), \cos[n](...), \cosh[n](...), \arccos[n](...), \tan[n](...), \tanh[n](...), \arctan[n](...), \csc[n](...), \sec[n](...), \cot[n](...), \coth[n](...), \log[n](...), \ln[n](...) get a power and an auto-sized parenthesis fence, while \sin{...} grabs nothing. The physics records hold the parentheses as a d() slot, so the parser attaches them, matching nested parentheses as xparse does, and a group that separates the name from the parenthesis, as in {\sin}(x) or \sin{}(x), keeps it literal. The rule leaves unchanged a bare name, a command that carries scripts (\sin^2(x)), and \sin[n] without following parentheses, which LaTeX prints as a literal [n] and MathJax reads as a power. Touches-only convergence: every Applied removes one physics named function with an attached parenthesis argument (the group becomes a \left(...\right) fence and any power moves into a superscript); non-matching nodes return Skipped. enabled_by_packages is pinned to physics because the base records of these names have a different structure signature (no optional power or parenthesis slot), and the active record must come from physics at runtime. 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.
Disable this rule#
TransformEngine(profile="corpus", disable_rules=["physics/named-fn-paren-expand"])new TransformEngine({ profile: 'corpus', disableRules: ['physics/named-fn-paren-expand'] })