3

I'm trying to define a bra-ket command so that I can easily build things like:

\langle e^+ | \gamma^\mu | e^-\rangle

At the moment I have this:

\newcommand{\brak}[3]{
\langle #1 \| \gamma^{#2} \| #3 \rangle
}

but, when I have \brak(e^+, \mu, e^-) in an equation I get:

⟨e−,μ,e+∥γ
∥equation⟩

Any ideas?

  • 1
    There is the braket package which might save you some trouble – clemens Jun 14 '13 at 10:35
  • 1
    you could also use the physics-package which has \bra{} and \ket{} commands (and other useful stuff). – Peater de Xel Jun 14 '13 at 10:44
6

You should use

\brak{e^+}{\mu}{e^-}

There're 3 different arguments, you can't separate them by commas.

  • Ah great - my head was still in c++ mode! – JMzance Jun 14 '13 at 10:42
5

Just to show a version with build in scaling:

\documentclass[a4paper]{memoir}
\usepackage{mathtools}
\DeclarePairedDelimiterX\brak[3]\langle\rangle{%
#1 \delimsize\vert #2 \delimsize\vert #3}
\begin{document}

\[
\brak{e^+}{\mu}{e^-}
\qquad
\brak*{e^+}{\frac{\mu}{\sqrt{2}}}{e^-}
\qquad
\brak[\Big]{e^+}{\sum_i \mu_i }{e^-}
\]

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.