# \|

Used as a no-argument double-bar token, especially inside braket expressions such as \Braket{a\|b}, and otherwise as the standard \| delimiter command.

https://texform.dev/latex/commands/-7c-

## Metadata

| Field | Value |
| --- | --- |
| Topic | [Physics: bra-ket](https://texform.dev/latex/topics/physics-braket) |
| Packages | braket |
| Allowed mode | math |
| Tags |  |
| Commonality | medium |
| Kind | prefix |

## Syntax

### braket

Argument specification: ``

Used as a no-argument double-bar token, especially inside braket expressions such as \Braket{a\|b}, and otherwise as the standard \| delimiter command.

## Common tasks

### How to write a mid-bar in Dirac notation

In the braket package, \| is the command-page bar, not the bare | character.

```latex
\bra{\psi}\|\ket{\phi}
```

[Open in Playground](https://play.texform.dev/?input=%5Cbra%7B%5Cpsi%7D%5C%7C%5Cket%7B%5Cphi%7D)

### How to write a projector with a braket bar

```latex
\ket{\psi}\|\bra{\psi}
```

[Open in Playground](https://play.texform.dev/?input=%5Cket%7B%5Cpsi%7D%5C%7C%5Cbra%7B%5Cpsi%7D)

### How to write a standalone braket bar

```latex
\psi\|\phi
```

[Open in Playground](https://play.texform.dev/?input=%5Cpsi%5C%7C%5Cphi)

## Examples

```latex
\|
```

[Open in Playground](https://play.texform.dev/?input=%5C%7C)

```latex
\Braket{a\|b}
```

[Open in Playground](https://play.texform.dev/?input=%5CBraket%7Ba%5C%7Cb%7D)

## Renderer support

| Package | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- |
| braket | full | full | full |

## Usage frequency

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

## In TeXForm

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

## See also

- [\\|](https://texform.dev/latex/symbols/-7c-)

## Test cases

### braket

| Input | Case | MathJax | KaTeX | XeTeX |
| --- | --- | --- | --- | --- |
| \\| | Positive: baseline | Pass | Pass | Pass |
