ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Re: Twotanks.mp
       [not found] <3.0.5.32.19990824183940.00b36390@mail.northcoast.com>
@ 1999-08-29 11:45 ` Hans Hagen
  0 siblings, 0 replies; only message in thread
From: Hans Hagen @ 1999-08-29 11:45 UTC (permalink / raw)


David Arnold wrote:

[thread: making eps out of mp by first making an pdf of it and then an
eps of the pdf]

> First, it would be more useful to me if it automatically calculated with
> width and the height from the bounding box information (or the HiRes
> bounding box information). Or perhaps, it would more useful in general, if
> you provided a switch. On means automatically calculate bounding box, off
> means place the width and height manually.
> 
> Actually, in my case, some sort of batch utility that would change a whole
> lot of files to pdf to eps would be a huge blessing. Then I wouldn't have
> to do them one by one. (Hee--hee. If wishes were horses, then beggars would
> fly:-)

As long as I keep some features secret, I can fulfil wishes more
easilly. Part of what you want is already avaliable. 

> Secondly, I had a weird experience with my attempt to create an eps file. I
> have a file, twomasses.1, and I set up like this, in a file called
> mptopdf.tex:

Yes, this is a bug in version 3. Your figure is pretty small: its height
is 45pt. Version 4 and GS display ok. 

Now to a solution: 

It is possible to ask for the figuredimensions, so we can wrap the
command seauence I sent you before into a macro (\unprotect ... macro
... \protect -> in cont-new.tex):

\def\pagefigure[#1]%
  {\bgroup
   \page
   \getfiguredimensions
     [#1]
   \definieerpapierformaat
     [\s!dummy][\c!breedte=\figurewidth,\c!hoogte=\figureheight]
   \stelpapierformaatin
     [\s!dummy][\s!dummy]
   \setupcolors
     [\c!status=\v!start]
   \stellayoutin
     [\c!kopwit=\!!zeropoint, \c!rugwit=\!!zeropoint,
       \c!hoofd=\!!zeropoint,   \c!voet=\!!zeropoint,
      \c!hoogte=\v!midden,   \c!breedte=\v!midden]
   \externalfigure[#1]
   \page
   \egroup}

Now you can say: 

  \starttext \pagefigure[twomasses.1] \stoptext 

and get one figure. 

Now, probably few users will know that there is a command: 

  \showexternalfigures   % [alternative=a]  [alternative=b] 

that typesets a directory of figures. It uses an auxiliary file produced
by texutil: 

  texutil --fig *.1 

will build your list. Given the previous macro, we can now define: 

(also add to cont-new) 

\def\showexternalfigurec%
  {\bgroup
   \def\presetfigure[##1][##2]{\pagefigure[##1]}
   \pushendofline
   \readjobfile{\@@exfile}{}{}
   \popendofline
   \egroup}

and say 

  \starttext \showexternalfigures[alternative=c] \stoptext 

That way you have all your mp graphics in one pdf file, nicely cropped
at natural size.  

There is a program pdftops (in the web2c/xpdf distribution) that can
extract the graphics as ps; unfortunately it forgets the crop box. I
already mailed the author about this. 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1999-08-29 11:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <3.0.5.32.19990824183940.00b36390@mail.northcoast.com>
1999-08-29 11:45 ` Twotanks.mp Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).