Hello, ConTeXt does not find the EPS-BoundingBox in EPS files generated by xmgrace. Such a file begins like this: %!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: (atend) and it ends like this: %%Trailer %%BoundingBox: 64 72 709 527 %%DocumentNeededResources: font Times-Roman %%EOF When using \externalfigure, one gets the following error: ERROR: Missing number, treated as zero. --- TeX said --- <to be read again> ( \EPSllx ->( atend) \dogetEPSboundingbox ...m \EPSfound >0 #2=\EPSllx bp#4=\EPSurx bp#3=\EPSlly ... Would it be possible, to enable ConTeXt to read such a file? If not, I'm going to write a script, that converts the file. Cheers, Peter -- http://pmrb.free.fr/contact/ _____________________________________ FilmSearch engine: http://f-s.sf.net/
At 14:24 30/05/2004, you wrote:
Hello, ConTeXt does not find the EPS-BoundingBox in EPS files generated by xmgrace. Such a file begins like this:
%!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: (atend)
and it ends like this:
%%Trailer %%BoundingBox: 64 72 709 527 %%DocumentNeededResources: font Times-Roman %%EOF
When using \externalfigure, one gets the following error: ERROR: Missing number, treated as zero.
--- TeX said --- <to be read again> ( \EPSllx ->( atend) \dogetEPSboundingbox ...m \EPSfound >0 #2=\EPSllx bp#4=\EPSurx bp#3=\EPSlly ...
Would it be possible, to enable ConTeXt to read such a file?
sure but it could mess up things as well, esp since there can be a couple of (binary) megabytes in between
If not, I'm going to write a script, that converts the file.
if you have a small demo file i can add that feature to texutil Hans
On Tue, 1 Jun 2004, Hans Hagen wrote:
At 14:24 30/05/2004, you wrote:
Hello, ConTeXt does not find the EPS-BoundingBox in EPS files generated by xmgrace. Such a file begins like this:
%!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: (atend) [...] If not, I'm going to write a script, that converts the file.
if you have a small demo file i can add that feature to texutil
I'd suggest adopting some of the conventions used by the
LaTeX2e graphics bundle, in particular, to look for the
BoundingBox in filename.(e)ps.bb.
Rather than making texutil more complex a separate tool (findbb, attached)
that reliably writes the bbox by trying several methods, even using the
ghostscript bbox device to generate one (e.g., in the case of files
created with dvips -E that get incorrect BoundingBox entries because the
dvips calculation ignores things drawn by \specials).
Try "findbb xmgracefile.ps > xmgracefile.ps.bb"
--
George N. White III
Hi, A one-line patch to texutil.pl is enough to handle most cases of (atend). The method is far from waterproof, but neither is a Korn Shell script, and the added complexity to texutil.pl is neglible. Greetings, Taco --- texutil.pl.org 2004-06-02 15:36:03.610266871 +0200 +++ texutil.pl 2004-06-02 15:38:17.454329753 +0200 @@ -2129,7 +2129,7 @@ if (($BBoxFound) && ((substr $SomeLine,0,1) ne "%")) { last } if ($BBoxFound<2) - { if ($SomeLine =~ /^%%BoundingBox:/io) + { if ($SomeLine =~ /^%%BoundingBox:(?!\s+\(atend\))/io) { $EpsBBox = $SomeLine ; $BBoxFound = 1 ; next } elsif ($SomeLine =~ /^%%HiResBoundingBox:/io) { $EpsBBox = $SomeLine ; $BBoxFound = 2 ; next } On Wed, 02 Jun 2004 10:13:33 -0300, George wrote:
On Tue, 1 Jun 2004, Hans Hagen wrote:
At 14:24 30/05/2004, you wrote:
Hello, ConTeXt does not find the EPS-BoundingBox in EPS files generated by xmgrace. Such a file begins like this:
%!PS-Adobe-3.0 EPSF-3.0 %%BoundingBox: (atend) [...] If not, I'm going to write a script, that converts the file.
if you have a small demo file i can add that feature to texutil
I'd suggest adopting some of the conventions used by the LaTeX2e graphics bundle, in particular, to look for the BoundingBox in filename.(e)ps.bb.
Rather than making texutil more complex a separate tool (findbb, attached) that reliably writes the bbox by trying several methods, even using the ghostscript bbox device to generate one (e.g., in the case of files created with dvips -E that get incorrect BoundingBox entries because the dvips calculation ignores things drawn by \specials).
Try "findbb xmgracefile.ps > xmgracefile.ps.bb"
-- George N. White III
Head of St. Margarets Bay, Nova Scotia, Canada
-- groeten, Taco
On Wed, 2 Jun 2004, Taco Hoekwater wrote:
+ { if ($SomeLine =~ /^%%BoundingBox:(?!\s+\(atend\))/io)
Yes, this seems to be good. But how is texutil used in this situation? I've tried "texexec test" and "texexec --texutil test", but texutil is never called. test.tex is a file with a \externalfigure[image] command. Cheers, Peter -- http://pmrb.free.fr/contact/ _____________________________________ FilmSearch engine: http://f-s.sf.net/
On Thu, 3 Jun 2004, Taco Hoekwater wrote:
But how is texutil used in this situation?
with texutil --figures
I tried this too, but still the same error. Perhaps something wrong with my installation? I would be glad if someone could help. The file example.eps is in the attachment. Here is test.tex: \starttext \externalfigure[example][width=10cm] \stoptext After executing "texutil --figures example.eps" the file texutil.tuf is created: % % TeXUtil 8.2 - ConTeXt / PRAGMA ADE 1992-2004 / Figures % \thisisfigureversion{1996.06.01} % \presetfigure[example.eps][e=eps,w=22.754cm,h=16.051cm ,x=2.258cm,y=2.540cm,t={Untitled},c={Grace-5.1.14},s=9396] And then, after "texexec test" the attached log-file is created. I tried to move away the eps-file just before executing texexec and move it back just before dvips, but then, I get a corrupted ps-file. Greetings, Peter -- http://pmrb.free.fr/contact/ _____________________________________ FilmSearch engine: http://f-s.sf.net/
participants (4)
-
George N. White III
-
Hans Hagen
-
Peter Münster
-
Taco Hoekwater