Re: [NTG-context] how to get thick and thin borders working in tables (ConTeXt)
On 12/11/2008 3:24 PM, Wolfgang Schuster wrote:
Am 11.12.2008 um 18:05 schrieb Lars Huttar:
We center borders between the cells by using "enlarged" values -0.2 +/- k, i.e. center around -0.2. I'm not sure why -0.2 works better than zero, but it does... Doing this makes coincident border lines from adjacent cells look like ordinary single lines instead of being extra thick. We settled on k = 0.6 to get the desired distance between our double lines. Incidentally, I wish I knew how to put -0.2, 0.2-k, and -0.2+k into variables or something so that they could all be changed in one place, instead of hard-coded in many places. Maybe somebody can help me there.
\startMPinitializations numeric InnerFrame, MiddleFrame, OuterFrame ; InnerFrame := 0.2 ; MiddleFrame := 0.4 ; OuterFrame := 0.8 ; \stopMPinitializations
Makes sense. Thanks... this will make the code clearer and more maintainable.
% 1 double side \startuseMPgraphic{table:frame:Lrtb} % left double draw OverlayBox leftenlarged MiddleFrame topenlarged -InnerFrame bottomenlarged -InnerFrame rightenlarged -InnerFrame ; draw OverlayBox leftenlarged -OuterFrame topenlarged -InnerFrame bottomenlarged -InnerFrame rightenlarged -InnerFrame ; setbounds currentpicture to OverlayBox ; \stopuseMPgraphic
An unexpected and potentially large benefit of this approach is that for each cell, we only generate one MPgraphic (apparently because we only use one overlay per cell), which should make the TeX run much faster, and avoid running over the maxnumMPgraphics limit. With the multiple-overlay-per-cell approach, we ended up using about 13,000 MPgraphics for our document, far beyond the default limit of 4000, and taking 15 minutes to run compared to 37 seconds for a similar document without the tables.
Use the 'nomprun' switch for texexec
texexec --nomprun --xtx file
ConTeXt collects now all graphics and process them after the TeX run.
Hmm... we tried this, but it doesn't seem to make any obvious difference. Is this supposed to give a speed improvement? or get around the maxnumMPgraphics limit? Thanks again for your help. Lars
participants (1)
-
Lars Huttar