Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Question: How to remove black box round eps figure

1,328 views
Skip to first unread message

Paul Cohen

unread,
Apr 1, 2003, 7:46:41 AM4/1/03
to
Hi,

Does anyone know how I can remove the black box around an EPS figure
that I am using in a LaTeX document?

I am on Windows NT running MiKTeX 2.2.

I've created the figure in Visio 2000 and printed it to a EPS file using
the Adobe Universal Postscript Driver. I then fixed the bounding box
using GSview (and saved to new EPS file). I am using the package
graphicx to include the image in my LaTeX document. So far so good. The
image is included in the document and looks good (which it definitely
didn't when I did "Save as .." to an EPS file in Visio). However there
is a black box surrounding the image that I want to get rid of.

I have looked for info on this and most people seem to suggest that I
have to to edit the EPS file and remove the PostScript commands that
generate the black box. However, in all the documentation I have read,
people refer to PostScript commands that I simply cannot find in my EPS
file.

Any help on this would be much appreciated.

/Paul

Stefan Lagotzki

unread,
Apr 1, 2003, 8:05:16 AM4/1/03
to
Trim the figure:

\includegraphics[trim=left bottom right top,clip,
(other options)]{filename}

'left' 'bottom' 'right' and 'top' are the dimensions
of the black margins you want to trim. Example:

\includegraphics[trim=5mm 5mm 5mm 5mm,clip]{visio01.eps}

Stefan

.

Cameron, Charles B.

unread,
Apr 1, 2003, 8:43:32 AM4/1/03
to
Paul Cohen wrote:

I use the Apple LaserWriter V23.0 and it does not create the boxes you
describe. Could it be that your universal driver is adding them?

Visio 2000 does not add such a box by itself. To get a properly trimmed
figure,

1. Select File, Page Setup, tab Page Size, Size to fit drawing contents.
2. Let Visio create a .ps (not a .eps) file using print-to-file with
the Apple LaserWriter V23.0 driver.
3. Use GhostScript to convert it to a .eps file.
4. Include the resultant .eps file in your LaTeX source.

Files I create this way never have an unwanted frame around them.

Charles B. Cameron


Paul Cohen

unread,
Apr 1, 2003, 8:48:57 AM4/1/03
to
Hi Stefan,

Stefan Lagotzki wrote:

If I write:

\includegraphics[trim=8mm 8mm 8mm 8mm,scale=0.75]{visio01.eps}

The black box is removed but the \caption{Bla bla} underneath the figure
is moved up 8 mm so that it slightly "overlays" the bottom part of the
figure. (I need to scale down the image as well)

If I write:

\includegraphics[trim=8mm 8mm 8mm 8mm,clip,scale=0.75]{visio01.eps}

The black box is not removed but the figure is clipped.

Any ideas?

/Paul

Paul Cohen

unread,
Apr 1, 2003, 9:05:57 AM4/1/03
to
Hi Charles,

"Cameron, Charles B." wrote:

> >
> I use the Apple LaserWriter V23.0 and it does not create the boxes you
> describe. Could it be that your universal driver is adding them?
>

Possibly so.

> Visio 2000 does not add such a box by itself. To get a properly trimmed
> figure,
>
> 1. Select File, Page Setup, tab Page Size, Size to fit drawing contents.
> 2. Let Visio create a .ps (not a .eps) file using print-to-file with
> the Apple LaserWriter V23.0 driver.
> 3. Use GhostScript to convert it to a .eps file.
> 4. Include the resultant .eps file in your LaTeX source.
>
> Files I create this way never have an unwanted frame around them.
>

The problem with this is that for my figures the PostScript image generated by
Visio is really bad. The images are *much* better when I use the Universal
PostScript Driver to save them in an .eps file.

/Paul

Mats Löfdahl

unread,
Apr 1, 2003, 9:33:22 AM4/1/03
to
Paul Cohen <pa...@enea.se> writes:

Try manipulating the bounding box with \includegraphics[bb=llx lly urx
ury,clip,scale=0.75]{visio01.eps}. You can get suitable bounding box
values by reading the file into ghostview and moving the mouse pointer
to positions just outside the field of view you want. Ghostview
displays the pointer coordinates.


--
-- Mats Löfdahl --
--

Paul Cohen

unread,
Apr 2, 2003, 2:14:41 AM4/2/03
to
Hi!

Mats Löfdahl wrote:

> Try manipulating the bounding box with \includegraphics[bb=llx lly urx
> ury,clip,scale=0.75]{visio01.eps}. You can get suitable bounding box
> values by reading the file into ghostview and moving the mouse pointer
> to positions just outside the field of view you want. Ghostview
> displays the pointer coordinates.

Unfortunately the black box remains. The bounding box is shrunk as expected
but all I achieve is clipping the actual figure and the black box remains!

I have "solved my problem" by doing the following:

\fbox{\includegraphics[trim=8mm 8mm 8mm 8mm,scale=0.75]{visio01}}
\vspace{8mm}
\caption{Example of an Visio figure created with ``Print ...'' (to EPS file)}

I still haven't figured out why I get a black box in the first place. And I
would rather not be forced to add "unneccessary" \vspace commands when
including figures in my document. But okay, it looks good for me now anyway!

Thanks to all you who took time to reply to my question!

/Paul

Heiko Oberdiek

unread,
Apr 2, 2003, 3:54:53 AM4/2/03
to
Paul Cohen <pa...@enea.se> wrote:

> \includegraphics[trim=8mm 8mm 8mm 8mm,scale=0.75]{visio01.eps}
>
> The black box is removed but the \caption{Bla bla} underneath the figure
> is moved up 8 mm so that it slightly "overlays" the bottom part of the
> figure. (I need to scale down the image as well)

No, that's wrong. The distance between the graphics and caption
remains the same. But you should set option clip.

> If I write:
>
> \includegraphics[trim=8mm 8mm 8mm 8mm,clip,scale=0.75]{visio01.eps}
>
> The black box is not removed but the figure is clipped.

The line is correct. Either you are wrong here, or the .eps file is
not EPS. Try printer driver of adobe with option eps.
Or convert the eps file by converting to pdf and back to PostScript by
pdftops (xpdf) or AR.

Yours sincerely
Heiko <ober...@uni-freiburg.de>

Paul Cohen

unread,
Apr 2, 2003, 7:45:08 AM4/2/03
to
Hi,

Heiko Oberdiek wrote:

> Paul Cohen <pa...@enea.se> wrote:
> > If I write:
> >
> > \includegraphics[trim=8mm 8mm 8mm 8mm,clip,scale=0.75]{visio01.eps}
> >
> > The black box is not removed but the figure is clipped.
>
> The line is correct.

If I use the option clip the blackbox remains and the *figure* is clipped.

> Either you are wrong here, or the .eps file is
> not EPS. Try printer driver of adobe with option eps.

That is exactly what I have done.

>
> Or convert the eps file by converting to pdf and back to PostScript by
> pdftops (xpdf) or AR.

I have tried doing that to, but to no avail.

/Paul

Dan Luecking

unread,
Apr 2, 2003, 12:46:46 PM4/2/03
to

There are several bits of information I have not seen in this thread
and no one has asked for, but I think are absolutely essential.

The phrase: "there is a black box around the figure" has absolutely
NO MEANING alone. What does have some meaning might be the one or
more of the following:

"When I view the .dvi file produced by LaTeX in xdvi I see a black box
surrounding the picture",

or

"When I view the .ps file produced by dvips and view in GSview I see
a black box...",

or

"When I view with Acrobat Reader the .pdf file produced from
dvips's .ps file with ps2pdf I see ...",

or

"When I print the .pdf file using Acrobat Reader ..."

So the information required is:
What software (and what version) displays a black box (on screen or
on paper)? Does it only happen when included in a latex file? If so,
in what software (and what version) can you view the the bare figure
without a black box.

Finally, it might be useful to make the .eps figure (or any one
showing the problem), and a small latex file including it,
available for download, so some expert might comment on what might
be going wrong.


Dan

--
Dan Luecking Department of Mathematical Sciences
University of Arkansas Fayetteville, Arkansas 72701

Paul Cohen

unread,
Apr 3, 2003, 5:23:41 AM4/3/03
to
Hi,

Dan Luecking wrote:

> There are several bits of information I have not seen in this thread
> and no one has asked for, but I think are absolutely essential.
>
> The phrase: "there is a black box around the figure" has absolutely
> NO MEANING alone. What does have some meaning might be the one or
> more of the following:

>


> So the information required is:
> What software (and what version) displays a black box (on screen or
> on paper)? Does it only happen when included in a latex file? If so,
> in what software (and what version) can you view the the bare figure
> without a black box.
>
> Finally, it might be useful to make the .eps figure (or any one
> showing the problem), and a small latex file including it,
> available for download, so some expert might comment on what might
> be going wrong.
>

I have put information about my problem here (.tex, .eps files and all):

http://eifogl.sourceforge.net/latexproblem/problem.html

Thank you all very much for trying to help me out here!

/Paul

Tomas Lundberg

unread,
Apr 3, 2003, 5:59:36 AM4/3/03
to
Paul Cohen wrote:
>
> I have put information about my problem here (.tex, .eps files and all):
>
> http://eifogl.sourceforge.net/latexproblem/problem.html

...on which the following excerpt from the LaTeX file can be found:

> \begin{figure}
> \begin{center}
> \fbox{\includegraphics[scale=0.70]{eglut01good}}
> \caption{Example of an EPS BON diagram created in BONsai with ``Print to (EPS) file ...''}
> \label{fig:goodeps}
> \end{center}
> \end{figure}

which makes me believe that you are talking about the "black
rectangle" that "\fbox" puts around its argument. At least
I can't see any other black rectangle around the figure. So
the answer is simply to remove the "\fbox" command:

\includegraphics[scale=0.70]{eglut01good}

As for the clipping of the eps figure, I think it gets clipped
when you export it from Visio; already the "eglut01.eps" file
seems to be clipped, so the clipping is not caused by GhostView
or LaTeX.

Tomas

--
Tomas Lundberg | It doesn't make any difference how smart you are,
Ericsson AB | you better not ever prostitute physics.
Luleå, SWEDEN | Don Arabian
E-mail: Tomas.Lu...@SPAMepl.ericsson.se <- remove the obvious

Paul Cohen

unread,
Apr 3, 2003, 6:48:01 AM4/3/03
to
Hi,

Tomas Lundberg wrote:

> which makes me believe that you are talking about the "black
> rectangle" that "\fbox" puts around its argument. At least
> I can't see any other black rectangle around the figure. So
> the answer is simply to remove the "\fbox" command:
>
> \includegraphics[scale=0.70]{eglut01good}
>

Arggh! Thank you *very* much.

>
> As for the clipping of the eps figure, I think it gets clipped
> when you export it from Visio; already the "eglut01.eps" file
> seems to be clipped, so the clipping is not caused by GhostView
> or LaTeX.

Yes you are correct. I will have to see if I can set any general figure, file or printing
properties in Visio to fix this.

Again, thanks a million! Sometimes one simply goes blind looking at a problem. I simply did a
copy-and-paste from a beginners guide on LaTeX where the original xample used the \fbox command!
I haven't used LaTeX/TeX for over 10 years so I am *very* rusty.

Thanks to everyone who took time to answer my posts!

/Paul

0 new messages