Rewrite Rulesphysics/sine-to-sin

physics/sine-to-sin

Collapse a bare sine helper to the standard sin operator.

Rewrite patterns#

  1. bare\sine\sin

Examples#

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

sine in trig sum#

Before

y=\sine x+\cos x

After this rule

y=\sin x+\cos x

Rendering verified with the declared packages.

sine scripted bare#

Before

\sine^2\theta

After this rule

\sin^2\theta

Rendering verified with the declared packages.

Downstream rules#

Same family#

Notes#

In LaTeX physics.sty 1.3, \sine is the original \sin saved with \let, a plain operator that grabs nothing, while the redefined \sin grabs a following [...] power and (...) argument. The rule renames only a bare \sine, one not followed by (, [, or a brace group; a \sine that carries scripts is bare. The renamed command gets the empty argument slots of the active \sin record. In faithful, named-fn-to-operatorname rewrites the skipped branches to \operatorname{sin} and keeps the delimiters literal. Touches-only convergence: every Applied removes one bare \sine; non-matching nodes return Skipped. The produced command and canonical reference use the physics record, which overrides the base definition whenever this rule is enabled.

Disable this rule#

TransformEngine(profile="corpus", disable_rules=["physics/sine-to-sin"])
new TransformEngine({ profile: 'corpus', disableRules: ['physics/sine-to-sin'] })

Open in Playground