beamer 中的 \vspace

beamer 中的 \vspace

我正在尝试在投影仪幻灯片中的表格周围添加一些填充。我尝试使用\vspace{10mm}但似乎没有产生任何效果。其他垂直间距命令(例如)似乎\bigskip也不起作用。

我搜索过但似乎找不到任何解决方案。我假设 beamer 管理自己的垂直间距,但肯定有某种方法可以覆盖它?

下面的最小示例显示了表格与上方和下方的文本太靠近的问题:

\documentclass[t]{beamer}

\usecolortheme{rose}
\begin{document}

\begin{frame}{Results: School children}
    \begin{block}{Hypothesis}
        School closures may cause significant reductions in disease spread
    \end{block}

    \begin{block}{Results}
    Worst case scenarios:
    \bigskip
    \begin{tabular}{|c|c|c|}
\hline \textbf{\% School Closure} & \textbf{Clinical Attack Rate} & \textbf{Mortality per 100,000} \\ 
\hline 0 & 30.6\% & 614 \\ 
\hline 100 & 0.6\% & 4 \\ 
\hline 
\end{tabular} \\
    With 100\% school closure starting early (0.1\% of population symptomatic) mortality is reduced \textbf{below normal levels for US seasonal flu}

    \end{block}
\end{frame}

\end{document}

答案1

在表格前后放置空行(又称为段落分隔符)。

\documentclass[t]{beamer}

\usecolortheme{rose}
\begin{document}

\begin{frame}{Results: School children}
    \begin{block}{Hypothesis}
        School closures may cause significant reductions in disease spread
    \end{block}

    \begin{block}{Results}
    Worst case scenarios:

    \bigskip
    \begin{tabular}{|c|c|c|}
\hline \textbf{\% School Closure} & \textbf{Clinical Attack Rate} & \textbf{Mortality per 100,000} \\ 
\hline 0 & 30.6\% & 614 \\ 
\hline 100 & 0.6\% & 4 \\ 
\hline 
\end{tabular}

    \bigskip
    With 100\% school closure starting early (0.1\% of population symptomatic) mortality is reduced \textbf{below normal levels for US seasonal flu}

    \end{block}
\end{frame}

\end{document}

答案2

一般来说,确保在\vspace(或\bigskip)命令前有一个新行,例如:

这不会起作用:

    Worst case scenarios:
    \vspace{1cm}
    \begin{tabular}{|c|c|c|}

这会:

    Worst case scenarios:

    \vspace{1cm}
    \begin{tabular}{|c|c|c|}.

答案3

如果你不想拆分段落,可以使用\\[size]

...
\begin{block}{Results}
Worst case scenarios:\\[2ex]
\begin{tabular}{|c|c|c|}
....

答案4

命令:\bigskip、\medskip、\smallskip 需要将框架设置为易碎

\begin{frame}[fragile]
  \frametitle{Vertical spaces}
  Text \bigskip

  Text
\end{frame}

相关内容