Beamer,调整一下这个表格的大小

Beamer,调整一下这个表格的大小

我在 beamer 演示文稿中有以下表格,是否可以将表格在页面上稍微向上移动?

这是我的输出:

在此处输入图片描述

\documentclass {beamer}
\mode<beamer>{\usetheme{Madrid}}
\title[Test Title]{Test}
\usepackage{systeme}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, varwidth} 
\usepackage{enumitem}   
\setlist[itemize]{nosep,
                 leftmargin=*,
                 label=\tiny\color{black}$\blacksquare$,
                 after =\vspace{-\baselineskip},% <---
                 before=\vspace{-\baselineskip} % <---
                 }
\setenumerate{label=(\arabic*),itemsep=3pt,topsep=3pt}
\begin{document}
\begin{frame}{Title}
    \framesubtitle{Subtitle}
    \begin{table}[!htb]
    \small
\begin{tblr}{hlines, vlines,
             colspec = {Q[l,m] X X},
              row{1} = {font=\bfseries},
             measure = \ }
One & Two & Three \\
Method 1
& \begin{itemize}
      \item text
      \item text
      \item text
      \item text
  \end{itemize}
& \begin{itemize}
      \item text
      \item text
      \item text
      \item text
  \end{itemize} \\
Method 2
& \begin{itemize}
      \item text
      \item text
      \item text
      \item text
  \end{itemize}
& \begin{itemize}
      \item text
      \item text
      \item text
      \item text
  \end{itemize} \\
Method 3
& \begin{itemize}
      \item text
      \item text
      \item text
      \item text
  \end{itemize}
& \begin{itemize}
      \item text
      \item text
      \item text
      \item text
  \end{itemize} \\
Method 4
& \begin{itemize}
      \item text
      \item text
      \item text
  \end{itemize}
& \begin{itemize}
      \item text
      \item text
      \item text
  \end{itemize} \\
\end{tblr}
\end{table}
\end{frame}

\end{document}

编辑:

在此处输入图片描述

答案1

尝试这个更新系统中的代码..

它将生成一个在框架中垂直居中的表格。

如果不是这种情况,请检查是否需要更新任何软件包。

添加 \listfiles.log文件中列出所有已加载的文件并与我的输出进行比较。

环境table增加了不必要的空间。

还纠正了measure编译您的代码。 当单元格包含垂直材料时,measure = vbox需要varwidth测量单元格的宽度,就像在这种情况下一样。

请注意, after =\vspace{-\baselineskip}无法正常工作,您会收到警告varwidth,但 after=\vspace{<dimension>}可以正常工作。这就是使用的原因\vshift\the\vshift将导致-13.6pt(-)基线跳过。

b

我更改了列的规格,但这与问题无关。

% !TeX TS-program = pdflatex
    
\listfiles
\documentclass {beamer}
\mode<beamer>{\usetheme{Madrid}}
\title[Test Title]{Test}
%\usepackage{systeme}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, varwidth} 
\usepackage{enumitem}   

\newlength{\vshift}% added
\setlength{\vshift}{-\baselineskip}

\setlist[itemize]{
    nosep,
    leftmargin=*,
    label=\tiny\color{black}$\blacksquare$,
    after = \vspace{\the\vshift},% <--- changed
    before=\vspace{\the\vshift}, % <---
}

\begin{document}
    \begin{frame}{Title}
        \framesubtitle{Subtitle}
        \begin{table}[!htb]
            \small
            \begin{tblr}{hlines, vlines,
                    colspec = {Q[1,c, font=\bfseries]  X[2,c,m] X[2,c,m]}, % changed 
                    row{1} = {font=\bfseries},
                    measure = vbox } % changed <<<<<<<<<<<<<<<<
                One & Two & Three \\
                Method 1
                & \begin{itemize}
                    \item text
                    \item text
                    \item text
                    \item text
                \end{itemize}
                & \begin{itemize}
                    \item text
                    \item text
                    \item text
                    \item text
                \end{itemize} \\
                Method 2
                & \begin{itemize}
                    \item text
                    \item text
                    \item text
                    \item text
                \end{itemize}
                & \begin{itemize}
                    \item text
                    \item text
                    \item text
                    \item text
                \end{itemize} \\
                Method 3
                & \begin{itemize}
                    \item text
                    \item text
                    \item text
                    \item text
                \end{itemize}
                & \begin{itemize}
                    \item text
                    \item text
                    \item text
                    \item text
                \end{itemize} \\
                Method 4
                & \begin{itemize}
                    \item text
                    \item text
                    \item text
                \end{itemize}
                & \begin{itemize}
                    \item text
                    \item text
                    \item text
                \end{itemize} \\
            \end{tblr}
        \end{table}
    \end{frame}
    
\end{document}

.log 文件的输出

第一行

This is pdfTeX, Version 3.141592653-2.6-1.40.22 (MiKTeX 21.3) (preloaded format=pdflatex 2021.10.12)  30 NOV 2021 00:25
entering extended mode
**./myfile.tex myfile.tex LaTeX2e <2020-10-01> patch level 4 
L3 programming layer <2021-02-18>

在文件末尾

*File List*
beamer.cls    2021/03/19 v3.62 A class for typesetting presentations
beamerbasemodes.sty    
etoolbox.sty    2020/10/05 v2.5k e-TeX tools for LaTeX (JAW)
beamerbasedecode.sty    
ifpdf.sty    2019/10/25 v3.4 ifpdf legacy package. Use iftex instead.
iftex.sty    2020/03/06 v1.0d TeX engine tests
beamerbaseoptions.sty    
keyval.sty    2014/10/28 v1.15 key=value parser (DPC)
geometry.sty    2020/01/02 v5.9 Page Geometry
ifvtex.sty    2019/10/25 v1.7 ifvtex legacy package. Use iftex instead.
geometry.cfg
size11.clo    2020/04/10 v1.4m Standard LaTeX file (size option)
pgfcore.sty    2021/05/15 v3.1.9a (3.1.9a)
graphicx.sty    2020/09/09 v1.2b Enhanced LaTeX Graphics (DPC,SPQR)
graphics.sty    2020/08/30 v1.4c Standard LaTeX Graphics (DPC,SPQR)
trig.sty    2016/01/03 v1.10 sin cos tan (DPC)
graphics.cfg    2016/06/04 v1.11 sample graphics configuration
pdftex.def    2020/10/05 v1.2a Graphics/color driver for pdftex
pgfsys.sty    2021/05/15 v3.1.9a (3.1.9a)
pgfrcs.sty    2021/05/15 v3.1.9a (3.1.9a)
pgfrcs.code.tex
pgfsys.code.tex
pgfsyssoftpath.code.tex    2021/05/15 v3.1.9a (3.1.9a)
pgfsysprotocol.code.tex    2021/05/15 v3.1.9a (3.1.9a)
xcolor.sty    2016/05/11 v2.12 LaTeX color extensions (UK)
color.cfg    2016/01/02 v1.6 sample color configuration
pgfcore.code.tex
xxcolor.sty    2003/10/24 ver 0.1
atbegshi-ltx.sty    2020/08/17 v1.0a Emulation of the original atbegshi package
with kernel methods
hyperref.sty    2021-02-27 v7.00k Hypertext links for LaTeX
ltxcmds.sty    2020-05-10 v1.25 LaTeX kernel commands for general use (HO)
pdftexcmds.sty    2020-06-27 v0.33 Utility functions of pdfTeX for LuaTeX (HO)
infwarerr.sty    2019/12/03 v1.5 Providing info/warning/error messages (HO)
kvsetkeys.sty    2019/12/15 v1.18 Key value parser (HO)
kvdefinekeys.sty    2019-12-19 v1.6 Define keys (HO)
pdfescape.sty    2019/12/09 v1.15 Implements pdfTeX's escape features (HO)
hycolor.sty    2020-01-27 v1.10 Color options for hyperref/bookmark (HO)
letltxmacro.sty    2019/12/03 v1.6 Let assignment for LaTeX macros (HO)
auxhook.sty    2019-12-17 v1.6 Hooks for auxiliary files (HO)
kvoptions.sty    2020-10-07 v3.14 Key value format for package options (HO)
pd1enc.def    2021-02-27 v7.00k Hyperref: PDFDocEncoding definition (HO)
hyperref-langpatches.def    2021-02-27 v7.00k Hyperref: patches for babel languages
intcalc.sty    2019/12/15 v1.3 Expandable calculations with integers (HO)
etexcmds.sty    2019/12/15 v1.7 Avoid name clashes with e-TeX commands (HO)
puenc.def    2021-02-27 v7.00k Hyperref: PDF Unicode definition (HO)
url.sty    2013/09/16  ver 3.4  Verb mode for urls, etc.
bitset.sty    2019/12/09 v1.3 Handle bit-vector datatype (HO)
bigintcalc.sty    2019/12/15 v1.5 Expandable calculations on big integers (HO)
hpdftex.def    2021-02-27 v7.00k Hyperref driver for pdfTeX
atveryend-ltx.sty    2020/08/19 v1.0a Emulation of the original atvery package
with kernel methods
rerunfilecheck.sty    2019/12/05 v1.9 Rerun checks for auxiliary files (HO)
uniquecounter.sty    2019/12/15 v1.4 Provide unlimited unique counter (HO)
beamerbaserequires.sty    
beamerbasecompatibility.sty    
beamerbasefont.sty    
amssymb.sty    2013/01/14 v3.01 AMS font symbols
amsfonts.sty    2013/01/14 v3.01 Basic AMSFonts support
sansmathaccent.sty    2020/01/31
scrlfile.sty    2021/03/17 v3.33 KOMA-Script package (file load hooks)
scrlfile-hook.sty    2021/03/17 v3.33 KOMA-Script package (using LaTeX hooks)
scrlogo.sty    2021/03/17 v3.33 KOMA-Script package (logo)
beamerbasetranslator.sty    
translator.sty    2020-08-03 v1.12c Easy translation of strings in LaTeX
beamerbasemisc.sty    
beamerbasetwoscreens.sty    
beamerbaseoverlay.sty    
beamerbasetitle.sty    
beamerbasesection.sty    
beamerbaseframe.sty    
beamerbaseverbatim.sty    
beamerbaseframesize.sty    
beamerbaseframecomponents.sty    
beamerbasecolor.sty    
beamerbasenotes.sty    
beamerbasetoc.sty    
beamerbasetemplates.sty    
beamerbaseauxtemplates.sty    
beamerbaseboxes.sty    
beamerbaselocalstructure.sty    
enumerate.sty    2015/07/23 v3.00 enumerate extensions (DPC)
beamerbasenavigation.sty    
beamerbasetheorems.sty    
amsmath.sty    2020/09/23 v2.17i AMS math features
amstext.sty    2000/06/29 v2.01 AMS text
amsgen.sty    1999/11/30 v2.0 generic functions
amsbsy.sty    1999/11/29 v1.2d Bold Symbols
amsopn.sty    2016/03/08 v2.02 operator names
amsthm.sty    2020/05/29 v2.20.6
beamerbasethemes.sty    
beamerthemedefault.sty    
beamerfontthemedefault.sty    
beamercolorthemedefault.sty    
beamerinnerthemedefault.sty    
beamerouterthemedefault.sty    
beamerthemeMadrid.sty    
beamercolorthemewhale.sty    
beamercolorthemeorchid.sty    
beamerinnerthemerounded.sty    
beamerouterthemeinfolines.sty    
tabularray.sty    2021-09-01 v2021N Typeset tabulars and arrays with LaTeX3
expl3.sty    2021-02-18 L3 programming layer (loader) 
l3backend-pdftex.def    2021-03-18 L3 backend support: PDF output (pdfTeX)
xparse.sty    2021-01-09 L3 Experimental document command parser
xparse-2020-10-01.sty    
booktabs.sty    2020/01/12 v1.61803398 Publication quality tables
varwidth.sty    2009/03/30 ver 0.92;  Variable-width minipages
enumitem.sty    2019/06/20 v3.9 Customized lists
supp-pdf.mkii
epstopdf-base.sty    2020-01-24 v2.11 Base part for package epstopdf
epstopdf-sys.cfg    2021/03/18 v2.0 Configuration of epstopdf for MiKTeX
nameref.sty    2021-04-02 v2.47 Cross-referencing by name of section
refcount.sty    2019/12/15 v3.6 Data extraction from label references (HO)
gettitlestring.sty    2019/12/15 v1.6 Cleanup title references (HO)
q956v3.out
q956v3.out
translator-basic-dictionary-English.dict    
translator-bibliography-dictionary-English.dict    
translator-environment-dictionary-English.dict    
translator-months-dictionary-English.dict    
translator-numbers-dictionary-English.dict    
translator-theorem-dictionary-English.dict    
ninecolors.sty    2021/05/24 v2021C Select colors with proper color contrast
umsa.fd    2013/01/14 v3.01 AMS symbols A
umsb.fd    2013/01/14 v3.01 AMS symbols B
ot1mathkerncmss.fd    2020/01/31 Fontinst v1.933 font definitions for OT1/mathkerncmss.
***********

相关内容