# \oldstyle

Changes the font of subsequent numerals in the current group to oldstyle.

https://texform.dev/latex/commands/oldstyle

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Fonts and styles](https://texform.dev/latex/topics/fonts-styles) |
| Packages | base, textmacros |
| Allowed mode | math, text |
| Tags | presentation, discouraged |
| Commonality | low |
| Kind | declarative |

## Syntax

### base

Argument specification: ``

Changes the font of subsequent numerals in the current group to oldstyle.

### textmacros

Argument specification: ``

Legacy declaration that switches following text to oldstyle numerals or the corresponding oldstyle variant until the current group ends.

## Examples

```latex
x \oldstyle y
```

[Open in Playground](https://play.texform.dev/?input=x+%5Coldstyle+y)

```latex
{x \oldstyle y} z
```

[Open in Playground](https://play.texform.dev/?input=%7Bx+%5Coldstyle+y%7D+z)

```latex
\text{\oldstyle 1}
```

[Open in Playground](https://play.texform.dev/?input=%5Ctext%7B%5Coldstyle+1%7D)

## Package variants

| Package | Argument specification | Allowed mode | Description |
| --- | --- | --- | --- |
| base |  | math | Changes the font of subsequent numerals in the current group to oldstyle. |
| textmacros |  | text | Legacy declaration that switches following text to oldstyle numerals or the corresponding oldstyle variant until the current group ends. |

## Renderer support

| Package | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- |
| base | full | none | none |
| textmacros | full | none | none |

## In TeXForm

TeXForm parses this entry as declarative syntax; the package determines its argument specification.

### Discouraged in base

The Plain TeX command \oldstyle is obsolete in LaTeX2e.

```latex
\oldstylenums{$1}
```

Modern LaTeX2e semantic command for oldstyle numerals.

### Discouraged in textmacros

Obsolete plain TeX font command discouraged in LaTeX2e. Does not support modern NFSS font selection.

```latex
\oldstylenums{$1}
```

Modern LaTeX2e command that respects current font properties and provides proper scoping.

## Equivalent forms

```latex
\oldstylenums{#1}
```

approximate. Prefix command alternative

```latex
\oldstylenums{...}
```

approximate. \oldstylenums is a command with arguments, whereas \oldstyle is declarative.

## See also

- [\\bf](https://texform.dev/latex/commands/bf)
- [\\cal](https://texform.dev/latex/commands/cal)
- [\\it](https://texform.dev/latex/commands/it)
- [\\mit](https://texform.dev/latex/commands/mit)
- [\\rm](https://texform.dev/latex/commands/rm)
- [\\sf](https://texform.dev/latex/commands/sf)
- [\\tt](https://texform.dev/latex/commands/tt)

## Test cases

### base

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| {\oldstyle a} | Positive: baseline | Pass | Fail | Fail |

### textmacros

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| {\oldstyle a} | Positive: baseline | Pass | Fail | Fail |
