113

I need help for modifying the margins for only one slide in the beamer class

In other words, I need a local version of

\setbeamersize{text margin left=<size>,text margin right=<size>} 

in here

\documentclass{beamer}
\usetheme{Rochester}
\usepackage{lipsum}

\setbeamersize{text margin left=5pt,text margin right=5pt}

\begin{document}

\begin{frame}
\lipsum[2]
\end{frame}

\end{document}
Joseph Wright
  • 259,911
  • 34
  • 706
  • 1,036
Arada
  • 1,173

3 Answers3

85

You can define a command for this using a minipage of the desired width inside a \makebox (using the optional argument you can change the default value of 3em to any desired value):

\documentclass{beamer}
\usetheme{Rochester}
\usepackage{lipsum}

\newcommand\Wider[2][3em]{%
\makebox[\linewidth][c]{%
  \begin{minipage}{\dimexpr\textwidth+#1\relax}
  \raggedright#2
  \end{minipage}%
  }%
}

\begin{document}

\begin{frame}
\lipsum[2]
\end{frame}

\begin{frame}
\Wider{\lipsum[2]}
\end{frame}

\begin{frame}
\Wider[4em]{\lipsum[2]}
\end{frame}

\end{document}

enter image description here

Another option, would be to use a list, and this can be easily done using adjustwidth from the changepage package:

\documentclass{beamer}
\usetheme{Rochester}
\usepackage{changepage}
\usepackage{lipsum}

\begin{document}

\begin{frame}
\lipsum[2]
\end{frame}

\begin{frame}
\begin{adjustwidth}{-1.5em}{-1.5em}
\lipsum[2]
\end{adjustwidth}
\end{frame}

\begin{frame}
\begin{adjustwidth}{-2em}{-2em}
\lipsum[2]
\end{adjustwidth}
\end{frame}

\end{document}
Gonzalo Medina
  • 505,128
68

Here is another solution using a columns environment with a single column:

\documentclass{beamer}
\usetheme{Rochester}
\usepackage{lipsum}

\begin{document}
\begin{frame}
  \begin{columns}
    \column{\dimexpr\paperwidth-10pt}
    \lipsum[2]
  \end{columns}
\end{frame}
\end{document}

enter image description here

Paul Gaborit
  • 70,770
  • 10
  • 176
  • 283
10

Based on the minipage approach of the Answer of Gonzalo you can also introduce a new frame environment (environ package required) which is neat option if you'd like to use consistent wider frames for multiple slides or regularly want to change the textwidth of the whole slide.:

\documentclass{beamer}

\usetheme{Rochester}
\usepackage{lipsum}
\usepackage{calc}
\usepackage{environ}

\newcommand{\halfmargin}{0.05\paperwidth}
\newcommand{\margin}{0.10\paperwidth}

\beamersetrightmargin{\margin}
\beamersetleftmargin{\margin}

\NewEnviron{wideframe}[1][]{%
\begin{frame}{#1}
\makebox[\textwidth][c]{
\begin{minipage}{\dimexpr\paperwidth-\halfmargin-\halfmargin\relax}
\BODY
\end{minipage}}
\end{frame}
}

\begin{document}

\begin{frame}
\lipsum[2]
\end{frame}

\begin{wideframe}
\lipsum[2]
\end{wideframe}

\end{document}

enter image description here

  • 1
    This would be nice but has some drawbacks: it breaks the heading format for some reason and it breaks frame options, e.g. \begin{wideframe}[noframenumbering]{Abbreviations} will create a slide with "noframenumbering" as title and "Abbreviations" as subtitle. – stefanct Oct 17 '18 at 14:39
  • yep, didn't work for me either. – PatrickT Nov 19 '18 at 05:19
  • And it does not work with muti-page frames due to allowframebreaks. – stefanct Dec 06 '18 at 15:35