因此,我只是尝试编辑某人在 tabularx 中完成的表格,因为我喜欢这种风格,但我不知道我在做什么,因此我遇到了一个问题。在下面的代码中,在“设置”条目之后有一个很大的空间,我希望这一切都很好而且对称,这个空间使它非常不对称。有没有办法删除这个空间?
\documentclass{article}
\usepackage{array}
\usepackage{booktabs}
\usepackage{ragged2e}
\usepackage{tabularx}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\newcolumntype{Y}{>{\RaggedRight\arraybackslash}X}
\begin{document}
\noindent
\edef\TabularRowHeight{\the\dimexpr-\arraystretch\baselineskip}
\begin{tabularx}{\textwidth}{YY}
\toprule
Alice & Bob \\
\midrule
\emph{Setup}\\
\cmidrule(lr){1-1}
Alice \& Bob select a prime $p$ and a generator $g$ for the finite field $\mathbb{F}_p$
&\\
&\emph{Private Computation}\\
\cmidrule(lr){2-2}
& Bob randomly selects $b \in \mathbb{F}_p$ and then computes the following:
$B \equiv g^b \mod p$ once computed Bob sends Alice $B$
\\[\TabularRowHeight] & \\
& \emph{Key Computation}\\
\cmidrule(lr){2-2}
& Bob who now has $A$, calculates the following:$A^b \equiv (g^a)^b \equiv g^{ab} \mod p$
\\
\emph{Private Computation}\\
\cmidrule(lr){1-1}
Alice randomly selects $a \in \mathbb{F}_p$ and then computes the following:
$A \equiv g^a \mod p$ once computed Alice sends Bob $A$ & \\ \pagebreak
\emph{Key Computation}\\
\cmidrule(lr){1-1}
Alice who now has $B$, calculates the following:$B^a \equiv (g^b)^a \equiv g^{ab} \mod p$ & \\
\bottomrule
\end{tabularx}
\end{document}