Graphics, Figures & Tablesbox-table with outside descriptions

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
wang tang
Posts: 2
Joined: Mon Dec 28, 2009 4:38 am

box-table with outside descriptions

Post by wang tang »

Hello everyone!

Here's what I've been trying to accomplish:
I want to make a "box-table", with descriptions sticking out on the top and the left. Because this is not quite easy to describe, here's a picture:
Image
I have managed to construct the table, but am not able to size the {'s so that they fit (want them to span the entire row resp. column, like in the above image). While I could do this as an image in a graphics program, the letters and the table wouldn't look as good as pure LaTeX when resized.
I have already tried the rotate package for the upper {, also used overbrace, but they both don't yield satisfactionary results.

Here's a minimal example of what I have so far:

Code: Select all

\documentclass[10pt]{scrartcl}
%
\usepackage{tabularx}
\usepackage{arydshln}
%
\renewcommand{\tabcolsep}{0pt}
\newcolumntype{C}{>{\centering}m{16pt}}
%%
\begin{document}
%
\begin{table}[htbp]
\begin{center}
\begin{tabular}{p{20pt}|C|C|CCCCCC:C|C|}
\multicolumn{1}{p{20pt}}{} & \multicolumn{1}{C}{} & \multicolumn{1}{C}{$\overbrace{}^{L_a}$} & \multicolumn{8}{C}{} \\
\cline{2-11} $R_a\left\{\right.$ & &  a  & & & & & & & \rule[-8pt]{0pt}{16pt} & \\
\cline{2-11}             & &     & & & & & & & \rule[-8pt]{0pt}{16pt} & \\
\cline{2-11}             & &     & & & & & & & \rule[-8pt]{0pt}{16pt} & \\
\cdashline{2-11}         & &     & & & & & & & \rule[-8pt]{0pt}{16pt} & \\
\cline{2-11}             & &     & & & & & & & \rule[-8pt]{0pt}{16pt} & \\
\cline{2-11}
\end{tabular}
\end{center}
\end{table}
%
\end{document}
Does anyone have an idea how to accomplish this in LaTeX, or an idea how to to it in an other way? Maybe I'm just missing out on a really easy solution :/

Wish you nice post-christmas days,
~wangtang
Last edited by wang tang on Mon Jan 04, 2010 3:21 am, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

yago
Posts: 29
Joined: Sat Dec 13, 2008 6:40 pm

Re: box-table with outside descriptions

Post by yago »

Hello.

Try with this code:

\documentclass[spanish]{article}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}

\makeatletter
\usepackage{tabularx}
\usepackage{arydshln}
\usepackage{MnSymbol}

\renewcommand{\tabcolsep}{0pt}
\newcolumntype{C}{>{\centering}m{16pt}}

\makeatother

\usepackage{babel}
\addto\shorthandsspanish{\spanishdeactivate{~<>}}

\begin{document}
\begin{table}
\begin{center}
\begin{tabular}{m{2pt}C|C|C|C:m{50pt}|C|}
& \multicolumn{1}{C}{} & \multicolumn{1}{C}{} & \multicolumn{1}{C}{$L_{a}$} & \multicolumn{1}{C}{} & \multicolumn{1}{C}{} & \multicolumn{1}{C}{}\\[-3pt]
& \multicolumn{1}{C}{} & \multicolumn{1}{C}{} & \multicolumn{1}{C}{$\overbrace{\,\quad}$} & \multicolumn{1}{C}{} & \multicolumn{1}{C}{} & \multicolumn{1}{C}{}\\[-6pt]
\cline{3-7}
$R_{a}$ & $\hspace*{10pt}\left.\left\{ \right.\right.$ & & $a$ & & &\\
\cline{3-7}
& & & & & &\\
\cline{3-7}
& & & & & &\\
\cdashline{3-7}
& & & & & &\\
\cline{3-7}
& & & & & &\\
\cline{3-7}
\end{tabular}
\end{center}
\end{table}
\end{document}
wang tang
Posts: 2
Joined: Mon Dec 28, 2009 4:38 am

box-table with outside descriptions

Post by wang tang »

Thank you yago!
It is though not quite what I imagined, because the brackets are not aligned with the boxes. I now did it with PGF/TikZ, which allows me to position everything exactly as I want to. In case someone needs to do something similiar, here's how I've done it:

Code: Select all

\documentclass[10pt]{scrartcl}

\usepackage{pgf}
\usepackage{tikz}
\usepackage{rotating}

\begin{document}

\usetikzlibrary{arrows,decorations,backgrounds}
\begin{tikzpicture}[>=stealth,x=1mm,y=1mm]
  \filldraw[very thin,draw=blue!30,fill=blue!10] (0,0)   rectangle (70,40);
% horizontal  
  \draw[thin] (15,30) -- (65,30);
  \draw[thin] (15,25) -- (65,25);
  \draw[thin] (15,20) -- (65,20);
  \draw[thin,dashed] (15,15) -- (65,15);
  \draw[thin] (15,10) -- (65,10);
  \draw[thin] (15,5) -- (65,5);
% vertical
  \draw[thin] (15,5) -- (15,30);
  \draw[thin] (20,5) -- (20,30);
  \draw[thin] (25,5) -- (25,30);
  \draw[thin,dashed] (30,5) -- (30,30);
  \draw[thin] (60,5) -- (60,30);
  \draw[thin] (65,5) -- (65,30);
% descriptions
  \node (a) at (22.5,27.5) {$a$};
  \node (Ra) at (11,27.5) {\small{$R_a$}\Large{\{}};
  \node (La) at (23,34.5) {\small{$L_a$}};
  \node (p2) at (24,30.5) {\begin{rotate}{90}\Large{\}}\end{rotate}};
\end{tikzpicture}

\end{document}
Nonetheless, thanks you very much for your solution!
Post Reply