我怎样才能使表格和集合处于同一水平。有没有比 tabularx 更好的方法?
\begin{tabularx}{\linewidth}{X|X}
{\begin{gather*}
C_{g|in} =C_{gn}+C_{gp}\\
C_{int}=C_{outputnode}\\
p=(C_{gate}/C_{inv})_{int}\\
g=(C_{gate}/C_{inv})_{g}\\
b=f/f_{on-path}\\
H=BGF\\
B=\prod_i b_i \tab
G=\prod_i g_i\\
F=C_L/C_{g,1}\\
P=\sum_i p_i\\
t_p=\sum_i tp_o(p_i+h_i/\gamma)
\end{gather*}}
&
{\begin{tabular}{|l|l|l|}\hline
Gate & p & g \\\hline
INV & 1 & 1 \\
NAND & n & (n+2)/3 \\
NOR & n & (2n+1)/3 \\
MUX & 2n & 2 \\
XOR/XNOR & $n2^{n-1}$ & - \\\hline
\end{tabular}}
\end{tabularx}
答案1
两个版本,具有不同的排列方式。
\documentclass{article}
\usepackage{amsmath,array}
\newcommand\tab{\quad}
\newcommand\tsub[1]{_{\textup{#1}}}
\begin{document}
\begin{center}
\hspace*{\fill}%
$\begin{gathered}
C_{g|\mathrm{in}}=C_{gn}+C_{gp}\\
C\tsub{int}=C\tsub{outputnode}\\
p=(C\tsub{gate}/C\tsub{inv})\tsub{int}\\
g=(C\tsub{gate}/C\tsub{inv})_{g}\\
b=f/f\tsub{on-path}\\
H=BGF\\
B=\prod_i b_i \tab
G=\prod_i g_i\\
F=C_L/C_{g,1}\\
P=\sum_i p_i\\
t_p=\sum_i tp_o(p_i+h_i/\gamma)
\end{gathered}$%
\hspace{\fill}%
\vrule
\hspace{\fill}%
\begin{tabular}{|l|l|l|}
\hline
Gate & $p$ & $g$ \\
\hline
INV & $1$ & $1$ \\
NAND & $n$ & $(n+2)/3$ \\
NOR & $n$ & $(2n+1)/3$ \\
MUX & $2n$ & $2$ \\
XOR/XNOR & $n2^{n-1}$ & - \\
\hline
\end{tabular}%
\hspace*{\fill}%
\end{center}
\begin{center}
\hspace*{\fill}%
$\begin{gathered}[t]
C_{g|\mathrm{in}}=C_{gn}+C_{gp}\\
C\tsub{int}=C\tsub{outputnode}\\
p=(C\tsub{gate}/C\tsub{inv})\tsub{int}\\
g=(C\tsub{gate}/C\tsub{inv})_{g}\\
b=f/f\tsub{on-path}\\
H=BGF\\
B=\prod_i b_i \tab
G=\prod_i g_i\\
F=C_L/C_{g,1}\\
P=\sum_i p_i\\
t_p=\sum_i tp_o(p_i+h_i/\gamma)
\end{gathered}$%
\hspace{\fill}%
\vrule
\hspace{\fill}%
\begin{tabular}[t]{|l|l|l|}
\firsthline
Gate & $p$ & $g$ \\
\hline
INV & $1$ & $1$ \\
NAND & $n$ & $(n+2)/3$ \\
NOR & $n$ & $(2n+1)/3$ \\
MUX & $2n$ & $2$ \\
XOR/XNOR & $n2^{n-1}$ & - \\
\hline
\end{tabular}%
\hspace*{\fill}%
\end{center}
\end{document}
抱歉,但我无法忍受直立的数学符号。
答案2
像这样?我改为 gather*
删除gathered
对 和使用\abovedisplayskip
的可选参数:[t]
gathered
tabular
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{mathtools,}
\usepackage{array,tabularx}
\begin{document}
\begin{tabularx}{\linewidth}{X| >{\centering\arraybackslash}X}
$ \begin{gathered}[t]C_{g|in} =C_{gn}+C_{gp}\\
C_{int}=C_{outputnode}\\
p=(C_{gate}/C_{inv})_{int}\\
g=(C_{gate}/C_{inv})_{g}\\
b=f/f_{on-path}\\
H=BGF\\
B=\prod_i b_i \quad%\tab
G=\prod_i g_i\\
F=C_L/C_{g,1}\\
P=\sum_i p_i\\
t_p=\sum_i tp_o(p_i+h_i/\gamma)
\end{gathered} $
&
\raisebox{0.7\baselineskip}{\begin{tabular}[t]{|l|l|l|}\hline
Gate & p & g \\\hline
INV & 1 & 1 \\
NAND & n & (n+2)/3 \\
NOR & n & (2n+1)/3 \\
MUX & 2n & 2 \\
XOR/XNOR & $n2^{n-1}$ & - \\\hline
\end{tabular}}
\end{tabularx}
\end{document}
答案3
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathtools,}
\usepackage{array}
\begin{document}
\begin{tabular}{ r| l}
\arraycolsep=1.4pt \def\arraystretch{1.5}
$\begin{array}[t]{@{} r l @{}}
C_{g|in} &=C_{gn}+C_{gp}\\
C_{int} &=C_{outputnode}\\
p &=(C_{gate}/C_{inv})_{int}\\
g &=(C_{gate}/C_{inv})_{g}\\
b &=f/f_{on-path}\\
H &=BGF\\
B &=\prod_i b_i \quad G=\prod_i g_i\\
F &=C_L/C_{g,1}\\
P &=\sum_i p_i\\
t_p&=\sum_i tp_o(p_i+h_i/\gamma)
\end{array}$
&
\begin{tabular}[t]{|l|l|l|}\firsthline
Gate & p & g \\\hline
INV & 1 & 1 \\
NAND & n & (n+2)/3 \\
NOR & n & (2n+1)/3 \\
MUX & 2n & 2 \\
XOR/XNOR & $n2^{n-1}$ & - \\\hline
\end{tabular}
\end{tabular}
\end{document}