# ams/operatorname-to-named-function

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

https://texform.dev/rules/ams/operatorname-to-named-function

## Metadata

| Field | Value |
| --- | --- |
| Key | ams/operatorname-to-named-function |
| Level | authoring |
| Fidelity | render |
| Enabled by packages | ams |
| Profiles | Authoring, Faithful, Corpus, Equiv |

## Rewrite patterns

### unstarred-named-function

From:

```latex
\operatorname{#1}
```

To:

```latex
\#1
```

### starred-named-operator

From:

```latex
\operatorname*{#1}
```

To:

```latex
\#1
```

## Examples

Examples show the rule in isolation, not a complete normalization profile.

### Unstarred arccos

Before:

```latex
\operatorname{arccos} x
```

After this rule:

```latex
\arccos x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred arcsin

Before:

```latex
\operatorname{arcsin} x
```

After this rule:

```latex
\arcsin x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred arctan

Before:

```latex
\operatorname{arctan} x
```

After this rule:

```latex
\arctan x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred arg

Before:

```latex
\operatorname{arg} x
```

After this rule:

```latex
\arg x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred cos

Before:

```latex
\operatorname{cos} x
```

After this rule:

```latex
\cos x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred cosh

Before:

```latex
\operatorname{cosh} x
```

After this rule:

```latex
\cosh x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred cot

Before:

```latex
\operatorname{cot} x
```

After this rule:

```latex
\cot x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred coth

Before:

```latex
\operatorname{coth} x
```

After this rule:

```latex
\coth x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred csc

Before:

```latex
\operatorname{csc} x
```

After this rule:

```latex
\csc x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred deg

Before:

```latex
\operatorname{deg} x
```

After this rule:

```latex
\deg x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred dim

Before:

```latex
\operatorname{dim} x
```

After this rule:

```latex
\dim x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred exp

Before:

```latex
\operatorname{exp} x
```

After this rule:

```latex
\exp x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred hom

Before:

```latex
\operatorname{hom} x
```

After this rule:

```latex
\hom x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred ker

Before:

```latex
\operatorname{ker} x
```

After this rule:

```latex
\ker x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred lg

Before:

```latex
\operatorname{lg} x
```

After this rule:

```latex
\lg x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred ln

Before:

```latex
\operatorname{ln} x
```

After this rule:

```latex
\ln x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred log

Before:

```latex
\operatorname{log} x
```

After this rule:

```latex
\log x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred sec

Before:

```latex
\operatorname{sec} x
```

After this rule:

```latex
\sec x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred sin

Before:

```latex
\operatorname{sin} x
```

After this rule:

```latex
\sin x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred sinh

Before:

```latex
\operatorname{sinh} x
```

After this rule:

```latex
\sinh x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred tan

Before:

```latex
\operatorname{tan} x
```

After this rule:

```latex
\tan x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred tanh

Before:

```latex
\operatorname{tanh} x
```

After this rule:

```latex
\tanh x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Starred det

Before:

```latex
\operatorname*{det}_{x}
```

After this rule:

```latex
\det_{x}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Starred gcd

Before:

```latex
\operatorname*{gcd}_{x}
```

After this rule:

```latex
\gcd_{x}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Starred inf

Before:

```latex
\operatorname*{inf}_{x}
```

After this rule:

```latex
\inf_{x}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Starred lim

Before:

```latex
\operatorname*{lim}_{x}
```

After this rule:

```latex
\lim_{x}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Starred max

Before:

```latex
\operatorname*{max}_{x}
```

After this rule:

```latex
\max_{x}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Starred min

Before:

```latex
\operatorname*{min}_{x}
```

After this rule:

```latex
\min_{x}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Starred pr

Before:

```latex
\operatorname*{Pr}_{x}
```

After this rule:

```latex
\Pr_{x}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Starred sup

Before:

```latex
\operatorname*{sup}_{x}
```

After this rule:

```latex
\sup_{x}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Starred named function preserved

Before:

```latex
\operatorname*{ln}_{n}
```

After this rule:

```latex
\operatorname*{ln}_{n}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred named operator preserved

Before:

```latex
\operatorname{lim}_{n}
```

After this rule:

```latex
\operatorname{lim}_{n}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unknown name preserved

Before:

```latex
\operatorname{rank} A
```

After this rule:

```latex
\operatorname{rank} A
```

Packages: base, ams.

Rendering verified with the declared packages.

### Nested group preserved

Before:

```latex
\operatorname{{ln}} x
```

After this rule:

```latex
\operatorname{{ln}} x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Explicit spacing preserved

Before:

```latex
\operatorname{l\,n} x
```

After this rule:

```latex
\operatorname{l\,n} x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Non ascii preserved

Before:

```latex
\operatorname{λ} x
```

After this rule:

```latex
\operatorname{λ} x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Bare limits preserved

Before:

```latex
\operatorname{ln}\limits x
```

After this rule:

```latex
\operatorname{ln}\limits x
```

Packages: base, ams.

Rendering verified with the declared packages.

### Scripted limits preserved

Before:

```latex
\operatorname{ln}\limits_{n}
```

After this rule:

```latex
\operatorname{ln}\limits_{n}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Unstarred nolimits rewritten

Before:

```latex
\operatorname{ln}\nolimits_{n}
```

After this rule:

```latex
\ln\nolimits_{n}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Starred limits rewritten

Before:

```latex
\operatorname*{lim}\limits_{n}
```

After this rule:

```latex
\lim\limits_{n}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Starred nolimits rewritten

Before:

```latex
\operatorname*{max}\nolimits_{n}
```

After this rule:

```latex
\max\nolimits_{n}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Spaced liminf preserved

Before:

```latex
\operatorname*{liminf}_{n}
```

After this rule:

```latex
\operatorname*{liminf}_{n}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Spaced limsup preserved

Before:

```latex
\operatorname*{limsup}_{n}
```

After this rule:

```latex
\operatorname*{limsup}_{n}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Spaced injlim preserved

Before:

```latex
\operatorname*{injlim}_{n}
```

After this rule:

```latex
\operatorname*{injlim}_{n}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Spaced projlim preserved

Before:

```latex
\operatorname*{projlim}_{n}
```

After this rule:

```latex
\operatorname*{projlim}_{n}
```

Packages: base, ams.

Rendering verified with the declared packages.

### Physics optional argument collision preserved

Before:

```latex
\operatorname{sin}[2]x
```

After this rule:

```latex
\operatorname{sin}[2]x
```

Packages: base, ams, physics.

Rendering verified with the declared packages.

### Physics expression collision preserved

Before:

```latex
\operatorname{exp}(\frac12)
```

After this rule:

```latex
\operatorname{exp}(\frac12)
```

Packages: base, ams, physics.

Rendering verified with the declared packages.

### Physics base named function rewritten

Before:

```latex
\operatorname{arg}x
```

After this rule:

```latex
\arg x
```

Packages: base, ams, physics.

Rendering verified with the declared packages.

### Physics det collision preserved

Before:

```latex
\operatorname*{det}_{n}
```

After this rule:

```latex
\operatorname*{det}_{n}
```

Packages: base, ams, physics.

Rendering verified with the declared packages.

### Physics pr collision preserved

Before:

```latex
\operatorname*{Pr}_{n}
```

After this rule:

```latex
\operatorname*{Pr}_{n}
```

Packages: base, ams, physics.

Rendering verified with the declared packages.

### Physics base named operator rewritten

Before:

```latex
\operatorname*{lim}_{n}
```

After this rule:

```latex
\lim_{n}
```

Packages: base, ams, physics.

Rendering verified with the declared packages.

## Triggers

- [\\operatorname](https://texform.dev/latex/commands/operatorname)

## Produces

- [\\arccos](https://texform.dev/latex/commands/arccos)
- [\\arcsin](https://texform.dev/latex/commands/arcsin)
- [\\arctan](https://texform.dev/latex/commands/arctan)
- [\\arg](https://texform.dev/latex/commands/arg)
- [\\cos](https://texform.dev/latex/commands/cos)
- [\\cosh](https://texform.dev/latex/commands/cosh)
- [\\cot](https://texform.dev/latex/commands/cot)
- [\\coth](https://texform.dev/latex/commands/coth)
- [\\csc](https://texform.dev/latex/commands/csc)
- [\\deg](https://texform.dev/latex/commands/deg)
- [\\dim](https://texform.dev/latex/commands/dim)
- [\\exp](https://texform.dev/latex/commands/exp)
- [\\hom](https://texform.dev/latex/commands/hom)
- [\\ker](https://texform.dev/latex/commands/ker)
- [\\lg](https://texform.dev/latex/commands/lg)
- [\\ln](https://texform.dev/latex/commands/ln)
- [\\log](https://texform.dev/latex/commands/log)
- [\\sec](https://texform.dev/latex/commands/sec)
- [\\sin](https://texform.dev/latex/commands/sin)
- [\\sinh](https://texform.dev/latex/commands/sinh)
- [\\tan](https://texform.dev/latex/commands/tan)
- [\\tanh](https://texform.dev/latex/commands/tanh)
- [\\det](https://texform.dev/latex/commands/det)
- [\\gcd](https://texform.dev/latex/commands/gcd)
- [\\inf](https://texform.dev/latex/commands/inf)
- [\\lim](https://texform.dev/latex/commands/lim)
- [\\max](https://texform.dev/latex/commands/max)
- [\\min](https://texform.dev/latex/commands/min)
- [\\Pr](https://texform.dev/latex/commands/Pr)
- [\\sup](https://texform.dev/latex/commands/sup)

## Touches

- [\\operatorname](https://texform.dev/latex/commands/operatorname)

## Upstream

- [physics/named-fn-to-operatorname](https://texform.dev/rules/physics/named-fn-to-operatorname): Rewrite physics-only named functions to operatorname and expand their auto-sized arguments.
- [physics/rank-to-operatorname-rank](https://texform.dev/rules/physics/rank-to-operatorname-rank): Rewrite rank to an explicit operatorname form instead of a package-local alias.

## Downstream

- [physics/named-fn-paren-expand](https://texform.dev/rules/physics/named-fn-paren-expand): Expand physics power and auto-sized parenthesis arguments of standard named functions.
- [physics/physics-operator-fence-expand](https://texform.dev/rules/physics/physics-operator-fence-expand): Expand the physics auto-sized argument of exp, det, and Pr into an explicit fence.

## Same family

- [ams/idotsint-expand](https://texform.dev/rules/ams/idotsint-expand): Expand idotsint to explicit repeated integral surfaces.
- [base/limits-drop](https://texform.dev/rules/base/limits-drop): Drop explicit limits from an audited operator while preserving attached scripts.
- [base/nolimits-drop](https://texform.dev/rules/base/nolimits-drop): Drop explicit nolimits from an audited operator while preserving attached scripts.
- [physics/cosine-to-cos](https://texform.dev/rules/physics/cosine-to-cos): Collapse a bare cosine helper to the standard cos operator.
- [physics/naturallogarithm-to-ln](https://texform.dev/rules/physics/naturallogarithm-to-ln): Collapse a bare natural logarithm helper to the standard ln operator.
- [physics/probability-to-pr](https://texform.dev/rules/physics/probability-to-pr): Collapse a bare Probability helper to the standard Pr operator.
- [physics/sine-to-sin](https://texform.dev/rules/physics/sine-to-sin): Collapse a bare sine helper to the standard sin operator.
- [physics/trace-capital-to-Tr](https://texform.dev/rules/physics/trace-capital-to-Tr): Collapse a bare Trace with no following argument group to the local Tr anchor.
- [physics/trace-to-tr](https://texform.dev/rules/physics/trace-to-tr): Collapse a bare trace with no following argument group to the local tr anchor.
- [physics/named-fn-paren-expand](https://texform.dev/rules/physics/named-fn-paren-expand): Expand physics power and auto-sized parenthesis arguments of standard named functions.
- [physics/named-fn-to-operatorname](https://texform.dev/rules/physics/named-fn-to-operatorname): Rewrite physics-only named functions to operatorname and expand their auto-sized arguments.
- [physics/physics-operator-fence-expand](https://texform.dev/rules/physics/physics-operator-fence-expand): Expand the physics auto-sized argument of exp, det, and Pr into an explicit fence.
- [physics/rank-to-operatorname-rank](https://texform.dev/rules/physics/rank-to-operatorname-rank): Rewrite rank to an explicit operatorname form instead of a package-local alias.

## 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

```python
TransformEngine(profile="corpus", disable_rules=["ams/operatorname-to-named-function"])
```

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

[Open in Playground](https://play.texform.dev/?input=%5Coperatorname%7Barccos%7D+x)
