# \bf

Changes the font of subsequent characters in the current group to bold.

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

## 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 | high |
| Kind | declarative |

## Syntax

### base

Argument specification: ``

Changes the font of subsequent characters in the current group to bold.

### textmacros

Argument specification: ``

Legacy declaration that switches following text to bold styling until the current group ends.

## Common tasks

### How to switch a short run into bold math

{\bf ...} is a legacy switch; prefer \mathbf for new writing.

```latex
{\bf x} = {\bf A}{\bf v}
```

[Open in Playground](https://play.texform.dev/?input=%7B%5Cbf+x%7D+%3D+%7B%5Cbf+A%7D%7B%5Cbf+v%7D)

### How to bold only one identifier

```latex
{\bf F} = m{\bf a}
```

[Open in Playground](https://play.texform.dev/?input=%7B%5Cbf+F%7D+%3D+m%7B%5Cbf+a%7D)

## Examples

```latex
x \bf y
```

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

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

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

```latex
\text{\bf x}
```

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

## Package variants

| Package | Argument specification | Allowed mode | Description |
| --- | --- | --- | --- |
| base |  | math | Changes the font of subsequent characters in the current group to bold. |
| textmacros |  | text | Legacy declaration that switches following text to bold styling until the current group ends. |

## Renderer support

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

## Usage frequency

2.17% of formulas in the measured corpus contain this entry, rank 26 of 263 entries with frequency data.

## In TeXForm

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

### Discouraged in base

Legacy declaration-style font switch; modern LaTeX usage prefers scoped commands like \mathbf.

```latex
{\bf $1} -> \mathbf{$1}
```

\mathbf is the standard LaTeX argument-scoped bold math alphabet command and avoids the legacy declaration semantics of \bf.

### Discouraged in textmacros

\bf is an old font switch retained mainly for compatibility; modern LaTeX recommends NFSS declarations or text commands instead.

```latex
{\bf ...} -> {\bfseries ...}
```

\bfseries is the LaTeX2e boldface declaration that replaces the deprecated two-letter switch.

```latex
\bf ... -> \textbf{...}
```

\textbf gives explicit scope and is the standard LaTeX2e command for bold text.

## Equivalent forms

```latex
\textbf{...}
```

approximate. \textbf is a command with arguments, whereas \bf is declarative.

```latex
{\bfseries ...}
```

exact. 

## See also

- [\\cal](https://texform.dev/latex/commands/cal)
- [\\it](https://texform.dev/latex/commands/it)
- [\\mit](https://texform.dev/latex/commands/mit)
- [\\oldstyle](https://texform.dev/latex/commands/oldstyle)
- [\\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 |
| --- | --- | --- | --- | --- |
| {\bf a} | Positive: baseline | Pass | Pass | Pass |

### textmacros

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