[Tex/LaTex] newcommand for ket-bra

macros

How can create a \newcommand that be able generate:

|\phi\rangle\langle \psi|

However \ket{\phi}\bra{\psi} does that but we think that the distance between ket and bra in |\phi\rangle\langle \psi| is shorter than that of \ket{\phi}\bra{\psi}.

Best Answer

Use the braket package:

\documentclass{article}
\usepackage{braket}

\begin{document}

$\braket{\varphi|\psi}$

$\bra{\varphi}$

$\ket{\psi}$

$\ket{\varphi}\bra{\psi}$

\end{document}

enter image description here

Related Question