On 12/16/2008 1:28 PM, Lars Huttar wrote [Re: [NTG-context] distributed
/ parallel TeX?]:
> On 12/16/2008 11:37 AM, Hans Hagen wrote:
>> Lars Huttar wrote:
...
>>> The advice I received said to define each mpgraphic using
>>> \startuseMPgraphic (we have about 18 of these), associate them with
>>> overlays using \defineoverlay (again, we have 18), and then use them in
>>> table cells using statements like
>>>     \setupTABLE[c][first][background={LRtb}]
>>> Empirically, this seems to end up using one mpgraphic per table cell,
>>> hence our thousands of mpgraphics. I don't know why a new mpgraphic
>>> would be created for each cell. Can someone suggest a way to avoid this?
>> metafun manual: unique mp graphics
> 
> Great...
> I converted our useMPgraphics to uniqueMPgraphics. This reduced our
> number of mpgraphics from 7000 to 800!
> 
> Unfortunately the result doesn't look quite right... but since we may
> not need to use mpgraphics anyway thanks to your patches, I'll hold off
> on debugging the result.

When I use uniqueMPgraphics, things run faster, but I get errors and
warnings. They look like this:

** WARNING ** Specified (image) object doesn't exist: MP::139
** WARNING ** Interpreting special command uxobj (pdf:) failed.
** WARNING ** >> at page="32" position="(216.633, 268.835)" (in PDF)
** WARNING ** >> xxx "pdf:uxobj @MP::139"
** WARNING ** Error locating image file "MP::185"
** WARNING ** Specified (image) object doesn't exist: MP::185
** WARNING ** Interpreting special command uxobj (pdf:) failed.
** WARNING ** >> at page="32" position="(250.44, 268.835)" (in PDF)
** WARNING ** >> xxx "pdf:uxobj @MP::185"
** WARNING ** Error locating image file "MP::141"
** WARNING ** Specified (image) object doesn't exist: MP::141
** WARNING ** Interpreting special command uxobj (pdf:) failed.
** WARNING ** >> at page="32" position="(284.247, 268.835)" (in PDF)
** WARNING ** >> xxx "pdf:uxobj @MP::141"
** WARNING ** Error locating image file "MP::186"
** WARNING ** Specified (image) object doesn't exist: MP::186
** WARNING ** Interpreting special command uxobj (pdf:) failed.
** WARNING ** >> at page="32" position="(316.111, 268.835)" (in PDF)
** WARNING ** >> xxx "pdf:uxobj @MP::186"
** WARNING ** Error locating image file "MP::143"
** WARNING ** Specified (image) object doesn't exist: MP::143
** WARNING ** Interpreting special command uxobj (pdf:) failed.
** WARNING ** >> at page="32" position="(352.456, 268.835)" (in PDF)
** WARNING ** >> xxx "pdf:uxobj @MP::143"



The tex looks like:

\startMPinitializations
numeric FrameDist, Inner, Middle, Outer ;
FrameDist := 0.6;
Middle  := -0.2 ;
Inner := Middle - FrameDist;
Outer  := Middle + FrameDist;
\stopMPinitializations

% 0 double sides
\startuniqueMPgraphic{table:frame:lrtb} % all single
draw OverlayBox enlarged Middle ;
setbounds currentpicture to OverlayBox ;
\stopuniqueMPgraphic

% 1 double side
\startuniqueMPgraphic{table:frame:Lrtb} % left double
draw OverlayBox leftenlarged Outer topenlarged Middle bottomenlarged
Middle rightenlarged Middle ;
draw OverlayBox leftenlarged Inner topenlarged Middle bottomenlarged
Middle rightenlarged Middle ;
setbounds currentpicture to OverlayBox ;
\stopuniqueMPgraphic
...
% 0 double sides
\defineoverlay[lrtb][\uniqueMPgraphic{table:frame:lrtb}]
% 1 double side
\defineoverlay[Lrtb][\uniqueMPgraphic{table:frame:Lrtb}]
\defineoverlay[lRtb][\uniqueMPgraphic{table:frame:lRtb}]
\defineoverlay[lrTb][\uniqueMPgraphic{table:frame:lrTb}]
\defineoverlay[lrtB][\uniqueMPgraphic{table:frame:lrtB}]

...

\def\setuptableone{\setupTABLE[frame=off,split=no,option=stretch,offset=0.85mm,distance=0mm,columndistance=0mm,leftmargindistance=0mm,rightmargindistance=0mm]
\setupTABLE[r][each][height=0.6cm,align={middle,lohi}]
\setupTABLE[2,3,4,5,6,7][4,5,6,7,8,9][align={flushright,lohi}]
\setupTABLE[1][4,5,6,7,8,9][align={flushleft,lohi}]
\setupTABLE[c][1][background={LRtb}]
\setupTABLE[c][2,4][background={Lrtb}]
...}

\bgroup
\setuptableone
\startTabTableHeader
[nc=7,height=0.8cm,align={right,lohi}]\switchtobodyfont[SansB,\countryheadersize]{Table
1.}
...

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : [email protected] / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to