Beamer 中带有固定宽度文本行的表格

Beamer 中带有固定宽度文本行的表格

因此,我正在制作一些具有表格结构的幻灯片。左侧是示例,右侧是定义。我还希望它使用暂停功能,因为我将一次浏览一个,所以我使用表格而不是表格(因为我还没有找到在 Beamer 中使表格和暂停工作的方法)。理想情况下,我只需将宽度设置为幻灯片的一半即可。

到目前为止,我已经弄清楚了如何调整框的大小,但它会使文本变得非常小。我想要一种方法来保持文本的大小与常规文本相同,但一旦表格单元格的宽度用完,表格就会自动开始下一行。

例如

\begin{frame}

\resizebox{\textwidth}{!}{%
\begin{tabular} {l l}
     2x+3y=4 & \textbf{linear equation} (in the variables $x_{1}, \dots ,x_{n}$): An equation that can be written in the form $a_{1}x_{1}+a_{2}x_{2}+ \cdots +a_{n}x_{n}=b$, where $b$ and the \textbf{coefficients} $a_{1}, \dots, a_{n}$ are real or complex numbers, and $n$ may be any positive integer. \\
\pause
     Example & Definition \\
\end{tabular}
} % end of scope of "\resizebox"  directive

\end{frame}{}

答案1

@leandriis 答案的一个小变化(+1):

\documentclass{beamer}
\usepackage{tabularx}
\usepackage{amsmath}

\begin{document}
\begin{frame}%[t]
\begin{tabularx}{\linewidth}{@{} lX @{}}
\only<1->{
$2x+3y=4$   &  \textbf{linear equation} (in the variables $x_{1}, \dotsc ,x_{n}$): 

                An equation that can be written in the form 
                    \begin{gather*}
                a_{1}x_{1}+a_{2}x_{2}+ \dotsm +a_{n}x_{n}=b,
                    \end{gather*}
                where $b$ and the \textbf{coefficients} $a_{1}, \dotsc, a_{n}$ are real or complex numbers, and $n$ may be any positive integer $(n \in \mathbb{Z})$. \\
        }
\only<2->{
     Example & Definition \\
        }
\end{tabularx}
\end{frame}
\end{document}

在此处输入图片描述

答案2

借助tabularx及其X类型为列的变量,您可以确保表格的宽度与给定的宽度一样宽:

\documentclass{beamer}
\usepackage{tabularx}

\begin{document}

\begin{frame}
\begin{tabularx}{\textwidth}{lX}
     2x+3y=4 & \textbf{linear equation} (in the variables $x_{1}, \dots ,x_{n}$): An equation that can be written in the form $a_{1}x_{1}+a_{2}x_{2}+ \cdots +a_{n}x_{n}=b$, where $b$ and the \textbf{coefficients} $a_{1}, \dots, a_{n}$ are real or complex numbers, and $n$ may be any positive integer. \\
\pause
     Example & Definition \\
\end{tabularx}
\end{frame}

\end{document}

相关内容