I am trying to make a pair of angle brackets of variable height enclosing a main box along with a box beneath each bracket and an arrow of variable length between these lower boxes. Since I'm sure that's extremely unclear, here are two hand-drawn (and a little crooked) examples of what I mean:

With my limited skills, here is the code I managed to produce:

\newcommand{\imfun}[3]{\underset{#1 \;-\hspace{-.1in} \hfill \rightarrow \; #3}{\sbox0{$#2$}

The three arguments are the three content boxes: lower left, main, and lower right. In this implementation, the angle brackets do not change height gracefully and no attempt has been made to connect the head of the arrow to the tail.

I certainly appreciate any help you can offer!

  • 2
    nice question. Welcome to TeX.SX! Jul 5, 2013 at 21:01
  • 1
    If you use $\left\langle$ and $\right\rangle$ instead of the respective variants with \Bigg, then the brackets should scale with the content inside of them. The LaTeX Wikibook entry on delimiters might be helpful.
    – Adam Liter
    Jul 5, 2013 at 21:44
  • @Adam Good tip! A little stress test shows that the brackets have a maximum height that way, however. Jul 5, 2013 at 21:54

3 Answers 3


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:



  % #1: math style (\displaystyle, \textstyle, ...)
  % #2: environment body
      % \fboxsep=0pt\fboxrule=.1pt \fbox{\copy0 }%
      \copy0 %
    \kern\wd8 %
    \hbox to \dimexpr\wd0+.5\wd4+.5\wd6-\dimen0\relax{%
      \copy4 %
      $}% shortest arrow with spacing
      \copy6 %
  % #1%

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


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 \amatrixarrow@style to:



Remarks (for the more experienced):

  • The environment amatrixarrow catches its body by amsmath's \collect@body. 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:


\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);


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.



  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]

  bc-ad \& bb-aa \& ca+bd \\
  0 \& b-a \& 0 \\
  0 \& 2a \& 0 \\

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

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .