1

I am trying to fit something in a beamer slide so that it covers the entire frame width, but what I get seems to be offset to the right by \hoffset. Here is a MWE:

\documentclass{beamer}

\usepackage{adjustbox}

% No navigation symbols. %
\setbeamertemplate{navigation symbols}{}

\begin{document}

\begin{frame}[plain]
%
\centering
%
\begin{adjustbox}{%
  max totalsize={\paperwidth}%
                {\dimexpr\paperheight-\voffset\relax}}
%
% Something larger than paperwidth, so that scaling is necessary.
\adjustbox{width=1.2\paperwidth}{Test text.}
%
\end{adjustbox}
%
\end{frame}

\end{document}

The above produces the following:

enter image description here

As can be seen, there is some empty space on the left. Moreover, the contents don't really seem to actually have a width of \paperwidth.

What is the right way of achieving this? I would like to avoid playing around with \usebackgroundtemplate, as something like Image on full slide in beamer package seems very ad-hoc to me.

1

With the current version of adjustbox just add the center key at the very end. There is also no need to use \dimexpr anymore. This has been fixed.

\documentclass{beamer}

\usepackage{adjustbox}

% No navigation symbols. %
\setbeamertemplate{navigation symbols}{}

\begin{document}

\begin{frame}[plain]
%
\centering
%
\begin{adjustbox}{%
  max totalsize={\paperwidth}{\paperheight-\voffset}, center}
%
% Something larger than paperwidth, so that scaling is necessary.
\adjustbox{width=1.2\paperwidth}{Test text.}
%
\end{adjustbox}
%
\end{frame}

\end{document}

enter image description here

4

TeX doesn't centre stuff which is wider than the text width. In that case it always starts at the left margin. To fix this, change the width that the typesetting algorithm sees to something which fits into the width with \makebox:

\documentclass{beamer}

\usepackage{adjustbox}

% No navigation symbols. %
\setbeamertemplate{navigation symbols}{}

\begin{document}

\begin{frame}[plain]
%
\centering
%
\makebox[\textwidth]{%
\begin{adjustbox}{%
  max totalsize={\paperwidth}%
                {\dimexpr\paperheight-\voffset\relax}}%
%
% Something larger than paperwidth, so that scaling is necessary.
\adjustbox{width=1.2\paperwidth}{Test text.}%
%
\end{adjustbox}%
}%
\end{frame}

\end{document}

enter image description here

  • This is pretty good, but I now get some empty space to the right of the text. – dow Apr 3 '18 at 6:45
  • @dow there were som missing % to end the line. Now it should work. – Skillmon Apr 3 '18 at 9:53
  • 1
    You could shorten this to \begin{frame}[plain] \begin{adjustbox}{width=1.2\paperwidth, max totalsize={\paperwidth}{\dimexpr\paperheight-\voffset\relax}, center} Test text. \end{adjustbox} \end{frame}. – Martin Scharrer Apr 3 '18 at 15:16
  • @MartinScharrer the adjustbox{width=1.2\paperwidth}{Test text.} is a left over from OP who wanted to see how the code works with stuff that is actually oversized. I didn't remove that because I saw no point in doing so (though the reresizing is lets say less than ideal). – Skillmon Apr 3 '18 at 18:39

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.