Rewrite Rulesphysics/naturallogarithm-to-ln

physics/naturallogarithm-to-ln

Collapse a bare natural logarithm helper to the standard ln operator.

Rewrite patterns#

  1. bare\naturallogarithm\ln

Examples#

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

naturallogarithm entropy#

Before

S=k_B\naturallogarithm W

After this rule

S=k_B\ln W

Rendering verified with the declared packages.

Downstream rules#

Same family#

Notes#

In LaTeX physics.sty 1.3, \naturallogarithm is the original \ln saved with \let, a plain operator that grabs nothing, while the redefined \ln grabs a following [...] power and (...) argument. The rule renames only a bare \naturallogarithm, one not followed by (, [, or a brace group; a \naturallogarithm that carries scripts is bare. The renamed command gets the empty argument slots of the active \ln record. In faithful, named-fn-to-operatorname rewrites the skipped branches to \operatorname{ln} and keeps the delimiters literal. Touches-only convergence: every Applied removes one bare \naturallogarithm; 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/naturallogarithm-to-ln"])
new TransformEngine({ profile: 'corpus', disableRules: ['physics/naturallogarithm-to-ln'] })

Open in Playground