3

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 ?

cosmicraga
  • 2,630
  • 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
  • 2
    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
  • 1
    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 09:46
  • 1
    \includegraphics[trim = 20mm 20mm 20mm 20mm,clip,width=\textwidth]{path/to/picture/pic.pdf}. This one worked. – cosmicraga Jul 21 '13 at 13:47

2 Answers2

1

In this particular example, use zoom=1 in currentprojection. Or interactively adjust the 3d view to suit your needs with asy -V <file>.

g.kov
  • 21,864
  • 1
  • 58
  • 95
1

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}

might help. Here the dimensions are the amount that is trimmed from the left, bottom, right and top of the picture. A thorough description of more feature are given here.

Alexander
  • 9,163