Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'm new to beamer and am trying to make a presentation. When inserting an image, the output is satisfactory, except when I try to insert a .pdf! The white space in the image disappears. Initially, the image was a .ps, so I used ps2pdf14 to convert it to .pdf and then pdfcrop to add the amount of white space I desire. I can convert the .pdf to .png and it works fine, but the quality isn't good enough for big pictures. Is there a way to restore the white space when inserting the .pdf image? I apologize if this is a trivial question, or if I've simply over looked something.

Here's an example code to illustrate the problem

\documentclass[xcolor=svgnames,mathserif,serif]{beamer}
\usetheme{default}
\setbeamertemplate{navigation symbols}{}
\setbeamertemplate{frametitle}[default][center]
\definecolor{myblue}{RGB}{47,94,142}
\setbeamercolor{background canvas}{bg=myblue}
\usefonttheme{structuresmallcapsserif}
\setbeamercolor{title}{fg=white}
\setbeamercolor{titlelike}{fg=white}
\setbeamercolor{normal text}{fg=white}
\title{Sample Title}
\author{\large{Me}}
\institute{\small{University}}
\date{\small{Today's Date}}
\begin{document}

\begin{frame}
\titlepage
\end{frame}

\begin{frame}{Sample Title}
\begin{center}
\includegraphics[width=3in]{1.pdf} %why isn't white space appearing?
\end{center}
\end{frame}

\end{document}
share|improve this question
    
Welcome to TeX.sx! A tip: You can use backticks ` to mark your inline code; also, if you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). –  henrique Oct 13 '12 at 4:07
1  
I'm not sure what exactly you mean by whitespace (perhaps since we don't have 1.pdf). For example, do you have an image of size (say) 2in by 3in and you want it to have space around it, actually setting to a size of (say) 3in by 4in? –  Werner Oct 13 '12 at 4:23
    
thank you for the tip! –  CajunP Oct 13 '12 at 5:59
    
currently, the .pdf has black text, but the background matches my slide when it should have a white background. yes, I believe that is what I want, Werner. I used the command: pdfcrop --margins 5 sample.pdf sample.pdf to add a small amount of whitespace around the image. I want the image to look like the pdfcropped one. converting to .png works fine, but the .pdf version doesn't –  CajunP Oct 13 '12 at 6:06
1  
pdf background is transparent, not white. You can force a white background including it into a colorbox. Something like \colorbox{white}{\includegraphics{1.pdf}}. –  Ignasi Oct 13 '12 at 8:16
show 2 more comments

1 Answer

pdf images has a transparent background, so even with a border, when you include them over a colored background the"white border" disappears. The easiest solution would be to include your figure into a white box with \colorbox{white}{\includegraphics{your-pdf-figure}}. This way figure's background and border are white.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.