# Is it possible to define in LaTeX documents Latex Help

1. Aug 26, 2008

### Dragonfall

Is it possible to define in LaTeX documents something like \ket{X} to be \left| X\right> so I don't have to type that every time?

Last edited by a moderator: Oct 18, 2011
2. Aug 26, 2008

### cristo

Staff Emeritus
Re: Latex Help

If you put this in your preamble \newcommand{\ket}[1]{{\left| {#1} \right>}}, then you can use the command \ket{X}:

$$\newcommand{\ket}[1]{{\left| {#1} \right>}} \ket{X}$$

You can write similar commands for \bra and \braket, say.

3. Aug 26, 2008

### Dragonfall

Re: Latex Help

Awesome, thanks!