[OS X TeX] trim pdf figures

Ross Moore ross at maths.mq.edu.au
Tue Jun 22 10:07:00 CEST 2004


Hi Bruno, and Alain,


On 22/06/2004, at 4:46 PM, Bruno Voisin wrote:

> Le 22 juin 04, à 06:54, Alain Schremmer a écrit :
>
>> When I create a figure in Intaglio, save it there in pdf, and drag it 
>> to be "included" into my TeX file, TeXshop typesets the whole, mostly 
>> blank Intaglio page.
>>
>> Of course, I can trim each page down to the figure but, given the 
>> number of different size figures I have, I would rather not.
>>
>> I am told that this is not a problem with eps but I would rather stay 
>> with pdf.
>
> All the software that I know (Adobe Illustrator, Mathematica, etc.), 
> that can export graphics to PDF format, export the graphics inside a 
> page of size the current paper size. I just can't understand why this 
> is so, since who needs a graphics on a mostly blank page? Is it only 
> laziness from the software providers?

With LaTeX's graphicx package you can clip any graphic to any desired 
rectangle:
e.g.
    \includegraphics[viewport=170 300 420 735,clip]{imagefile}
                              ^^^^^^^^^^^^^^^
    experiment to get the numbers right, or use other software to locate
    suitable corners: here we have lower-left=(170,300) 
upper-right=(420,735).

This works with whatever graphics formats the (La)TeX engine supports.
There is no appreciable difference in file size with or without the 
`viewport',
since this defines a clipping region for viewing the graphic; it doesn't
change the graphic itself.



By the way, with Mathematica you can export to the natural size of the 
graphic,
using the Display[...] or Export[...] functions.
Check all the options (e.g. image format) that these built-in functions 
support.

>
> What I generally do is export to EPS format instead of PDF, then drag 
> onto TeXShop (or apply epstopdf from the command line) to have the EPS 
> file converted to PDF; I was doing the same before in Mac OS 9 with 
> MacGSView. The PDF files produced in this way have the proper size of 
> the graphics, not that of an A4 sheet.

Yes; this is the technique that I usually use too, ...


   ... but, what does "proper size" refer to ?
There are 5 different kinds of box dimensions that can be associated
with a PDF document:  /MediaBox  /TrimBox  /CropBox  /BleedBox  /ArtBox 
.

Consult the PDF Specs to find out what these all mean, and how they 
should
affect the appearance of an image embedded within a larger PDF document.

In practice, though, just follow techniques that seem to work.



Best regards,

	Ross

>
> Hope this helps,
>
> Bruno Voisin
>
> -----------------------------------------------------
> Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
> Please see <http://www.esm.psu.edu/mac-tex/> for list
> guidelines, information, and LaTeX/TeX resources.
>
>
>
>
------------------------------------------------------------------------
Ross Moore                                         ross at maths.mq.edu.au
Mathematics Department                             office: E7A-419
Macquarie University                               tel: +61 +2 9850 8955
Sydney, Australia                                  fax: +61 +2 9850 8114
------------------------------------------------------------------------

-----------------------------------------------------
Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
Please see <http://www.esm.psu.edu/mac-tex/> for list
guidelines, information, and LaTeX/TeX resources.





More information about the macostex-archives mailing list