尝试将不同的多行公式和文本分组,以便在页面上腾出空间,我的第一个想法是将它们作为表格中的一个单元格,但天真地尝试这样做是行不通的
\begin{tabular}{l l}
\textbf{Removing Left Recursion}
$A \rightarrow A \alpha\ |\ \beta$\\
then\\
$A \rightarrow \beta A^{'}$\\
$A \rightarrow \alpha A^{'}\ |\ \epsilon$\\
&
\textbf{Left Factor}
$A \rightarrow \alpha \beta_{1}\ |\ \alpha \beta_{2}$\\
then\\
$A \rightarrow \alpha \beta^{'}$\\
$\beta^{'} \rightarrow \beta_{1}\ |\ \beta_{2}$
\\
\end{tabular}
我怎样才能将这些东西分组以占用更少的空间?
答案1
我将您的表格改为两列。这是您想要实现的效果吗?
\documentclass{article}
\pagestyle{empty}
\begin{document}
\begin{tabular}{ll}
\textbf{Removing Left Recursion} & \textbf{Left Factor}\\
$A \rightarrow A \alpha\ |\ \beta$ & $A \rightarrow \alpha \beta_{1}\ |\ \alpha \beta_{2}$\\
then & then\\
$A \rightarrow \beta A^{'}$ & $A \rightarrow \alpha \beta^{'}$\\
$A \rightarrow \alpha A^{'}\ |\ \epsilon$ & $\beta^{'} \rightarrow \beta_{1}\ |\ \beta_{2}$\\
\end{tabular}
\end{document}
答案2
如果你不坚持要一张桌子,你可以尝试
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
\begin{minipage}{0.49\linewidth}
\textbf{Removing Left Recursion}
\[A\rightarrow A\alpha\mid\beta \quad\text{ then } \begin{cases}A\rightarrow\beta A’\\A\rightarrow\alpha A’\mid\epsilon\end{cases}\]
\end{minipage}
\begin{minipage}{0.49\linewidth}
\textbf{Left Factor}
\[A\rightarrow\alpha\beta_1\mid\alpha\beta_2 \quad\text{then } \begin{cases}A\rightarrow\alpha\beta\\\beta’\rightarrow \beta_1\mid\beta_2\end{cases}\]
\end{minipage}
\end{document}