Rewrite Rulesphysics/probability-to-pr

physics/probability-to-pr

Collapse a bare Probability helper to the standard Pr operator.

Rewrite patterns#

  1. bare\Probability\Pr

Examples#

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

Probability event#

Before

\Probability A=\frac{1}{2}

After this rule

\Pr A=\frac{1}{2}

Rendering verified with the declared packages.

Downstream rules#

Same family#

Notes#

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

Open in Playground