2

Some (not all) slides in my beamer presentation need to have a wider text block. I know that I can use a columns env with a single column of arbitrary width, but that's a bit verbose. When I discovered changepage.sty it first seemed that the \adjustwidth env does precisely what I want.

However, I can't get beamer's block environment to play nice with \adjustwidth (cf part 5 in MWE below). What am I doing wrong ?

\documentclass{beamer}

\usecolortheme{orchid}
\setbeamertemplate{blocks}[rounded][shadow]

\usepackage{changepage}

\begin{document}
\begin{frame}

  \centerline{1}
  \rule{\linewidth}{1pt} % 1: used for reference

  \bigskip
  \bigskip
  \centerline{2}
  \begin{adjustwidth}{0pt}{0pt}
      \rule{\linewidth}{1pt} % looks fine
  \end{adjustwidth}

  \bigskip
  \bigskip
  \centerline{3}
  \begin{adjustwidth}{-1cm}{-1cm}
    \rule{\linewidth}{1pt} % looks fine too (i.e. full \paperwidth) 
  \end{adjustwidth}

  \bigskip
  \bigskip
  \centerline{4}
  \begin{adjustwidth}{-1cm}{-1cm}
    \rule{128mm}{1pt} % still fine (paper is 128mm wide by default)
  \end{adjustwidth}

  \bigskip
  \bigskip

  \centerline{5}
  \begin{adjustwidth}{-1cm}{-1cm}
    \begin{block}{}
      \rule{128mm}{1pt} % goes beyond the edge of the page

      \rule{\linewidth}{1pt} % does not have the intented length
    \end{block}
  \end{adjustwidth}

\end{frame}
\end{document}

2

You can define your own adjustwidth environment (based on columns environment):

\documentclass{beamer}

\usecolortheme{orchid}
\setbeamertemplate{blocks}[rounded][shadow]

%\usepackage{changepage}

\newenvironment{adjustwidth}[2]{
  \begin{columns}
    \column{\dimexpr\linewidth-#1-#2}
}{\end{columns}}

\begin{document}
\begin{frame}

  \centerline{1}
  \rule{\linewidth}{1pt} % 1: used for reference

  \bigskip
  \bigskip
  \centerline{2}
  \begin{adjustwidth}{0pt}{0pt}
      \rule{\linewidth}{1pt} % looks fine
  \end{adjustwidth}

  \bigskip
  \bigskip
  \centerline{3}
  \begin{adjustwidth}{-1cm}{-1cm}
    \rule{\linewidth}{1pt} % looks fine too (i.e. full \paperwidth) 
  \end{adjustwidth}

  \bigskip
  \bigskip
  \centerline{4}
  \begin{adjustwidth}{-1cm}{-1cm}
    \rule{128mm}{1pt} % still fine (paper is 128mm wide by default)
  \end{adjustwidth}

  \bigskip
  \bigskip

  \centerline{5}
  \begin{adjustwidth}{-1cm}{-1cm}
    \begin{block}{}
      \rule{128mm}{1pt} % goes beyond the edge of the page

      \rule{\linewidth}{1pt} % does not have the intented length
    \end{block}
  \end{adjustwidth}

\end{frame}
\end{document}

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.