I want to create a large RevTex compatible table that has a variable name in the first column and its expression in the right column. An example with only two rows (more in reality) is below:
\documentclass[aps, pre, reprint]{revtex4-1}
\usepackage{graphicx,color}
\usepackage{amsmath}
\usepackage[table]{xcolor}
\begin{document}
\renewcommand*{\arraystretch}{1.5}
\begin{table*}
\rowcolors{2}{gray!25}{white}
\begin{ruledtabular}
\begin{tabular}{p{1in} p{6in}}
Variable & Expression \\
\hline
$\alpha$ & $\begin{aligned} &-2 q_1^2 (6 \alpha _4 A_1^4-A_1^2 (\alpha _2+20 \alpha _4 A_2^2+32 \alpha _4 A_3 A_2-4 \alpha _3 A_3+40 \alpha _4 A_3^2)+ \\ & 2 (6 \alpha _4 A_2^4+A_2^2 (\alpha _2+4 A_3 (4 \alpha _3+9 \alpha _4 A_3))+2 A_3^2 (\alpha _2+6 \alpha _4 A_3^2))) \end{aligned}$ \\
$\gamma$ & $\begin{aligned} &\frac{1}{3} q_1^4 (12 \alpha _4 A_1^4-A_1^2 (\alpha _2+4 (11 \alpha _4 A_2^2+32 \alpha _4 A_3 A_2-7 \alpha _3 A_3+58 \alpha _4 A_3^2))+ \\ & 2 (24 \alpha _4 A_2^4+A_2^2 (\alpha _2+204 \alpha _4 A_3^2+40 \alpha _3 A_3)+8 A_3^2 (\alpha _2+12 \alpha _4 A_3^2))) \end{aligned}$ \\
\end{tabular}
\end{ruledtabular}
\end{table*}
\end{document}
What is the simplest way to make this look nice? The obvious problems are:
- The awkward white column between
$\gamma$
and its expression - How the fraction
$\frac{1}{3}$
goes outside the gray. - The exponents in the first line don't have enough space.
Best Answer
i would:
tabularx
for table environmentXhline{0.1pt}
from the packagemakecell
for vertical spaces above/below cell content use macro
\makegapedcells
from the packagemakecell
:(red lines indicate page layout)