0

I have created an image with Inkscape and saved it as a pdf_tex to import it into my LaTeX document.

My problem is that the picture only uses half of a page but imported into LaTeX with

\begin{figure}[htb!]
    \resizebox{\textwidth}{!}{\input{fig.pdf_tex}}  
\caption{Caption}
\end{figure}

creates a whole page for the picture i.e the picture is on the top and the rest is filled with a blank side.

Can I only import the parts of the pdf that contain the actual image or is there a better way to resolve the issue?

1
  • If you use the \input-command, you are inserting LaTeX-code. Just open the file in your usual LaTeX editor and do what ever is needed, to improve the results. If your above code is not correct, and you are using the \includegraphics-command (which I doubt), than you should try to use the [bb=llx lly urx ury,clip] options of that command, to define a bounding box within your pdf file (defined by the lower left corner (ll) and the upper right corner (ur)). Option clipwill cut anything outside that box.
    – Jan
    Jan 12, 2017 at 14:23

1 Answer 1

1

There's a better way (usually better) -- fix the drawing in inkscape:

In inkscape, press Ctrl+A (or edit|select all) then Ctrl+Shift+D (or file|document properties). Then click the + sign next to "Resize page to content" and "Resize page to drawing or selection". You should see the page border shift to tightly surround the drawing (if you didn't select all, undo and try again, you can also drag-select around everything you want). Save the .pdf and compile the .tex file again.

With the graphicx package you can pass the trim and clip options to crop (e.g. \includegraphics[trim={0 0 5cm 0},clip]{example-image-a}), but you need to manually specify the cropping parameters. This answer has the details.

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .