Hi,
Any hints on how I might accomplish this? I would like to draw boxes around subsquares of a table. For instance, in a 10 by 10 table, whose cells I identify here by column/row pairs, I want to box the rectangle whose corners encompass cells (2,3) and (7,6), then add another smaller box around (7,5) to (8,6). (The small box sits at the right of the big box, sharing one side wall, and the baselines for each are coterminal.)
Thanks!
Graphics, Figures & Tables ⇒ drawing boxes around sub-rectangles of a table
NEW: TikZ book now 40% off at Amazon.com for a short time.

drawing boxes around sub-rectangles of a table
The following code may give you some hints:
Code: Select all
\documentclass[a4paper]{article}
\newcommand\LL[1]{\multicolumn{1}{|c}{#1}}
\newcommand\RR[1]{\multicolumn{1}{c|}{#1}}
\newcommand\LR[1]{\multicolumn{1}{|c|}{#1}}
\begin{document}
\begin{tabular}{*{10}{c}}
X & X & X & X & X & X & X & X & X & X \\
X & X & X & X & X & X & X & X & X & X \\
\cline{2-7}
X & \LL{X} & X & X & X & X & \RR{X} & X & X & X \\
X & \LL{X} & X & X & X & X & \RR{X} & X & X & X \\
\cline{7-8}
X & \LL{X} & X & X & X & X & \LR{X} & \RR{X} & X & X \\
X & \LL{X} & X & X & X & X & \LR{X} & \RR{X} & X & X \\
\cline{2-8}
X & X & X & X & X & X & X & X & X & X \\
X & X & X & X & X & X & X & X & X & X \\
X & X & X & X & X & X & X & X & X & X \\
X & X & X & X & X & X & X & X & X & X
\end{tabular}
\end{document}
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Re: drawing boxes around sub-rectangles of a table
That works great Juanjo, thanks very much!
Last edited by lloyd22 on Mon Aug 09, 2010 11:56 pm, edited 1 time in total.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
drawing boxes around sub-rectangles of a table
Now that the problem is solved, please mark the topic accordingly as described in Section 3 of the Board Rules.
Best regards
Thorsten
Best regards
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10