12

I would like to have braces on the left side of a table (either that or on the right side) and bellow the same table.

What I have got is

$
m-Mal 
\underbrace{
  \left\{\begin{tabular}{|l|l|l|l|}\hline
   1+1 & 1+2 & ... & 1+n \\ \hline
   2+1 & 2+2 & ... & 2+n \\ \hline
   ... & ... & ... & ... \\ \hline
   m+1 & m+2 & ... & m+n \\ \hline
   \end{tabular}
   }_{n-Mal}
$

But the problem is that the underbrace goes too much to the left:

image

Ideally, the \underbrace would end where the first column starts.

  • Welcome to TeX.sx! I added the image for you. – Torbjørn T. Dec 12 '12 at 21:39
  • Related: parenthesis around underbrace too big – Qrrbrbirlbel Dec 12 '12 at 22:13
  • 3
    German? Typographically and orthographically speaking, n\text{-mal} would be correct (upright -mal; - being a hypen, not a minus; m a minuscule; requires \usepackage{amsmath}). Also, in the underbrace’s text, I’d add \textstyle (i.e. _{\textstyle n\text{-mal}}) so that it has the same size as n-mal. – Qrrbrbirlbel Dec 12 '12 at 22:26
  • 1
    @Qrrbrbirlbel thank you (I'm not a native so I make lots of those small grammar mistakes) ;) – smihael Dec 13 '12 at 13:45
15

Here's on option, with some modifications to your current arrangement:

enter image description here

\documentclass{article}
\begin{document}
\[
  m-Mal 
  \underbrace{
  \left\{\begin{tabular}{|l|l|l|l|}\hline
   1+1 & 1-2 & ... & 1+n \\ \hline
   2+1 & 2+2 & ... & 2+n \\ \hline
   ... & ... & ... & ... \\ \hline
   m+1 & m+2 & ... & m+n \\ \hline
   \end{tabular}\right.
   }_{n-Mal}
\]
\[
  % Store contents in \box0
  \setbox0=\hbox{$\begin{array}{|*{4}{c|}}\hline
    1+1 & 1-2 & \cdots & 1+n \\ \hline
    2+1 & 2+2 & \cdots & 2+n \\ \hline
    \cdots & \cdots & \cdots & \cdots \\ \hline
    m+1 & m+2 & \cdots & m+n \\ \hline
    \end{array}$}
  m-Mal\left\{\vphantom{\usebox0}\right.\kern-\nulldelimiterspace
  \underbrace{\usebox0}_{n-Mal}
\]
\end{document}

I've used

  • array instead of tabular since the content seemed math-related;
  • \cdots instead of ...;
  • a column specification that is easily identifiable and changeable (|*{4}{c|});
  • a box to store the entire structure (\box0), then used it to insert the left brace at the appropriate size (via a \vphantom). This leaves you to use a regular \underbrace to obtain the correct length.

A minor correction in terms of spacing is required to adjust for the "missing" right delimiter \right..

  • Wow, thank you very much. I just don't get what exactly does the \kern do. – smihael Dec 13 '12 at 13:44
  • @smihael \kern<glue> Adds a space (horizontal or vertical depending on context, here it's horizontal), and \nulldelimiterspace is the width of \right. – yo' Dec 13 '12 at 14:21

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.