# Margin in output document generated by asymptote

In the following figure, generated using `asymptote`, I am getting a PDF file while compiling in a LaTeX document.

Labels and angles in crystal structure using Asymptote

The problem is, there is huge whitespace around the figure which I cannot crop using `pdfcrop`. I have tried to convert it using `ImageMagick` to JPG or PNG but it is completely destroying the resolution of the image.

How can I get a PDF or image file with no excess white space around ?

• If you have only a pdf file for the figure, you can crop it with Gimp for instance, no? – Ludovic C. Jul 14 '13 at 15:18
• I have tried cropping with Gimp also .. resolution gets damaged drastically. – cosmicraga Jul 14 '13 at 15:41
• You can also use the trim feature of the when you include your pdf graphic if pdfcrop fails: `\includegraphics[trim = 10mm 10mm 10mm 10mm]{picture.pdf}` where the dimensions are for left, bottom, right and top. – Alexander Jul 14 '13 at 17:01
• In this particular example, use `zoom=1` in `currentprojection`. Or interactively adjust the `3d` view to your needs with `asy -V <file>`. – g.kov Jul 15 '13 at 9:46
• \includegraphics[trim = 20mm 20mm 20mm 20mm,clip,width=\textwidth]{path/to/picture/pic.pdf}. This one worked. – cosmicraga Jul 21 '13 at 13:47

In this particular example, use `zoom=1` in `currentprojection`. Or interactively adjust the `3d` view to suit your needs with `asy -V <file>`.
In general included graphics can easily be cropped, trimmed, scaled and rotated using the commands from the `graphicx` package. For your purpose
``````\includegraphics[trim = 10mm 10mm 10mm 10mm]{picture.pdf}