In LyX, what is a quick way to insert mismatched delimiters in math environment?

I tried typing `\left|\right>`

, but it is not interpreted automatically.

Skip to content
# [Tex/LaTex] Lyx: Quick way to insert Dirac bra-ket

###### Related Question

bracketslyx

In LyX, what is a quick way to insert mismatched delimiters in math environment?

I tried typing `\left|\right>`

, but it is not interpreted automatically.

## Best Answer

There are at least three different ways one can write such brackets, using ERTs or the LyX GUI.

## 1. Use

`\left`

/`\right`

directlyTo be able to write

`\left|\right\rangle`

, you have to use ERTs, which you add with Insert --> TeX code orCtrl+L. Add an ERT for the`\left|`

, exit the ERT, for example by hitting the right arrow key, write the term that should be within the delimiters, then finally add another ERT for`\right\rangle`

.## 2. Braket

The

`braket`

package mentioned by cgnieder defines eight new commands,`\Bra`

,`\Ket`

,`\Braket`

and`\Set`

which uses`\left`

and`\right`

to stretch the delimiters, and similar commands all lowercase (`\bra`

,`\ket`

,`\braket`

,`\set`

), which doesn't have stretchable delimiters. See below for how it looks in LyX and the corresponding output.To use this in LyX you can do as follows:

Add the package to the document preamble. Under Document --> Properties --> LaTeX preamble write

`\usepackage{braket}`

.~~When in mathmode, add an ERT with~~(This isn't actually necessary.)Ctrl+L.Write the command you want to use. The second curly brace will be autocompleted when you type the first (at least in my copy of LyX).

## 3. GUI

The GUI-version is to click the

Insert delimiters-button on the math toolbar and uncheck "Keep matched".