10

I would like to typeset the following matrix:

enter image description here

However, I don't know how to achieve the braces and the dots leading to the matrix entry.

2

2 Answers 2

31

Example:

\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{mleftright}

\begin{document}
\[
  \Phi =
  \begin{tabular}{@{}c@{}}
    \rotatebox[origin=c]{90}{$\scriptstyle\text{states}$}
  \end{tabular}
  \mleft\{
    \vphantom{%
      \begin{bmatrix}
        \vdots \\
        \phi_{iy} \\
        \vdots
      \end{bmatrix}
    }%
  \mright.\kern-\nulldelimiterspace
  j % \,
  \overbrace{%
    \mathop{%
      \!
      \begin{bmatrix}
        \vdots \\
        \cdots \phi_{iy} \hphantom{\cdots} \\
        \vphantom{\vdots}
      \end{bmatrix}
      \!
    }\limits^{\smash{\textstyle y}}
  }^{\text{aggr. states}}
\]
\end{document}

Result

Remarks:

  • The matrix is set using environment bmatrix of package amsmath that automatically sets the brackets.
  • \text of package amsmath (or amstext) sets text in text mode (automatically resized).
  • \mleft and \mright of package mleftright avoid the additional surrounding space of \left and \right.
  • \vphantom creates an emtpy box with width zero, but the height and depth of its argument. Thus the left brace only covers the matrix, not the stuff above.
  • \right. is an invisible right delimiter. TeX inserts the space \nulldelimiterspace, thus \kern-\nulldelimiterspace removes the space.
  • \begin{tabular}{@{}c@{}}...\end{tabular} is a trick to center the box around the math axis. (Internally \vcenter is used.)
  • The side bearings of the big left and right brackets are quite large. Thus the horizontal brace is a little wider than necessary (thanks Barbara Beeton for noticing). This is fixed by a negative space \! before and after the matrix. A \, could be inserted after j to keep the space to the matrix constant. But I have commented it, because a smaller distance looks better IMHO.
5
  • much better :-)
    – Red
    Aug 23, 2013 at 15:14
  • You solve the problem of the different size of the two labels with \scriptstyle command, can you what this command does?
    – Red
    Aug 23, 2013 at 15:17
  • @Red: The four math style commands control the size of math, the position of limits for math operators and so on. \displaystyle is used for displayed equations, \textstyle for inline math, but with the same sizes. The next smaller size is \scriptstyle, used in sub- and superscripts. In case of further nesting, \scriptscriptstyle is the smallest math style. Aug 23, 2013 at 15:23
  • the horizontal brace is a little wider than needed. probably owing to some built-in spacing around the brackets.. Aug 23, 2013 at 16:19
  • @barbarabeeton: Thanks, I have fixed it manually using \!. Aug 23, 2013 at 19:29
6
\documentclass{article}
\usepackage{amsmath}
\usepackage{graphicx} %for the \rotatebox command
\begin{document}
\[
\setbox0=\hbox{
    $\begin{array}{c}
        y\\
        j\begin{bmatrix}
            & \vdots &  \\
            \cdots & \Phi_{jy} & \\
            & &  \\
        \end{bmatrix}
    \end{array}$
}
\Phi = \text{\rotatebox[origin=c]{90}{states}}\left\{\vphantom{\usebox0}\right.\kern-\nulldelimiterspace\overbrace{\usebox0}^\text{aggr. states}
\]
\end{document}

enter image description here

2
  • The two labels appear to be slightly different font sizes. Aug 23, 2013 at 15:11
  • The 'y' is not aligned with the downward-facing ellipsis. Shouldn't the center line of the ellipsis be the same as the (horizontal) center of the y and the $\Phi_{i,j}$?
    – einpoklum
    Aug 23, 2013 at 21:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.