Beamer 中一张幻灯片中有 3 个表格

Beamer 中一张幻灯片中有 3 个表格

我生成了3个表:

\documentclass[10pt, aspectratio=169]{beamer}
\usefonttheme{serif}

%\usepackage{booktabs} % tables
\usepackage{siunitx} % units, numbers
\usepackage{mathtools}
\usepackage[singlelinecheck=false]{caption}
\usepackage{tabularray}
\UseTblrLibrary{amsmath,booktabs}

\begin{document}
    
\begin{frame}{title}
  \begin{table}
    \tiny
    \caption{A}
    \begin{+array}{delimiter={right=\rbrace,left=.},column{2}={mode={imath}}}
    \midrule
      The first example&a\sim\qty{e1}{m}\\
      The first example&b\sim\qty{e2}{s^{-1}}\\
      The first example&c\sim\qty{e3}{m.s^{-2}}\\
      The first example&d\sim\qty{e4}{kg.m^{-1}.s^{-2}}\\
      The first example&e\sim\qty{e5}{s}\\
      $\begin{rcases}
      \text{This table is larger than the second and third table}\\
      \text{This table is larger than the second and third table}\\
      \end{rcases}$&f\sim\qty{e6}{s}\\
      The first example&g\sim\qty{e7}{m^2.s^{-2}.s}\\
      The first example&h\sim\qty{10}{}\\
      \bottomrule
    \end{+array}
    Description
  \end{table}
\end{frame}
\begin{frame}{Frame Title}
    \begin{table}
        \tiny
        \caption{B}
        \begin{+array}{delimiter={right=\rbrace,left=.},column{2}={mode={imath}}}
            \midrule
            The second Example&L\textsubscript{A}=\frac{a\textsubscript{ex}}{2}\sim\qty{10000}{km}\\
            The second Example&L\textsubscript{B}=\frac{b\textsubscript{ex}}{2}\sim\qty{20000}{km}\\
            The second Example&L\textsubscript{C}=\frac{c\textsubscript{ex}}{2}\sim\qty{30000}{km}\\
            The second Example&L\textsubscript{D}=\frac{d\textsubscript{ex}}{2}\sim\qty{20000}{km}\\
            The second Example&L\textsubscript{E}=\frac{e\textsubscript{ex}}{2}\sim\qty{10000}{km}\\
            \bottomrule
        \end{+array} Description
    \end{table}
    \begin{table}
        \tiny
        \caption{C}
        \begin{+array}{delimiter={right=\rbrace,left=.},column{2}={mode={imath}}}
            \midrule
            Another example&L\textsubscript{A}=\frac{a\textsubscript{ex}}{2}\sim\qty{10000}{km}\\
            Another example&L\textsubscript{B}=\frac{b\textsubscript{ex}}{2}\sim\qty{20000}{km}\\
            Another example&L\textsubscript{C}=\frac{c\textsubscript{ex}}{2}\sim\qty{30000}{km}\\
            Another example&L\textsubscript{D}=\frac{d\textsubscript{ex}}{2}\sim\qty{20000}{km}\\
            Another example&L\textsubscript{E}=\frac{e\textsubscript{ex}}{2}\sim\qty{10000}{km}\\
            \bottomrule
        \end{+array} Description
    \end{table}
\end{frame}
\end{document}

我想重新排列它们。所有表格都应放在一张幻灯片上。第一张和第二张表格应彼此并排,并用括号括起来。第三张表格应放在右侧。

在此处输入图片描述

你能帮忙吗?

答案1

由于您已经知道如何使用该tabularray包来添加大括号,因此您也可以在这里使用它来在右侧的两个表格周围添加括号:

\documentclass[10pt, aspectratio=169]{beamer}
\usefonttheme{serif}

%\usepackage{booktabs} % tables
\usepackage{siunitx} % units, numbers
\usepackage{mathtools}
\usepackage[singlelinecheck=false]{caption}
\usepackage{tabularray}
\UseTblrLibrary{amsmath,booktabs}

\begin{document}
    
\begin{frame}
\frametitle{title}
\begin{columns}
\begin{column}{.7\textwidth}
\tiny
  \begin{+array}{delimiter={right=\rbrace,left=.}}
%  \begin{minipage}{.9\textwidth}
  \tiny
       Table A\\
        \begin{tblr}{
          colspec={ll},
          column{2}={mode={imath}}
        }
        \midrule
          The first example&a\sim\qty{e1}{m}\\
          The first example&b\sim\qty{e2}{s^{-1}}\\
          The first example&c\sim\qty{e3}{m.s^{-2}}\\
          The first example&d\sim\qty{e4}{kg.m^{-1}.s^{-2}}\\
          The first example&e\sim\qty{e5}{s}\\
          $\begin{rcases}
          \text{This table is larger than the second and third table}\\
          \text{This table is larger than the second and third table}\\
          \end{rcases}$&f\sim\qty{e6}{s}\\
          The first example&g\sim\qty{e7}{m^2.s^{-2}.s}\\
          The first example&h\sim\qty{10}{}\\
          \bottomrule
        \end{tblr}\\
        Description
        \\
        Table B\\
            \begin{+array}{column{2}={mode={imath}}}
                \midrule
                The second Example&L\textsubscript{A}=\frac{a\textsubscript{ex}}{2}\sim\qty{10000}{km}\\
                The second Example&L\textsubscript{B}=\frac{b\textsubscript{ex}}{2}\sim\qty{20000}{km}\\
                The second Example&L\textsubscript{C}=\frac{c\textsubscript{ex}}{2}\sim\qty{30000}{km}\\
                The second Example&L\textsubscript{D}=\frac{d\textsubscript{ex}}{2}\sim\qty{20000}{km}\\
                The second Example&L\textsubscript{E}=\frac{e\textsubscript{ex}}{2}\sim\qty{10000}{km}\\
                \bottomrule
            \end{+array} \\
Description\\
  \end{+array}
\end{column}
\begin{column}{.36\textwidth}
\tiny

Table: C

          \begin{+array}{column{2}={mode={imath}}}
              \midrule
              Another example&L\textsubscript{A}=\frac{a\textsubscript{ex}}{2}\sim\qty{10000}{km}\\
              Another example&L\textsubscript{B}=\frac{b\textsubscript{ex}}{2}\sim\qty{20000}{km}\\
              Another example&L\textsubscript{C}=\frac{c\textsubscript{ex}}{2}\sim\qty{30000}{km}\\
              Another example&L\textsubscript{D}=\frac{d\textsubscript{ex}}{2}\sim\qty{20000}{km}\\
              Another example&L\textsubscript{E}=\frac{e\textsubscript{ex}}{2}\sim\qty{10000}{km}\\
              \bottomrule
          \end{+array} 
          
          Description
\end{column}
\end{columns}
\end{frame}
\end{document}

在此处输入图片描述

答案2

姆韦

\documentclass[aspectratio=11]{beamer}
\usepackage{schemata}
\usetheme{Warsaw}
\newcommand\AB[2]{\schema{\schemabox{#2}}{\schemabox{#1}}}
\newcommand\BA[2]{\schema[close]{\schemabox{#1}}{\schemabox{#2}}}
\newcommand\exampletable{\begin{tabular}{lll}
    11 & 12 & 13\\
    21 & 22 & 23\\
    31 & 32 & 33\\
\end{tabular}}
\begin{document}
\begin{frame}{Three tables in one slide}\centering\leavevmode 
\BA{\exampletable\\\bigskip\\\exampletable}{\exampletable}
\end{frame}
\begin{frame}\centering\centering\leavevmode
\AB{\exampletable\\\bigskip\\\exampletable}{\exampletable}
\end{frame}
\end{document}

您不能在这里直接使用 beamer 伪浮点数table,但在小型页面中,它可以工作:

\begin{minipage}{.5\linewidth}
\begin{table}\caption{foo}
<your tabular or whatever here>
\end{table}
\end{minipage}

mwe2

答案3

编辑:改进的表格设计。

表格左侧有嵌套的和tblr,右侧有内部:+array+arraytblrminipage

\usetheme{Warsaw}
\setbeamerfont{caption}{size=\footnotesize}
\setbeamertemplate{caption label separator}[space]

\usepackage{tabularray}
\UseTblrLibrary{amsmath, siunitx}

\begin{document}
\begin{frame}
\frametitle{title}
\scriptsize

\begin{table}
    \begin{+array}{colspec={Q[wd=0.45\linewidth]},delimiter={right=\rbrace,left=.}}
    \vspace*{-4ex}
\caption{A}
    \vspace{-1ex}
\begin{tblr}{hline{1,Z},
             colspec={@{} l Q[l, mode={math}] @{}},
             rowsep=1pt}
The first example   & a\sim\qty{e1}{\m}\\
The first example   & b\sim\qty{e2}{\per\s}\\
The first example   & c\sim\qty{e3}{\m\s^{-2}}\\
The first example   & d\sim\qty{e4}{\kg\per\m^{-1}s^{-2}}\\
The first example   & e\sim\qty{e5}{\s}\\
%
\begin{+array}{colspec={@{} l}, rowsep=1pt, delimiter={left=.,right=\rbrace}}
{This table is larger than\\ \quad
    the second and third table}\\
{This table is larger than\\ \quad
    the second and third table}
\end{+array}
                    &   f\sim \qty{e6}{\s}\\
%
The first example   & g \sim \qty{e7}{\m^{-2}\s^{-2}}\\
The first example   & h \sim\ 10    \\
\end{tblr}    \\[-2ex]
%
\caption{B}\vspace{-1ex}
\begin{tblr}{hline{1,Z},
             colspec={@{} l Q[l, mode={math}] @{}},
             rowsep=1pt}
The second Example & L_{\mathrm{A}} = a_{\mathrm{ex}}/2 \sim \qty{10000}{km}\\
The second Example & L_{\mathrm{B}} = b_{\mathrm{ex}}/2 \sim \qty{20000}{km}\\
The second Example & L_{\mathrm{C}} = c_{\mathrm{ex}}/2 \sim \qty{30000}{km}\\
The second Example & L_{\mathrm{D}} = d_{\mathrm{ex}}/2 \sim \qty{20000}{km}\\
The second Example & L_{\mathrm{E}} = e_{\mathrm{ex}}/2 \sim \qty{10000}{km}\\
\end{tblr} 
    \end{+array}
\qquad
\begin{minipage}{0.4\linewidth}
\caption{C}\vspace{-1ex}
\begin{tblr}{hline{1,Z},
             colspec={@{} l Q[l, mode={math}] @{}},
             rowsep=1pt}
Another example & L_{\mathrm{A}} = a_{\mathrm{ex}}/2 \sim \qty{10000}{km}\\
Another example & L_{\mathrm{B}} = b_{\mathrm{ex}}/2 \sim \qty{20000}{km}\\
Another example & L_{\mathrm{C}} = c_{\mathrm{ex}}/2 \sim \qty{30000}{km}\\
Another example & L_{\mathrm{D}} = d_{\mathrm{ex}}/2 \sim \qty{20000}{km}\\
Another example & L_{\mathrm{E}} = e_{\mathrm{ex}}/2 \sim \qty{10000}{km}\\
\end{tblr} 
\end{minipage}
    \end{table}
\end{frame}
\end{document}

在此处输入图片描述

相关内容