4

I want to reduce the margin size for one slide so I can put a wider table into it. I have this MWE:

\documentclass{beamer}
\usepackage{geometry}
\usepackage{tabularray}
\setbeamertemplate{frametitle}[default][center]
\begin{document}


\begin{frame}{Title at the top}
\end{frame}


\newgeometry{left=0.7cm, right=0.7cm}%, top=1cm, bottom=1cm} % Adjust margins for the next frame
\begin{frame}{Title much lower down}
\begin{table}
\begin{tblr}{
  hlines,
  colspec={XXX},
  row{1}={font=\bfseries,halign=c},
  row{2-Z}={font=\small}
}
\large Day 1 & \large Day 2 & \large Day 3 \\ 

\end{tblr}
\end{table}
\end{frame}
\end{document}

This works well except that the title of the second slide is not at its usual position. It is much lower down the page.

How can it be moved back to its usual position?

3
  • 2
    you don't need geometry, just let the table extend into the margin. Commented May 26 at 18:50
  • @DavidCarlisle How do you do that? It seems tabularray automatically adjusts its width depending on the margin size.
    – Simd
    Commented May 26 at 18:51
  • you can use width=1.2\textwidth to make the tblr wider and then aduguse with \hspace*{-.1\textwidth} to compensate Commented May 26 at 18:53

2 Answers 2

3

Another way is to use changepage package and extend \textwidth just for table (as suggested @David in his comment):

\documentclass{beamer}
\usepackage{tabularray}
\setbeamertemplate{frametitle}[default][center]
\usepackage{changepage}

\begin{document}

\begin{frame}
\frametitle{Title much lower down}
\begin{adjustwidth}{-1em}{-1em}
\begin{tblr}{hlines,
  colspec={XXX},
  row{1}={font=\large\bfseries, c},
  row{2-Z}={font=\small}
}
Day 1   &   Day 2   &   Day 3   \\ 
\end{tblr}
\end{adjustwidth}

\rule{\textwidth}{3pt}
\end{frame}
\end{document}

enter image description here

1
  • I accepted this as it seems every so slightly simpler than the other very good answer. Thank you.
    – Simd
    Commented May 28 at 16:24
3

You can use columns to temporarily change the margins:

\documentclass{beamer}
\usepackage{tabularray}
\setbeamertemplate{frametitle}[default][center]
\begin{document}

\begin{frame}
\frametitle{Title much lower down}
\begin{columns}
\begin{column}{.95\paperwidth}
\begin{tblr}{
  hlines,
  colspec={XXX},
  row{1}={font=\bfseries,halign=c},
  row{2-Z}={font=\small}
}
\large Day 1 & \large Day 2 & \large Day 3 \\ 
\end{tblr}
\end{column}
\end{columns}
\end{frame}
\end{document}

enter image description here

1
  • Thank you very much.
    – Simd
    Commented May 28 at 16:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .