Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
    
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
add comment

1 Answer

up vote 14 down vote accepted

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..

share|improve this answer
    
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. –  tohecz Dec 13 '12 at 14:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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