3

I have a beamer presentation where the text is in white and the background is black. For some frames I would like to import some pdfs but have them exactly as they are normally. That is all the white space should still be white. The effect should be a white rectangle in the middle of the screen which has the pdf with black borders all around. I think the issue is transparency so I really want to make the transparent parts of the pdf white.

How can you do this?

Here is a skeleton MWE.

\documentclass[xcolor=svgnames]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}

\setbeamerfont{title}{size=\Huge}
\setbeamercolor{background canvas}{bg=black}
\setbeamercolor{normal text}{fg=white}
\setbeamercolor{title}{fg=white}
\setbeamercolor{frametitle}{fg=yellow}

\begin{document}
 \begin{frame}
  \begin{center}
\begin{figure}
 \includegraphics[width = 7cm]{pdf-page}
\end{figure}
\end{center}
 \end{frame}

\end{document}

  • Package pdfpages? – JPi Aug 6 '14 at 20:42
  • 2
    I'm not sure, but why don't you superimpose the pdf with transparency on a uniformly white pdf? – anderstood Aug 6 '14 at 20:43
  • 1
    percusse gave me a solution. The main part is to define \usepackage{tcolorbox}% \newtcolorbox{mybox}{ arc=0pt, boxrule=0pt, colback=white, width=0.7\textwidth, % this option controls the width of the box } – Lembik Aug 6 '14 at 20:43
  • @anderstood That is basically the solution percusse gave me, thank you. – Lembik Aug 6 '14 at 20:44
  • then, I can be proud! :) – anderstood Aug 6 '14 at 20:46
8

Maybe you can use a simple \colorbox:

\documentclass[xcolor=svgnames]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{mwe}% to get an example image

\setbeamerfont{title}{size=\Huge}
\setbeamercolor{background canvas}{bg=black}
\setbeamercolor{normal text}{fg=white}
\setbeamercolor{title}{fg=white}
\setbeamercolor{frametitle}{fg=yellow}

\begin{document}
\begin{frame}
   \begin{center}
   {\setlength\fboxsep{0pt}%
      \colorbox{white}{\includegraphics[width = 7cm]{example-image-a4-landscape}}%
   }
  \end{center}
\end{frame}
\end{document}

enter image description here

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.