summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex')
-rw-r--r--Master/texmf-dist/tex/latex/ltxmisc/braket.sty31
1 files changed, 20 insertions, 11 deletions
diff --git a/Master/texmf-dist/tex/latex/ltxmisc/braket.sty b/Master/texmf-dist/tex/latex/ltxmisc/braket.sty
index 5d777b9fba0..b3f338847a5 100644
--- a/Master/texmf-dist/tex/latex/ltxmisc/braket.sty
+++ b/Master/texmf-dist/tex/latex/ltxmisc/braket.sty
@@ -1,5 +1,5 @@
% braket.sty Macros for Dirac bra-ket <|> notation and sets {|}
-% Donald Arseneau asnd@triumf.ca Last modified 05-May-2005.
+% Donald Arseneau asnd@triumf.ca Last modified 12-Sept-2006.
% This is free, unencumbered, unsupported software.
%
% Commands defined are:
@@ -26,20 +26,24 @@
% Because each definition is so small, it makes no sense to have a
% complicated generic version for many bracket styles. Instead,
% you can just copy the definitions and change \langle or \rangle,
-% < and > to what you like.
+% to what you like.
%
\def\bra#1{\mathinner{\langle{#1}|}}
\def\ket#1{\mathinner{|{#1}\rangle}}
\def\braket#1{\mathinner{\langle{#1}\rangle}}
-\def\Bra#1{\left<#1\right|}
-\def\Ket#1{\left|#1\right>}
-{\catcode`\|=\active
- \gdef\Braket#1{\begingroup
+\def\Bra#1{\left\langle#1\right|}
+\def\Ket#1{\left|#1\right\rangle}
+%
+\let\protect\relax
+%
+{\catcode`\|=\active
+ \xdef\Braket{\protect\expandafter\noexpand\csname Braket \endcsname}
+ \expandafter\gdef\csname Braket \endcsname#1{\begingroup
\ifx\SavedDoubleVert\relax
\let\SavedDoubleVert\|\let\|\BraDoubleVert
\fi
\mathcode`\|32768\let|\BraVert
- \left<{#1}\right>\endgroup}
+ \left\langle{#1}\right\rangle\endgroup}
}
\def\BraVert{\@ifnextchar|{\|\@gobble}% turn || into \|
{\egroup\,\mid@vertical\,\bgroup}}
@@ -48,15 +52,18 @@
% The \mid@vertical is \vrule with ordinary TeX but \middle| in eTeX.
% We always avoid a \mathchoice in making the inner vertical lines.
-% Note that \right>, prints the same as \right\rangle but is faster.
+% Note that \right\rangle is used now due to a failing in fourier.sty.
%
% \def\ketbra#1#2{\ket{#1}\bra{#2}}
-% \def\Ketbra#1#2{\left|{#1}\vphantom{#2}\right>\left<{#2}\vphantom{#1}\right|}
+% \def\Ketbra#1#2{\left|{#1}\vphantom{#2}\right\rangle\left\langle{#2}\vphantom{#1}\right|}
% \Set{...|...} Only the first | is treated specially.
{\catcode`\|=\active
- \gdef\set#1{\mathinner{\lbrace\,{\mathcode`\|32768\let|\midvert #1}\,\rbrace}}
- \gdef\Set#1{\left\{
+ \xdef\set{\protect\expandafter\noexpand\csname set \endcsname}
+ \expandafter\gdef\csname set \endcsname#1{\mathinner
+ {\lbrace\,{\mathcode`\|32768\let|\midvert #1}\,\rbrace}}
+ \xdef\Set{\protect\expandafter\noexpand\csname Set \endcsname}
+ \expandafter\gdef\csname Set \endcsname#1{\left\{%
\ifx\SavedDoubleVert\relax \let\SavedDoubleVert\|\fi
\:{\let\|\SetDoubleVert
\mathcode`\|32768\let|\SetVert
@@ -82,3 +89,5 @@
\fi
% May 2005: Double verticals; tweak spacing.
+% June 2005: Make robust
+% Sept 2006: fourier