### Tags: bounding, box, eps, figure, hadthis, latex, matlab, messing, programming, runepstopdf, tells, ylabel

# latex ylabel messing up .eps bounding box

On Programmer » Matlab

1,668 words with 1 Comments; publish: Thu, 08 May 2008 00:02:00 GMT; (20078.13, « »)

I want to use LaTeX to make my ylabel for a figure. I then run

epstopdf on it, and it tells me there's no bounding box. I've never had

this trouble when I didn't use the latex interpreter in the ylabel. (I

tried with single and double dollar signs, and both give the same

error.

Here's a sample code:

plot(rand(5))

ylabel(gca,'$$|| \vec{\mathcal

E}||^2_2$$','Rotation',90,'Interpreter',

'latex','fontsize',18)

print -deps2 test.eps

!epstopdf test.eps

which gives the following warning.

=3D=3D> Warning: BoundingBox not found!

the pdf file that it produces is full-page

using the command 'orient landscape' makes this okay, since it now

takes up a whole page, but I shouldn't have to do this. Suggestions?

*http://matlab.todaysummary.com/q_matlab_33543.html*

All Comments

Leave a comment...

- 1 Comments
- sarahroy.matlab.todaysummary.com.gmail.com wrote:
> I want to use LaTeX to make my ylabel for a figure. I then run

> epstopdf on it, and it tells me there's no bounding box.

> Suggestions?

I also have this problem. I think it may be a bug in Matlab.

As a work-around you can edit the eps file manually to add the missing

bounding box. To be more explicit, create the figure with the Latex

interpreter turned off. Open the EPS file in a text editor and look for

the line '%%BoundingBox' followed by 4 numbers. Copy this and re-create

the figure, now with the Latex interpreter turned on. Open the

resulting EPS file and insert the BoundingBox information you copied

earlier.

You can script something to automate this process.

#1; Thu, 08 May 2008 00:03:00 GMT

- sarahroy.matlab.todaysummary.com.gmail.com wrote: