# newcommand for ket-bra

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}.

• \op{\phi}{\psi} from the physics package does this. – Troy Jan 25 '18 at 7:54

Use the braket package:

\documentclass{article}
\usepackage{braket}

\begin{document}

$\braket{\varphi|\psi}$

$\bra{\varphi}$

$\ket{\psi}$

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

\end{document}


try the command \ketbra{\phi}{\psi}, this should minimize the distance between the ket and the bra.

• Welcome to TeX.SE! Can you please add a screenshot of your result? (And no, I did not downvote!) – Mensch Jun 13 at 16:52