我如何将这张桌子安装到 Beamer 的框架中?

我如何将这张桌子安装到 Beamer 的框架中?
\documentclass{Beamer}

\begin{document}

\begin{table}
\begin{tabular}{l l l}
\toprule
Band &   &  \\
\hline
Total stop band & No propagation possible & All of the incident field is reflected back  \\ % inserting body of the table
Partial stop band & Propagation possible for some directions & Some/all energy converted to Bloch waves  \\
Pass band & Propagation possible in all directions & Some/all energy converted to Bloch waves \\
\bottomrule
\end{tabular}
\caption{Table caption}
\end{table}

\end{document}

答案1

你有两种可能性(正如 John Kormylo 在他的评论中所述):

  1. 减小字体大小至tiny
  2. 将字体大小减小到,small并改用tabular例如tabularx断线并减小\tobcolsep到 3pt。

梅威瑟:

\documentclass{Beamer}
\usepackage{booktabs,tabularx}
    \newcolumntype{L}{>{\raggedright\arraybackslash}X}

        \begin{document}
\begin{frame}
    \begin{table}\tiny
\begin{tabular}{@{}l l l@{}}
    \toprule
Band &   &  \\
    \midrule
Total stop band
    & No propagation possible
        & All of the incident field is reflected back   \\
Partial stop band
    & Propagation possible for some directions
        & Some/all energy converted to Bloch waves      \\
Pass band
    & Propagation possible in all directions
        & Some/all energy converted to Bloch waves      \\
    \bottomrule
\end{tabular}
\caption{Table caption: case 1}
\end{table}

\begin{table}
    \small
    \setlength{\tabcolsep}{3pt}
\begin{tabularx}{\hsize}{@{}l LL@{}}
    \toprule
Band &   &  \\
    \midrule
Total stop band 
    & No propagation possible 
        & All of the incident field is reflected back   \\
Partial stop band 
    & Propagation possible for some directions 
        & Some/all energy converted to Bloch waves      \\
Pass band 
    & Propagation possible in all directions 
        & Some/all energy converted to Bloch waves      \\
    \bottomrule
\end{tabularx}
\caption{Table caption: case 2}
    \end{table}
\end{frame}
        \end{document}

在此处输入图片描述

答案2

我发现这种方法可以解决你的问题,只需在你的序言中添加调整框包并复制以下代码

\documentclass{beamer}
\usepackage{booktabs}
\usepackage{adjustbox}

\begin{document}

\begin{frame}

\begin{table}
\begin{adjustbox}{max width=\textwidth}
\begin{tabular}{l l l}
\toprule
Band &   &  \\
\hline
Total stop band & No propagation possible & All of the incident field is reflected back  \\ % inserting body of the table
Partial stop band & Propagation possible for some directions & Some/all energy converted to Bloch waves  \\
Pass band & Propagation possible in all directions & Some/all energy converted to Bloch waves \\
\bottomrule
\end{tabular}
\end{adjustbox}
\caption{Table caption}
\end{table}

\end{frame}

\end{document}

相关内容