Re: New delimiter wanted: double left/right angle bracket



In article
<23b3ef75-539f-4faf-9121-23e958f1f82e@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Bernhard Enders <bgeneto@xxxxxxxxx> wrote:

Hi!

I would like to know how to define a new math delimiter, a double left
(and right) angle bracket: <<x>>. AFAIK these are available with
MnSymbol and nath packages, but, unfortunately, not with my desired
font. So I tried:

\newcommand*{\llangle}{\left\langle\kern-3\nulldelimiterspace\left
\langle}
\newcommand*{\rrangle}{\right\rangle\kern-3\nulldelimiterspace\right
\rangle}

But space between angle brackets are nonuniform (to say the least) for
different delimiter sizes, here is a simple test:

\[
\llangle x\rrangle % too tight
\llangle x^2\rrangle % good spacing
\llangle \sum_i x_i\rrangle % too much space
\]

So, how to create such a delimiter with consistent spacing?

Thanks,

Bernhard Enders.

Does this code do what you want? -Alan


\documentclass{article}

\makeatletter
\def\Left#1#2\Right{\begingroup%
\def\ts@r{\nulldelimiterspace=0pt \mathsurround=0pt}%
\let\@hat=#1%
\def\sht@im{#2}%
\def\@t{{\mathchoice{\def\@fen{\displaystyle}\k@fel}%
{\def\@fen{\textstyle}\k@fel}%
{\def\@fen{\scriptstyle}\k@fel}%
{\def\@fen{\scriptscriptstyle}\k@fel}}}%
\def\g@rin{\ts@r\left\@hat\vphantom{\sht@im}\right.}%
\def\k@fel{\setbox0=\hbox{$\@fen\g@rin$}\hbox{%
$\@fen \kern.3875\wd0 \copy0 \kern-.3875\wd0%
\llap{\copy0}\kern.3875\wd0$}}%
\def\pt@h{\mathopen\@t}\pt@h\sht@im%
\Right}%
\def\Right#1{\let\@hat=#1%
\def\st@m{\mathclose\@t}%
\st@m\endgroup}
\makeatother

\begin{document}

\[
\Left< x\Right> % too tight
\Left< x^2\Right> % good spacing
\Left< \sum_i x_i\Right> % too much space
\]
\end{document}

Cut and pasted from:

<http://groups.google.com/group/comp.text.tex/browse_thread/thread/2da193
f4ea1e8d3e/63788ec719053e7?q=\nulldelimiterspace+group:comp.text.tex#0637
88ec719053e7>
.