# How to prevent a pdf-figure to overlay text?

I have a pdf-figure which I want to include in my tex-file. I wrote the following line of code to insert the figure in my file:

\includegraphics[width=.8\textwidth, bb=0cm 12.5cm 26cm 15.5cm]{./images/FA/subsystems.pdf}


The result I get in my file is that the figure is overlapping with text.

Somewhere else in the code, I used the exact same way of including another pdf-figure in the file and this worked fine, without overlap:

\includegraphics[width=.4\textwidth, bb=0cm 25cm 8.5cm 29cm]{./images/BladePitch.pdf}


Does anybody have an idea on how to position the figure somewhere without overlapping text?

• why are you specifying a bounding box? bb= Presumably that is not the same as the natural size of the figure which is why it is overprinting. – David Carlisle Apr 2 '14 at 14:11
• PDF figures can have either a transparent background or a white (or other color) background. Perhaps you want one with transparency to allow the text to show through? – cslstr Apr 2 '14 at 14:17
• Actually, I want the figure not to overprint the text at all. I use the bounding box because the pdf-file I use is just white apart from the part I am bounding here. I made this figure in PowerPoint and saved it as a pdf, so the size of the pdf-file is the same as a ppt-sheet. – Josif Apr 2 '14 at 14:21
• you might try using the pdf-crop tool to get rid of the extra blank space around the edges. make sure there isn't a page number on the powerpoint output. – barbara beeton Apr 2 '14 at 14:39

The preferred option is to crop the whitespace from the PDF file directly. If for some reason this is not possible, I provide a few options in this answer.

Using the bb option by design does overprinting. If you want the portion outside the specified bounding box to not be printed, you have to set the clip option or equivalently, use the starred form \includegraphics*[<options>]{<basename>}.

Here are some examples, where the \fbox{} is only added to show the specified bounding box area:

\documentclass{article}
\usepackage{mwe}
\fboxsep=0pt
\def\test#1#2{\fbox{\includegraphics#1[scale=0.5,#2]{example-image-a}}\vfill}

\begin{document}
\test{}{}
\test{}{bb=0cm 1cm 5cm 9cm}
\test{}{bb=0cm 1cm 5cm 9cm,clip}
\test{*}{bb=0cm 1cm 5cm 9cm}
\end{document}


In any case, it's not really clear what is overprinting anyway: if you correctly specified bb to include only the printed content, nothing should overprint because according to your comments there was only whitespace outside the supposed specified bb.

For debugging the setting of bb, you can temporarily wrap \includegraphics with \fbox{} to see the area contained by bb as I have shown here. Or, as I said at the beginning: go the easy route and just crop the original PDF file (or a copy of it).