*over*and

*under*things:

- $\overbrace{[x_1,\dots,x_n]}$ [\overbrace{[x_1,\dots,x_n]}];
- $\underbrace{[x_1,\dots,x_n]}$ [\underbrace{[x_1,\dots,x_n]}].

Fortunately, something pointed me in the direction of the PGF/TiKZ package, which I've used in the past for doing drawings. It's an incredible tool in terms of both what it can do and the outstanding quality of its manual. Because it does so many things, I've never really gotten to know all its capabilities, and in particular its ability to do matrices in a picture environment.

Here is the code to do my illustration. You need to load the TiKZ package and two of its libraries in your document preamble, as follows:

\usepackage{tikz} \usetikzlibrary{matrix, decorations.pathreplacing}

The code for the drawing is:

\begin{tikzpicture} \matrix (vec) [matrix of math nodes, left delimiter = {[}, right delimiter = {]}] { f_1 \\ \vdots \\ f_{a} \\ f_{a + 1} \\ \vdots \\ f_{b} \\ f_{b + 1} \\ \vdots \\ f_{c} \\ }; \node (a) at (vec-1-1.north) [right=20pt]{}; \node (b) at (vec-3-1.south) [right=20pt]{}; \node (c) at (vec-4-1.north) [right=20pt]{}; \node (d) at (vec-6-1.south) [right=20pt]{}; \node (e) at (vec-7-1.north) [right=20pt]{}; \node (f) at (vec-9-1.south) [right=20pt]{}; \draw [decorate, decoration={brace, amplitude=10pt}] (a) -- (b) node[midway, right=10pt] {\footnotesize something}; \draw [decorate, decoration={brace, amplitude=10pt}] (c) -- (d) node[midway, right=10pt] {\footnotesize something else}; \draw [decorate, decoration={brace, amplitude=10pt}] (e) -- (f) node[midway, right=10pt] {\footnotesize something silly}; \end{tikzpicture}

The name of the matrix ("vec") is arbitrary. The amplitude for the brace (10pt) and the offsets (10pt and 20pt) are matters of taste.

If you happen to know a faster way of doing this, please do share in a comment.

I've been looking for this, but had a similar experience to yours. So I just transposed the matrix and used underbraces.

ReplyDeleteYou know, it never occurred to me to do that. That's definitely much simpler, although fitting it without line wrapping might get tricky in some cases.

DeleteIt's also reassuring to know that I'm not the only one who couldn't find the equivalent of underbraces for the side margins. :-)