我感觉我无法正确使用列。我经常有一张幻灯片,其中有两个表格彼此相邻,看起来像这样:
框架的代码是这样的:
\begin{frame}{Nyttige regler for sett}
\begin{columns}
\begin{column}{0.25\textwidth}
\begin{tabular}{l|c}
Ekvivalens & Navn \\ \hline
$A \cap U = A$ & Identity\\
$A \cup \emptyset = A$ \\ \hline
$A \cup U = U$ & Domination\\
$A \cap \emptyset = \emptyset$\\ \hline
$A \cup A = A$ & Idempotent\\
$A \cap A = A$ \\ \hline
$A = (A^C)^C$ & Negation\\ \hline
$A \cup B = B \cup A$ & Commutative\\
$A \cap B = B \cap A$ \\
\end{tabular}
\end{column}
\begin{column}{0.58\textwidth}
\begin{tabular}{l|c}
Ekvivalens & Navn \\ \hline
$(A \cup B) \cup C = A \cup (B \cup C)$ & Associative\\
$(A \cap B) \cap C = A \cap (B \cap C)$ \\ \hline
$A \cup (B \cap C) = (A \cup B) \cap (A \cup C)$ & Distributive\\
$A \cap (B \cup C) = (A \cap B) \cup (A \cap C)$ \\ \hline
$(A \cap B)^C = A^C \cup B^C$ & De Morgan \\
$(A \cup B)^C = A^C \cap B^C$ \\ \hline
$A \cup (A \cap B) = A$ & Absorption \\
$A \cap (A \cup B) = A$ \\ \hline
$A \cup A^C = U$ & Negation \\
$A \cap A^C = \emptyset$ \\
\end{tabular}
\end{column}
\end{columns}
\end{frame}
无论我如何调整宽度参数,它看起来都不太好。它们要么相互生长,要么进入右边缘。
有办法解决这个问题吗?我可以让表格的某一列左对齐吗?
答案1
我认为使用column
环境可能会妨碍找到适合tabular
环境的尺寸。当然,一旦我摆脱了开销column
,就需要尝试各种相对字体大小,直到我找到\footnotesize
所需的大小,同时将参数降低\tabcolsep
到 3pt(默认值:6pt)。
\documentclass{beamer}
\usepackage[norsk]{babel}
\usepackage{array}
\begin{document}
\begin{frame}[c]{Nyttige regler for sett}
\setlength{\tabcolsep}{3pt} % default value: 6pt
\footnotesize
\begin{tabular}[t]{@{}l|c@{}}
Ekvivalens & Navn \\ \hline
$A \cap U = A$ & Identity\\
$A \cup \emptyset = A$ \\ \hline
$A \cup U = U$ & Domination\\
$A \cap \emptyset = \emptyset$\\ \hline
$A \cup A = A$ & Idempotent\\
$A \cap A = A$ \\ \hline
$A = (A^C)^C$ & Negation\\ \hline
$A \cup B = B \cup A$ & Commutative\\
$A \cap B = B \cap A$ \\
\end{tabular}%
\hspace{\fill}
\begin{tabular}[t]{@{}l|c@{}}
Ekvivalens & Navn \\ \hline
$(A \cup B) \cup C = A \cup (B \cup C)$ & Associative\\
$(A \cap B) \cap C = A \cap (B \cap C)$ \\ \hline
$A \cup (B \cap C) = (A \cup B) \cap (A \cup C)$ & Distributive\\
$A \cap (B \cup C) = (A \cap B) \cup (A \cap C)$ \\ \hline
$(A \cap B)^C = A^C \cup B^C$ & De Morgan \\
$(A \cup B)^C = A^C \cap B^C$ \\ \hline
$A \cup (A \cap B) = A$ & Absorption \\
$A \cap (A \cup B) = A$ \\ \hline
$A \cup A^C = U$ & Negation \\
$A \cap A^C = \emptyset$ \\
\end{tabular}
\end{frame}
\end{document}