0

I have the following table in beamer presentation, is it possible to move the table slightly up in the page?

This is my output:

enter image description here

\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}

EDIT:

enter image description here

4

1 Answer 1

3

Try this updated code in your system..

It will produce a table centered vertically in the frame.

If this is not the case, check if any packages need to be updated.

Added \listfiles to list in the .log file all the files loaded and compare with my output.

The table environment adds unnecessary spaces.

Also corrected measure to compile you code. measure = vbox is needed for varwidth to measure the width of the cells when they contains vertical material, as in this case.

Note that after =\vspace{-\baselineskip} fails to work properly and you get warnings from varwidth, but after=\vspace{<dimension>} works fine. This is the reason to use \vshift: \the\vshift will result in -13.6pt, the (-) baseline skip.

b

I changed the columns specs but this is not related with the question.

% !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}

Output of the .log file

First lines

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>

At the end of the file

*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.
***********
3
  • Thanks!! I have tried your code but my output is slightly different from yours.. why? I have updated my question with the new output Nov 30, 2021 at 8:26
  • 1
    @John_maddon I guess it is because there is the word vbox at the left of your table that makes the shifting in your second picture.
    – Roland
    Nov 30, 2021 at 8:31
  • 1
    @John_maddon I updated my answer. Compile the new code in your system and compare the .log file with mine, to check if any package needs to be updated. Nov 30, 2021 at 13:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.