# How to get double angle bracket without using MnSymbol package?

I tried the \llangle and \rrangle from the MnSymbol package, which is OK. But the package also changed other things which I do not want.

-

The following solution extract the code for \llangle and \rrangle from package MnSymbol. To avoid name clashes largesymbols is renamed to MnLargeSymbols. Using the font of MnSymbol, \left and \right are working with \llangle and \rrangle, because \left and \right are based on font level features.

\documentclass{article}

\makeatletter
\DeclareFontFamily{OMX}{MnSymbolE}{}
\DeclareSymbolFont{MnLargeSymbols}{OMX}{MnSymbolE}{m}{n}
\SetSymbolFont{MnLargeSymbols}{bold}{OMX}{MnSymbolE}{b}{n}
\DeclareFontShape{OMX}{MnSymbolE}{m}{n}{
<-6>  MnSymbolE5
<6-7>  MnSymbolE6
<7-8>  MnSymbolE7
<8-9>  MnSymbolE8
<9-10> MnSymbolE9
<10-12> MnSymbolE10
<12->   MnSymbolE12
}{}
\DeclareFontShape{OMX}{MnSymbolE}{b}{n}{
<-6>  MnSymbolE-Bold5
<6-7>  MnSymbolE-Bold6
<7-8>  MnSymbolE-Bold7
<8-9>  MnSymbolE-Bold8
<9-10> MnSymbolE-Bold9
<10-12> MnSymbolE-Bold10
<12->   MnSymbolE-Bold12
}{}

\let\llangle\@undefined
\let\rrangle\@undefined
\DeclareMathDelimiter{\llangle}{\mathopen}%
{MnLargeSymbols}{'164}{MnLargeSymbols}{'164}
\DeclareMathDelimiter{\rrangle}{\mathclose}%
{MnLargeSymbols}{'171}{MnLargeSymbols}{'171}
\makeatother

\begin{document}
$\llangle x,y\rrangle$
$\left\llangle \int_{0}^{\infty} \frac{\mathrm{d}x}{2} \right\rrangle$
\end{document}


-
@MvG It's just a typo, instead of "operators" "symbols" is meant, see updated answer. – Heiko Oberdiek Feb 20 at 11:07

You can build a suitable symbol by taking two ordinary brackets and placing them suitably close together. I guess your main problem is building symbols that can be used at larger sizes. Here is a partial solution:

\documentclass{article}

\makeatletter
\newsavebox{\@brx}
\newcommand{\llangle}[1][]{\savebox{\@brx}{$$\m@th{#1\langle}$$}%
\mathopen{\copy\@brx\kern-0.5\wd\@brx\usebox{\@brx}}}
\newcommand{\rrangle}[1][]{\savebox{\@brx}{$$\m@th{#1\rangle}$$}%
\mathclose{\copy\@brx\kern-0.5\wd\@brx\usebox{\@brx}}}
\makeatother

\begin{document}

$$\llangle x \rrangle$$

\begin{displaymath}
\llangle[\Bigg]{\int_X \nu^2}\rrangle[\Bigg]
\end{displaymath}
\end{document}


As the symbol built is not a genuine math delimiter to LaTeX you can not use the \left/\right commands or \big etc. in the usual way. So I have instead built commands that taking the size operators \big, \Big, \bigg,... as an argument.

It works by making a box with one copy of the delimiter (the \m@th command ensures that any math surround is cancelled in that process), printing a copy of that box (via \copy), backuping by0.5times its width and then printing the box again (this last time via\useboxto also discard its contents). You might want to adjust the factor0.5.

An alternative choice of spacing is to have a fixed space adjusted by a small amount of the width of the delimiter as in:

\documentclass{article}

\makeatletter
\newsavebox{\@brx}
\newcommand{\llangle}[1][]{\savebox{\@brx}{$$\m@th{#1\langle}$$}%
\mathopen{\copy\@brx\mkern2mu\kern-0.9\wd\@brx\usebox{\@brx}}}
\newcommand{\rrangle}[1][]{\savebox{\@brx}{$$\m@th{#1\rangle}$$}%
\mathclose{\copy\@brx\mkern2mu\kern-0.9\wd\@brx\usebox{\@brx}}}
\makeatother

\begin{document}

$$\llangle x \rrangle^{\llangle y \rrangle}$$

\begin{displaymath}
\llangle[\Bigg] \llangle[\bigg] \llangle[\Big] \llangle[\big] A
\rrangle[\big] \rrangle[\Big] \rrangle[\bigg] \rrangle[\Bigg]
\end{displaymath}
\end{document}


The idea of putting the size \big etc. in as argument is much like mathtools package's treatment of paired delimiters. It might be that code could be adapted to build commands that would also respect \left/\right`...

-
Thanks, the first method works and is simple! – Yan King Yin May 19 at 12:05