110

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}

3 Answers 3

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}
4
  • 3
    The minipage approach does break allowframebreaks, while the changepage/adjustwidth approach works gorgeously, thanks.
    – stefanct
    Dec 6, 2018 at 15:55
  • What if I want to reduce left margin more than right margin? Thanks. May 4, 2019 at 9:03
  • @YanKingYin I guess the second argument is for the right margin Oct 10, 2019 at 7:33
  • What does it mean "use a list"? How the adjustwidth approach uses a list? Apr 2 at 23:24
65

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

2
  • 2
    This seems the most simple option. Nov 12, 2015 at 3:14
  • 2
    simple, and does the job perfectly
    – rll
    Apr 29, 2017 at 0:53
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

3
  • 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, 2018 at 14:39
  • yep, didn't work for me either.
    – PatrickT
    Nov 19, 2018 at 5:19
  • And it does not work with muti-page frames due to allowframebreaks.
    – stefanct
    Dec 6, 2018 at 15:35

You must log in to answer this question.

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