Angle brackets with an underset arrow

The following example centers the left and right annotation text below the delimiters
and puts an extensible arrow between. The example uses package amsmath and
defines the following environments:

  • Environment amatrix sets a matrix with angle brackets as delimiters, similar to environments bmatrix, pmatrix of package amsmath.
  • Environment amatrixarrow takes one optional and two mandatory arguments and sets
    the annotations below the matrix connected by an arrow.

    begin{amatrixarrow}[0.25ex]{left}{right} ... end{amatrixarrow}
    

    The optional argument specifies the distance between matrix and annotation. The default is 0.5ex of the annotation’s font size and can be overwritten by the
    optional argument.

Example file:

documentclass{article}
usepackage{amsmath}

makeatletter
newenvironment{amatrix}{%
  leftlangle
  [email protected]
}{%
  endmatrix
  rightrangle
}

newcommand{amatrixarrow}[3][.5ex]{%
  def[email protected]{#1}%
  def[email protected]{#2}%
  def[email protected]{#3}%
  [email protected][email protected]
}
newcommand*{[email protected]}[1]{%
  mathpalette{[email protected]}{#1}%
}
newcommand*{[email protected]}[2]{%
  % #1: math style (displaystyle, textstyle, ...)
  % #2: environment body
  sbox0{$[email protected]#1begin{amatrix}#2end{amatrix}$}%
  sbox2{$[email protected]#1begin{matrix}#2end{matrix}$}%
  sbox4{$[email protected]
    [email protected]{#1}%
    [email protected]
  $}%
  sbox6{$[email protected]
    [email protected]{#1}%
    [email protected]
  $}%
  sbox8{$[email protected][email protected]{#1}text{kern[email protected]}$}%
  dimen0=.5dimexprwd0-wd2relax
  vtop{%
    hbox{%
      kern.5dimexprwd4-dimen0relax
      % fboxsep=0ptfboxrule=.1pt fbox{copy0 }%
      copy0 %
    }%
    kernwd8 %
    nointerlineskip
    hbox to dimexprwd0+.5wd4+.5wd6-dimen0relax{%
      copy4 %
      hfill
      sbox2{$[email protected]
        [email protected]{#1}%
        {}xrightarrow{}{}%
      $}% shortest arrow with spacing
      $[email protected]
        [email protected]{#1}%
        xrightarrow{%
          kerndimexprwd0-.5wd4-.5wd6-dimen0-wd2relax
        }%
      $%
      hfill
      copy6 %
    }%
  }%
}
newcommand*{[email protected]}[1]{%
  ifx#1displaystyle
    scriptstyle
  elseifx#1textstyle
    scriptstyle
  else
    scriptscriptstyle
  fifi
  % #1%
}
%renewcommand*{[email protected]}[1]{#1}
makeatother

begin{document}
[
  {begin{amatrixarrow}[0ex]{2oplus 1oplus 1}{4oplus 2oplus 4}
    bc - ad & bb - aa & ca + bd \
    0       & b - a   & 0       \
    0       & 2a      & 0
  end{amatrixarrow}}
Rightarrow
  {begin{amatrixarrow}{3}{3oplus 3}
    abc - acb & abc - bac
  end{amatrixarrow}}
]
end{document}

Result

Variant without decreased font size for annotation

I think the annotation looks better in a smaller math style. But it is possible to keep the current math style by changing the definition of [email protected] to:

newcommand*{[email protected]}[1]{#1}

Result

Remarks (for the more experienced):

  • The environment amatrixarrow catches its body by amsmath‘s [email protected].
    Then the environment contents can be used twice, in a matrix without delimiters and in amatrix with angle brackets. The horizontal position for the
    annotations are calculated by comparing the widths of the two matrices.

  • By using vtop with the matrix as first element, the reference point of the matrix remains unchanged. The annotations just enlarge the depth of the whole construct.

  • mathpalette provides the current math style.
  • The reason for the optional parameter is, that it is not known, how many white space the matrix contains at the bottom. Internally the matrix is implemented using environment array that automatically adds invisible struts. The depth of the strut in the bottom line might increase the optical distance between the annotations and the bottom of the matrix, as seen in the first matrix of the example.

  • In the example the environment amatrixarrow is put in curly braces to protect it from the parent environment align*.

  • The arrow is drawn via xrightarrow with the spacing of the arrow as relational
    symbol.

This is not yet perfect but using tikzyou can do so:

documentclass{article}
usepackage{tikz}
usetikzlibrary{matrix,calc}
begin{document}

begin{tikzpicture}
matrix (m)[matrix of math nodes,left delimiter={langle},right delimiter={rangle}]
    {  A  & B  & C+1  \
       A' & B' &C' \ };
draw($(m.south west)-(0,0.1)$) node(a) {$x$};
draw($(m.south east)-(0,0.1)$) node(b) {$y$};
draw[->] (a)  edge (b);
end{tikzpicture}

end{document}

With result

enter image description here

A slight improvement over @yann.pequignot’s solution, using the label key to position texts under the backets. Note that since TikZ cannot make & given in the argument to an active character, & is used instead as a column separator.

documentclass{article}
usepackage{tikz}
usetikzlibrary{matrix}

begin{document}

newcommandimfun[3]{
begin{tikzpicture}
tikzset{
  every left delimiter/.style={
    xshift=1ex,label={[name=lb,label distance=-5pt,minimum height=2em]below:$#1$}
  },
  every right delimiter/.style={
    xshift=-1ex,label={[name=rb,label distance=-5pt,minimum height=2em]below:$#2$}
  }
}

matrix [ampersand replacement=&,matrix of math nodes,
left delimiter=langle,right delimiter=rangle]
{#3};
draw[->](lb)--(rb);
end{tikzpicture}
}

imfun{2oplus1oplus1}{4oplus2oplus4}{
  bc-ad & bb-aa & ca+bd \
  0 & b-a & 0 \
  0 & 2a & 0 \
}

imfun{3}{3oplus3}{abc-acb & abc-bac\}
end{document}

enter image description here