| 1 |
\documentclass[parskip=half, pagesize=auto, version=last]{scrartcl} |
| 2 |
|
| 3 |
\usepackage{fixltx2e} |
| 4 |
\usepackage{lmodern} |
| 5 |
\usepackage[T1]{fontenc} |
| 6 |
\usepackage{textcomp} |
| 7 |
\usepackage{array} |
| 8 |
\usepackage{braket} |
| 9 |
\usepackage{microtype} |
| 10 |
|
| 11 |
\addtokomafont{title}{\rmfamily} |
| 12 |
|
| 13 |
\title{The \textsf{braket} package} |
| 14 |
\subtitle{Macros for Dirac bra--ket $\langle\mid\rangle$ notation and sets $\lbrace\mid\rbrace$} |
| 15 |
\author{Donald Arseneau\\\texttt{[email protected]}} |
| 16 |
\date{12--Sept--2006} |
| 17 |
|
| 18 |
|
| 19 |
\begin{document} |
| 20 |
|
| 21 |
\maketitle |
| 22 |
|
| 23 |
Commands defined are: |
| 24 |
|
| 25 |
\begin{tabular}{@{}*{4}{>{\ttfamily\textbackslash}c<{\{~\}}}>{(}l<{~versions)}@{}} |
| 26 |
bra & ket & braket & set & small \\ |
| 27 |
Bra & Ket & Braket & Set & expanding |
| 28 |
\end{tabular} |
| 29 |
|
| 30 |
The ``small versions'' use fixed-size brackets independent of their |
| 31 |
contents, whereas the ``expanding versions'' make the brackets and |
| 32 |
vertical lines expand to envelop their contents (internally using |
| 33 |
the \verb+\left+ and \verb+\right+ commands). You should use the vertical bar |
| 34 |
character ``\verb+|+'' to input any extra vertical lines. In \verb+\Braket+ these |
| 35 |
vertical lines will expand to match the arguments, and in \verb+\Set+ the |
| 36 |
first vertical will expand. E.\,g., |
| 37 |
|
| 38 |
\begingroup |
| 39 |
\renewcommand*{\arraystretch}{1.7} |
| 40 |
\setlength{\tabcolsep}{10pt} |
| 41 |
\begin{tabular}{@{}>{\footnotesize}r>{$\displaystyle}l<{$}@{}} |
| 42 |
\verb+\Braket{ \phi | \frac{\partial^2}{\partial t^2} | \psi }+ & \Braket{ \phi | \frac{\partial^2}{\partial t^2} | \psi } \\ |
| 43 |
\verb+\Set{ x\in\mathbf{R}^2 | 0<{|x|}<5 }+ & \Set{ x\in\mathbf{R}^2 | 0<{|x|}<5 } \\ |
| 44 |
\end{tabular} |
| 45 |
\endgroup |
| 46 |
|
| 47 |
Likewise, you may make an expandable double-bar using either |
| 48 |
the ``\verb+\|+'' command or its local alias ``\verb+||+''. |
| 49 |
|
| 50 |
NOT defined is ``\verb+\ketbra+'' (for projection operators) because I prefer |
| 51 |
\verb+\ket{ } \bra{ }+. |
| 52 |
|
| 53 |
Because each definition is so small, it makes no sense to have a |
| 54 |
complicated generic version for many bracket styles. Instead, |
| 55 |
you can just copy the definitions and change \verb+\langle+ or \verb+\rangle+, |
| 56 |
to what you like. |
| 57 |
|
| 58 |
\end{document} |