GeneralExporting clipped Figures

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
User avatar
cbustaam
Posts: 57
Joined: Mon Sep 01, 2008 10:17 pm

Exporting clipped Figures

Post by cbustaam »

Hey all,

I'm preparing an article which contains figures. As the figures have some blank spaces in all the four margins, I used the clipping option to get ride of such white space when compiling.

I'm wondering if there is a way to export the figure files just as LaTeX read it, i.e after clipping and in the scale used. Thoughts?

Code: Select all

\documentclass{article}
\usepackage{graphicx}

\begin{document}
  \begin{figure}[!htb]
    \centering
    \includegraphics[bb=125bp 250bp 490bp 540bp,clip,scale=0.5]{myfigfile.pdf}
    \caption{My Figure}
  \end{figure}
\end{document}
"Show me your .emacs and I'll tell you who you are." -- modified proverb

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
localghost
Site Moderator
Posts: 9201
Joined: Fri Feb 02, 2007 12:06 pm

Exporting clipped Figures

Post by localghost »

cbustaam wrote:[…] As the figures have some blank spaces in all the four margins, I used the clipping option to get ride of such white space when compiling. […]
For PDF files it would be much smarter to use the pdfcrop Perl script and cut them to size before they are included into a document. This needs of course a Perl interpreter like Strawberry Perl (for Wind0ws) installed.


Remarks:
  • Suffixes (like .pdf here) for included graphics files can be dropped. The graphicx package will find the file even without file type specification as long as it is present in one of the accepted formats (JPG, PDF, PNG for PDFLaTeX).

Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes[/size]

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1
User avatar
cbustaam
Posts: 57
Joined: Mon Sep 01, 2008 10:17 pm

Re: Exporting clipped Figures

Post by cbustaam »

Thanks localghost. The pdfcrop script is just what I need. It worked perfect!
"Show me your .emacs and I'll tell you who you are." -- modified proverb
Post Reply