Rewrite Rulesams/operatorname-to-named-function

ams/operatorname-to-named-function

Rewrite plain operatorname arguments to equivalent base named-function or named-operator commands.

Rewrite patterns#

  1. unstarred-named-function\operatorname{#1}\#1
  2. starred-named-operator\operatorname*{#1}\#1

Examples#

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

Unstarred arccos#

Before

\operatorname{arccos} x

After this rule

\arccos x

Rendering verified with the declared packages.

Unstarred arcsin#

Before

\operatorname{arcsin} x

After this rule

\arcsin x

Rendering verified with the declared packages.

Unstarred arctan#

Before

\operatorname{arctan} x

After this rule

\arctan x

Rendering verified with the declared packages.

Unstarred arg#

Before

\operatorname{arg} x

After this rule

\arg x

Rendering verified with the declared packages.

Unstarred cos#

Before

\operatorname{cos} x

After this rule

\cos x

Rendering verified with the declared packages.

Unstarred cosh#

Before

\operatorname{cosh} x

After this rule

\cosh x

Rendering verified with the declared packages.

Remaining 45 examples#

Listed as LaTeX source. Hover over, focus, or tap a row to preview the rendering before and after. Each renders the same as its input with the declared packages.

ExampleBeforeAfter this rule
Unstarred cot\operatorname{cot} x\cot x
Unstarred coth\operatorname{coth} x\coth x
Unstarred csc\operatorname{csc} x\csc x
Unstarred deg\operatorname{deg} x\deg x
Unstarred dim\operatorname{dim} x\dim x
Unstarred exp\operatorname{exp} x\exp x
Unstarred hom\operatorname{hom} x\hom x
Unstarred ker\operatorname{ker} x\ker x
Unstarred lg\operatorname{lg} x\lg x
Unstarred ln\operatorname{ln} x\ln x
Unstarred log\operatorname{log} x\log x
Unstarred sec\operatorname{sec} x\sec x
Unstarred sin\operatorname{sin} x\sin x
Unstarred sinh\operatorname{sinh} x\sinh x
Unstarred tan\operatorname{tan} x\tan x
Unstarred tanh\operatorname{tanh} x\tanh x
Starred det\operatorname*{det}_{x}\det_{x}
Starred gcd\operatorname*{gcd}_{x}\gcd_{x}
Starred inf\operatorname*{inf}_{x}\inf_{x}
Starred lim\operatorname*{lim}_{x}\lim_{x}
Starred max\operatorname*{max}_{x}\max_{x}
Starred min\operatorname*{min}_{x}\min_{x}
Starred pr\operatorname*{Pr}_{x}\Pr_{x}
Starred sup\operatorname*{sup}_{x}\sup_{x}
Starred named function preserved\operatorname*{ln}_{n}\operatorname*{ln}_{n}
Unstarred named operator preserved\operatorname{lim}_{n}\operatorname{lim}_{n}
Unknown name preserved\operatorname{rank} A\operatorname{rank} A
Nested group preserved\operatorname{{ln}} x\operatorname{{ln}} x
Explicit spacing preserved\operatorname{l\,n} x\operatorname{l\,n} x
Non ascii preserved\operatorname{λ} x\operatorname{λ} x
Bare limits preserved\operatorname{ln}\limits x\operatorname{ln}\limits x
Scripted limits preserved\operatorname{ln}\limits_{n}\operatorname{ln}\limits_{n}
Unstarred nolimits rewritten\operatorname{ln}\nolimits_{n}\ln\nolimits_{n}
Starred limits rewritten\operatorname*{lim}\limits_{n}\lim\limits_{n}
Starred nolimits rewritten\operatorname*{max}\nolimits_{n}\max\nolimits_{n}
Spaced liminf preserved\operatorname*{liminf}_{n}\operatorname*{liminf}_{n}
Spaced limsup preserved\operatorname*{limsup}_{n}\operatorname*{limsup}_{n}
Spaced injlim preserved\operatorname*{injlim}_{n}\operatorname*{injlim}_{n}
Spaced projlim preserved\operatorname*{projlim}_{n}\operatorname*{projlim}_{n}
Physics optional argument collision preserved\operatorname{sin}[2]x\operatorname{sin}[2]x
Physics expression collision preserved\operatorname{exp}(\frac12)\operatorname{exp}(\frac12)
Physics base named function rewritten\operatorname{arg}x\arg x
Physics det collision preserved\operatorname*{det}_{n}\operatorname*{det}_{n}
Physics pr collision preserved\operatorname*{Pr}_{n}\operatorname*{Pr}_{n}
Physics base named operator rewritten\operatorname*{lim}_{n}\lim_{n}

Upstream rules#

Downstream rules#

Same family#

Notes#

The unstarred lookup is the exact case-sensitive set arccos/arcsin/arctan/arg/cos/cosh/cot/coth/csc/deg/dim/exp/hom/ker/lg/ln/log/sec/sin/sinh/tan/tanh. The starred lookup is det/gcd/inf/lim/max/min/Pr/sup. Both branches require the AMS operatorname source record and an exact contiguous ASCII OperatorNameContent subtree with no groups, styles, spacing, or other nodes. Unstarred NamedOp names, starred NamedFn names, unknown or complex content, and liminf/limsup/injlim/projlim remain unchanged. An unstarred source followed by bare or scripted limits also remains unchanged. Before replacement, the active target record must retain base ownership; physics or runtime overrides fail closed, including the physics optional-argument functions and det/exp/Pr collisions. Every Applied result replaces one eligible cmd:operatorname node with a named function or operator command; all preserved branches return Skipped, so the number of eligible cmd:operatorname nodes strictly decreases. A following limits modifier is only an eligibility probe and stays unchanged.

Disable this rule#

TransformEngine(profile="corpus", disable_rules=["ams/operatorname-to-named-function"])
new TransformEngine({ profile: 'corpus', disableRules: ['ams/operatorname-to-named-function'] })

Open in Playground