matze / mtheme

A modern LaTeX Beamer theme
6.43k stars 845 forks source link

Problems with insert pdf figure #320

Open gapplef opened 6 years ago

gapplef commented 6 years ago

I try to insert pdf figure in beamer and encounter a problem similar to this one.

\documentclass{beamer}
\begin{document}
    \begin{frame}
        \centering
        \includegraphics[width=0.7\textwidth]{figure.pdf}
    \end{frame}
\end{document}

Without metropolis theme, the output pdf file is normal: screenshot 1

When using metropolis theme:

\documentclass{beamer}
\usetheme{metropolis}
\begin{document}
    \begin{frame}
        \centering
        \includegraphics[width=0.7\textwidth]{figure.pdf}
    \end{frame}
\end{document}

The result become: screenshot 2

With the solution given in the above link:

\documentclass{beamer}
\usetheme{metropolis}
\definecolor{myback}{RGB}{250, 250, 250}
\begin{document}
    \begin{frame}
        \centering
        {\color{myback}\includegraphics[width=0.7\textwidth]{figure.pdf}}
    \end{frame}
\end{document}

The result still have problem: screenshot 3

Finally I get a solution from this link

\documentclass{beamer}
\usetheme{metropolis}
\begin{document}
    \begin{frame}
        \centering
        \textcolor{black}{\includegraphics[width=0.7\textwidth]{figure.pdf}}
    \end{frame}
\end{document}

The result is much better, but still not normal: the background of figure is white not transparent like the first result. screenshot 4

matze commented 6 years ago

One quick solution would be to frame color to white as well using

\setbeamercolor{normal text}{bg=white}

However, if it were to me, I would just plot those functions with pgfplots and avoid all the hassle of including transparent PDFs.

shibumi commented 4 years ago

I have the same problem.. would be cool to have a solution for this.. the white background in PDFs is annoying (although the PDF should be transparent)..