ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* precompiling inline mp to pdf?
@ 2004-10-30 20:34 Christopher Creutzig
  2004-11-02  9:52 ` Willi Egger
  0 siblings, 1 reply; 2+ messages in thread
From: Christopher Creutzig @ 2004-10-30 20:34 UTC (permalink / raw)


Salvete,

  for my latest project (almost done, so I don't need the answer for 
this one, but possibly in the future) I have compilation times which 
were dominated by Metapost until I switched to using --nomp most of the 
time and --automp --runs=2 whenever I changed something that results in 
changes to the Metapost stuff.  (I needed the --automp anyway, since to 
work around size limits in MetaPost I had to split the background into 
separate images, yet they had to influence one another via global 
variables -- increasing the memory limit to 80 MB made Metapost 
predictably freeze at unpredictable places in the run.)

  Now, my compile times are dominated by the mp to pdf conversion. 
Since pdf inclusion is fast (as expected), I'd like to use mptopdf once 
on each generated file and have ConTeXt include that.  Should I redefine 
\insertMPfile to first look for the pdf or is there a more clever way? 
(Note that I do want the automatic inclusion, since I'm passing the 
dimensions of external figures etc. to metapost and use the result in a 
background layer and/or as frame backgrounds.)

regards,
	Christopher Creutzig

PS: I didn't have time to analyze this when I came across it, but it 
seems that "texexec --automp file" consistently performs one TeX run too 
little.  In any case, the last thing it does is a metapost run, which 
doesn't seem sensible to me.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: precompiling inline mp to pdf?
  2004-10-30 20:34 precompiling inline mp to pdf? Christopher Creutzig
@ 2004-11-02  9:52 ` Willi Egger
  0 siblings, 0 replies; 2+ messages in thread
From: Willi Egger @ 2004-11-02  9:52 UTC (permalink / raw)


Hi Christopher,

In my case I prepared all the metapost code and had Context to prepare 
each figure as a \startTEXpage ... \stopTEXpage. Later I included the 
figures by referring to the different pages of that pdf-file.

\placefigure[margin][fig:sample]{none}{\externalfigure[mpfigure-pdf][page=27]}

Another aproach is to compile each figure in its own pdf-file. Hereafter 
I prepared a figure-database which in turn can be referenced whithin Context

<!-- Generation of a PDF file with the database: texexec --pdf 
--use=fig-make figure-lib.xml -->

<figurelibrary language="en">

    <description>
        <organization>Willi</organization>
        <project>Restauratie</project>
        <product>Restauratie-cursus </product>
        <comment>Figure database pictures from hand outs, own 
developments in METAPOST, Scans, WPG-WMF-EPS converted</comment>
    </description>

<figure>
    <file>example.pdf</file>
    <label>per_exemplum</label>
    <copyright>Scan and edited by WE</copyright>
    <comment> 4kB</comment>
</figure>

</figurelibrary>

In your source you will add \usefigurebase[base-figure-lib]
Hereafter you are able to call the pictures with

\placefigure[margin][ref]{caption}{\externalfigure[per_exemplum][width=0.45\makeupwidth,frame=off]}

I do hope this helps.


Willi

Christopher Creutzig wrote:

> Salvete,
> 
>  for my latest project (almost done, so I don't need the answer for this 
> one, but possibly in the future) I have compilation times which were 
> dominated by Metapost until I switched to using --nomp most of the time 
> and --automp --runs=2 whenever I changed something that results in 
> changes to the Metapost stuff.  (I needed the --automp anyway, since to 
> work around size limits in MetaPost I had to split the background into 
> separate images, yet they had to influence one another via global 
> variables -- increasing the memory limit to 80 MB made Metapost 
> predictably freeze at unpredictable places in the run.)
> 
>  Now, my compile times are dominated by the mp to pdf conversion. Since 
> pdf inclusion is fast (as expected), I'd like to use mptopdf once on 
> each generated file and have ConTeXt include that.  Should I redefine 
> \insertMPfile to first look for the pdf or is there a more clever way? 
> (Note that I do want the automatic inclusion, since I'm passing the 
> dimensions of external figures etc. to metapost and use the result in a 
> background layer and/or as frame backgrounds.)
> 
> regards,
>     Christopher Creutzig
> 
> PS: I didn't have time to analyze this when I came across it, but it 
> seems that "texexec --automp file" consistently performs one TeX run too 
> little.  In any case, the last thing it does is a metapost run, which 
> doesn't seem sensible to me.
> 
> 
> _______________________________________________
> ntg-context mailing list
> ntg-context@ntg.nl
> http://www.ntg.nl/mailman/listinfo/ntg-context

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-11-02  9:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-30 20:34 precompiling inline mp to pdf? Christopher Creutzig
2004-11-02  9:52 ` Willi Egger

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).