Oftentimes the best way I can figure out how to lay out something is with the mindset I learned from HTML, tables within tables. How can I modify parameters affecting the external table without affecting the internal tables?
For example, suppose I want to do the MWE below.
\documentclass{article}
\usepackage[left=0.50in, right=0.50in, top=0.50in, bottom=0.5in]{geometry}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{tabularx}
\begin{document}
\begin{tabularx}{\textwidth}{lXX}
Short Title &
Longer sentence giving a description of the thing to the right. &
\({
\begin{bmatrix}
a & a & a & a \\
a & a & a & a \\
a & a & a & a \\
a & a & a & a
\end{bmatrix}
\begin{bmatrix}
b & b & b & b \\
b & b & b & b \\
b & b & b & b \\
b & b & b & b
\end{bmatrix}
=
\begin{bmatrix}
c & c & c & c \\
c & c & c & c \\
c & c & c & c \\
c & c & c & c
\end{bmatrix}
}\) \\
Another line &
That is like the one above. &
\({
\begin{bmatrix}
a & a & a & a \\
a & a & a & a \\
a & a & a & a \\
a & a & a & a
\end{bmatrix}
\begin{bmatrix}
b & b & b & b \\
b & b & b & b \\
b & b & b & b \\
b & b & b & b
\end{bmatrix}
=
\begin{bmatrix}
c & c & c & c \\
c & c & c & c \\
c & c & c & c \\
c & c & c & c
\end{bmatrix}
}\)
\end{tabularx}
\end{document}
Clearly I want more space between the rows and columns of the outer table, without affecting the inner ones (which sometimes are tabular
instead of bmatrix
). Sometimes I want to tweak all the inner tables without affecting the outer one.
Is there a clean way to do this, without peppering commands all throughout? Like, is there a CSS style method where I could define a table class and then specify that the outer table is of some class different than the regular ones?
Update
Here's another example. Using egreg's answer below, I have to put in 2(r-1) instances of \addlinespace
, and it interrupts the vertical lines.
\documentclass[12pt]{article}
\usepackage[landscape]{geometry}
\usepackage{amsmath}
\usepackage{booktabs}
\begin{document}
\begin{alignat*}{4}
&
\left[
\begin{array}{c|c}
\begin{bmatrix}
a & b
\end{bmatrix}
\begin{bmatrix}
w \\ y
\end{bmatrix}
&
\begin{bmatrix}
a & b
\end{bmatrix}
\begin{bmatrix}
x \\ z
\end{bmatrix}
\\ \hline
\begin{bmatrix}
c & d
\end{bmatrix}
\begin{bmatrix}
w \\ y
\end{bmatrix}
&
\begin{bmatrix}
c & d
\end{bmatrix}
\begin{bmatrix}
x \\ z
\end{bmatrix}
\\ \hline
\begin{bmatrix}
e & f
\end{bmatrix}
\begin{bmatrix}
w \\ y
\end{bmatrix}
&
\begin{bmatrix}
e & f
\end{bmatrix}
\begin{bmatrix}
x \\ z
\end{bmatrix}
\end{array}
\right]
&&
\renewcommand\arraystretch{1.2}
\left[
\begin{array}{c|c}
\begin{bmatrix}
a & b
\end{bmatrix}
\begin{bmatrix}
w \\ y
\end{bmatrix}
&
\begin{bmatrix}
a & b
\end{bmatrix}
\begin{bmatrix}
x \\ z
\end{bmatrix}
\\ \hline
\begin{bmatrix}
c & d
\end{bmatrix}
\begin{bmatrix}
w \\ y
\end{bmatrix}
&
\begin{bmatrix}
c & d
\end{bmatrix}
\begin{bmatrix}
x \\ z
\end{bmatrix}
\\ \hline
\begin{bmatrix}
e & f
\end{bmatrix}
\begin{bmatrix}
w \\ y
\end{bmatrix}
&
\begin{bmatrix}
e & f
\end{bmatrix}
\begin{bmatrix}
x \\ z
\end{bmatrix}
\end{array}
\right]
&&
\renewcommand\arraystretch{1}
\left[
\begin{array}{c|c}
\begin{bmatrix}
a & b
\end{bmatrix}
\begin{bmatrix}
w \\ y
\end{bmatrix}
&
\begin{bmatrix}
a & b
\end{bmatrix}
\begin{bmatrix}
x \\ z
\end{bmatrix}
\\ \addlinespace \hline \addlinespace
\begin{bmatrix}
c & d
\end{bmatrix}
\begin{bmatrix}
w \\ y
\end{bmatrix}
&
\begin{bmatrix}
c & d
\end{bmatrix}
\begin{bmatrix}
x \\ z
\end{bmatrix}
\\ \addlinespace \hline \addlinespace
\begin{bmatrix}
e & f
\end{bmatrix}
\begin{bmatrix}
w \\ y
\end{bmatrix}
&
\begin{bmatrix}
e & f
\end{bmatrix}
\begin{bmatrix}
x \\ z
\end{bmatrix}
\end{array}
\right]
&&
\left[
\begin{array}{c|c}
\begin{bmatrix}
a & b
\end{bmatrix}
\begin{bmatrix}
w \\ y
\end{bmatrix}
&
\begin{bmatrix}
a & b
\end{bmatrix}
\begin{bmatrix}
x \\ z
\end{bmatrix}
\\[12pt] \hline
\begin{bmatrix}
c & d
\end{bmatrix}
\begin{bmatrix}
w \\ y
\end{bmatrix}
&
\begin{bmatrix}
c & d
\end{bmatrix}
\begin{bmatrix}
x \\ z
\end{bmatrix}
\\[12pt] \hline \\[12pt]
\begin{bmatrix}
e & f
\end{bmatrix}
\begin{bmatrix}
w \\ y
\end{bmatrix}
&
\begin{bmatrix}
e & f
\end{bmatrix}
\begin{bmatrix}
x \\ z
\end{bmatrix}
\end{array}
\right]
\\
&\text{No changes.}&
&
\begin{array}{l}
\text{\textbackslash arraystretch} \\ \text{changes everything}
\end{array}
&
&\text{Using \textbackslash addlinespace.}&
&\begin{array}{l}
\text{Nope.} \\ \text{and O.M.G.!!}
\end{array}
\end{alignat*}
\end{document}
I just want to be able to do something like (pseudocode):
define OuterRowAndColSpacing
\begin{OuterArrayOrTable}[OuterRowAndColSpacing]
\begin{InnerMatrix}
...
\end{InnerMatrix}
...
\end{OuterArrayOrTable}
and have everything just work.
(Today is one of those of those days when I'm just like: You're getting a Word document, and you're going to accept it, and you're going to like it!)