tags:

views:

111

answers:

4

Hi,

I'd like to create a pdf/ps/eps that contains only one single formula. I thought the easiest way would be to use latex. Unfortunately, I found no option to specify, that the paper-size should automatically be set to fit the contents.

I found that dvipng has a "-T tight" option, that actually does the trick, but... I want it in vector-graphics format.

Any suggestions?

Thanks.

A: 

Fixing the bounding box of generated EPS should help:

epstopdf --gsopt=-dEPSCrop blah.eps

or eps2pdf has a -B option that detects the tightest possible Bounding Box.

zoli2k
A: 

for Mac, there is a little app called LaTeXit which does exactly that. http://chachatelier.fr/programmation/latexit_en.php

Mica
+2  A: 

Try pdfcrop, it crops your pdf to the minimum. You need to have Perl installed.

Juri Robl
A: 

Somewhat perversely, you can generate your Tex using Metapost: include your formula between btex and etex tags, and compile it following the instructions in either mptopdf(1) (prefered, part of pdftex) or mpost(1) (you'll need to run Tex separately as well, I think). It is perverse to invoke Metapost just to have it invoke Tex, but it you will get formula-sized output without any evil pdf hackery.

If you need any Latex (as opposed to plain Tex), then you need a bit of boilerplate to get this to work, cf. LaTeX labels in MetaPost.

Charles Stewart