我想创建一个大型的 RevTex 兼容表,该表的第一列中有一个变量名称,右列中有一个表达式。下面是一个只有两行(实际上更多)的示例:
\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}
最简单的方法是什么让它看起来好看?明显的问题是:
- 尴尬的白色柱子
$\gamma$
和它的表达之间 - 分数如何
$\frac{1}{3}$
超出灰色范围。 - 第一行的指数没有足够的空间。
答案1
我会:
- 用于
tabularx
表格环境 - 不要使用彩色行
- 在表格主体中用小
Xhline{0.1pt}
包装分隔行makecell
对于单元格内容上方/下方的垂直空间,请使用
\makegapedcells
包中的宏makecell
:\documentclass[aps, pre, reprint]{revtex4-1} \usepackage{mathtools} \usepackage{makecell,tabularx} \setcellgapes{3pt} %---------------- show page layout. don't use in a real document! \usepackage{showframe} \renewcommand\ShowFrameLinethickness{0.15pt} \renewcommand*\ShowFrameColor{\color{red}} %---------------------------------------------------------------% \begin{document} \begin{table*} \makegapedcells \setlength\tabcolsep{6pt} \begin{tabularx}{\linewidth}{c X} \Xhline{0.8pt} Variable & Expression \\ \hline $\alpha$ & $\begin{multlined}[0.95\linewidth] -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{multlined}$ \\ \Xhline{0.1pt} $\gamma$ & $\begin{multlined}[0.95\linewidth] \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{multlined}$ \\ \Xhline{0.8pt} \end{tabularx} \end{table*} \end{document}
(红线表示页面布局)