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.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following code, my problem is that the braces 'A' should be the after row A1 and B1 and the second braces should be after D1 and E1. Hope someone can help?

\begin{tabular}{c@{}c}

\begin{tabular}{|c|c|c|c|c|c|c|c|@{}}\hline
    &$A$&$B$&$C$&$D$&$E$&$F$\\\hline
    $A1$&2&5&11&13&5&7\\\hline
    $B1$&6&8&10&10&10&10\\\hline
    $C1$&13&11&5&12&1&1\\\hline
    $D1$&6&6&5&4&2&2\\\hline
    $E1$&k&0&0&0&0&6\\\hline
    $F1$&9&3&17&0&5&\\\hline
        \multicolumn{1}{c}{} & 
        \multicolumn{2}{@{}c@{}}{$\underbrace{\hspace*{\dimexpr6\tabcolsep+2\arrayrulewidth}\hphantom{012}}_{\mathcal{B}}$} & \multicolumn{1}{c}{}&
        \multicolumn{1}{@{}c@{}}{$\underbrace{\hspace*{2\tabcolsep}\hphantom{3}}_{\mathcal{B}}$}
\end{tabular} 
& 
$\begin{array}{l}
\MyLBrace{3.5ex}{$\mathcal{A}$} \\ \\
\MyLBrace{3.5ex}{$\mathcal{A}$} \\
\end{array}$
\end{tabular}
share|improve this question
    
Please tell us how \MyLBrace is defined. – Mico Mar 19 at 9:30
up vote 4 down vote accepted

Here's a solution that uses just one array environment.

enter image description here

\documentclass{article}
\usepackage{multirow,array}
\setlength\extrarowheight{2pt}
\begin{document}

$\begin{array}{|*{7}{c|}@{}c}
    \cline{1-7}
    &A&B&C&D&E&F\\ 
    \cline{1-7}
    A1&2&5&11&13&5&7& \multirow{2}{*}{$\left.\rule[1.5ex]{0pt}{1.5ex}\right\}\mathcal{A}$}\\ 
    \cline{1-7}
    B1&6&8&10&10&10&10\\ 
    \cline{1-7}
    C1&13&11&5&12&1&1&\multirow{2}{*}{$\left.\rule[1.5ex]{0pt}{1.5ex}\right\}\mathcal{A}$}\\ 
    \cline{1-7}
    D1&6&6&5&4&2&2\\ 
    \cline{1-7}
    E1&k&0&0&0&0&6\\ 
    \cline{1-7}
    F1&9&3&17&0&5&\\ 
    \cline{1-7}
    \multicolumn{1}{c}{} 
    & \multicolumn{2}{@{}c@{}}{\underbrace{\hspace*{\dimexpr4\tabcolsep+1\arrayrulewidth}\hphantom{123}}_{\mathcal{B}}}     
    & \multicolumn{1}{c}{} 
    & \multicolumn{1}{@{}c@{}}{\underbrace{\hspace*{2\tabcolsep}\hphantom{.}}_{\mathcal{B}}}
\end{array}$
\end{document}
share|improve this answer
    
Thank you :D You just made my day :D – Kate Mar 19 at 10:39

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.