修改 beamer 中的左边距和右边距很简单。
但是顶部和底部怎么样?
如果可能的话,我想稍微减少一下顶部边距,用手绘红色箭头标记:
梅威瑟:
\documentclass[t]{beamer}
\setbeamersize{text margin left=0.5em, text margin right=0.5em}
\setbeamertemplate{frametitle}{\color{black}\bfseries\insertframetitle\par\vskip-6pt\hrulefill}
\newcommand\FourQuad[4]{
\colorbox{yellow}{\begin{minipage}[b][.40\textheight][t]{.49\textwidth}#1\end{minipage}}\hfill
\begin{minipage}[b][.40\textheight][t]{.49\textwidth}#2\end{minipage}\\
\begin{minipage}[b][.40\textheight][t]{.49\textwidth}#3\end{minipage}\hfill
\begin{minipage}[b][.40\textheight][t]{.49\textwidth}#4\end{minipage}
}
\begin{document}
\begin{frame}
\frametitle{A frame divided in four quadrants}
\FourQuad%
{First quadrant contents and some more text text text text more text text text text more text text text text more text text text text more text text text text more text text text text more text text text text}%
{
\centering
\rule{3cm}{2cm}
A test figure.
}%
{\begin{align*}
a &= b \\
&= c \\
& = d.
\end{align*}}%
{Fourth quadrant contents and some more text text text text more text text text text more text text text text more text text text text more text text text text more text text text text more text text text text}
\end{frame}
\end{document}
答案1
您是否只想对“四边形”框架执行此操作,还是全局执行此操作?对于仅此特殊框架,快速破解方法是简单地插入\vspace{}
\documentclass[t]{beamer}
\setbeamersize{text margin left=0.5em, text margin right=0.5em}
\setbeamertemplate{frametitle}{\color{black}\bfseries\insertframetitle\par\vskip-6pt\hrulefill}
\newcommand\FourQuad[4]{
\vspace*{-0.2cm}
\colorbox{yellow}{\begin{minipage}[b][.40\textheight][t]{.49\textwidth}#1\end{minipage}}\hfill
\begin{minipage}[b][.40\textheight][t]{.49\textwidth}#2\end{minipage}\\
\begin{minipage}[b][.40\textheight][t]{.49\textwidth}#3\end{minipage}\hfill
\begin{minipage}[b][.40\textheight][t]{.49\textwidth}#4\end{minipage}
}
\begin{document}
\begin{frame}
\frametitle{A frame divided in four quadrants}
\FourQuad%
{First quadrant contents and some more text text text text more text text text text more text text text text more text text text text more text text text text more text text text text more text text text text}%
{
\centering
\rule{3cm}{2cm}
A test figure.
}%
{\begin{align*}
a &= b \\
&= c \\
& = d.
\end{align*}}%
{Fourth quadrant contents and some more text text text text more text text text text more text text text text more text text text text more text text text text more text text text text more text text text text}
\end{frame}
\end{document}
编辑:
要使此 hack 在全球范围内生效,请将其添加\vspace{}
到 frametitle 模板中
\documentclass[t]{beamer}
\setbeamersize{text margin left=0.5em, text margin right=0.5em}
\setbeamertemplate{frametitle}{\color{black}\bfseries\insertframetitle\par\vskip-6pt\hrulefill \vspace*{-0.2cm}}
\newcommand\FourQuad[4]{
\colorbox{yellow}{\begin{minipage}[b][.40\textheight][t]{.49\textwidth}#1\end{minipage}}\hfill
\begin{minipage}[b][.40\textheight][t]{.49\textwidth}#2\end{minipage}\\
\begin{minipage}[b][.40\textheight][t]{.49\textwidth}#3\end{minipage}\hfill
\begin{minipage}[b][.40\textheight][t]{.49\textwidth}#4\end{minipage}
}
\begin{document}
\begin{frame}
\frametitle{A frame divided in four quadrants}
\FourQuad%
{First quadrant contents and some more text text text text more text text text text more text text text text more text text text text more text text text text more text text text text more text text text text}%
{
\centering
\rule{3cm}{2cm}
A test figure.
}%
{\begin{align*}
a &= b \\
&= c \\
& = d.
\end{align*}}%
{Fourth quadrant contents and some more text text text text more text text text text more text text text text more text text text text more text text text text more text text text text more text text text text}
\end{frame}
\end{document}