以下是 MWE:
\documentclass{beamer}
\usepackage{amsmath,mathtools}
\begin{document}
\setbeamertemplate{navigation symbols}{}
\begin{frame}[shrink]
\onslide<+->\raggedright{%
The nos. from 1 to 140 which are divisible by 4 are 4, 8, 12, ... 140.
}
\begin{alignat*}{5}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{ &= 2520}
\end{alignat*}
\end{frame}
\end{document}
编译后,它会生成一个左右边距明显不同的文档。
删除几行,边距就会变得相等。
如何确保无论文本长度如何,左右边距都相等?
答案1
原因其实是shrink
选项。您也可以选择重新调整alignat
环境:
\documentclass{beamer}
\usepackage{amsmath,mathtools}
\begin{document}
\setbeamertemplate{navigation symbols}{}
\begin{frame}
\onslide<+->\raggedright{%
The nos. from 1 to 140 which are divisible by 4 are 4, 8, 12, ... 140.
}
\scalebox{.9}{\parbox{1.11\textwidth}{
\begin{alignat*}{5}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{t_n &= a + (n - 1)d \\}
\onslide<+->{ &= 2520}
\end{alignat*}
}}
\end{frame}
\end{document}