ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Brian R. Landy" <landy@alumni.caltech.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: A few natural table issues
Date: Sat, 21 Jul 2007 19:47:46 -0400	[thread overview]
Message-ID: <34879157-68E5-4ABD-BF0B-0961CCB61E6D@alumni.caltech.edu> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 1969 bytes --]

Hi, I've noticed a few issues with natural tables.

1. Embedding images into tables do not scale correctly using recent  
ConTeXt releases.  They do using the TeXLive 2007 version  
(2007.01.12).  It does not matter whether I use factor=max or fit.  I  
find I need to use the \vbox{\noindent{...}} structure to make the  
picture obey table's align= setups.  test1.tex and weight.eps/pdf  
demonstrate this behavior.  I attached pdf's to show the "good"  
behavior.


2. Background colors & frames -- bottomframe on a cell is obscured by  
a background color on the cell below.  Similarly, a rightframe is  
obscured by a backgroundcolor to the cell to the right.  test2.tex  
demonstrates this behavior.


3. Using \chardef\characteralignmentmode=2 widens columns and doesn't  
quite center the data.  It appears as if the decimal is centered, but  
this does not necessarily center the text.  The top row shows tables  
without setting the alignment mode, the second row of tables show  
what happens when it is set equal to 2.  It would be nice if the left- 
hand tables looked the same, and the bottom right were centered  
better.  test3.tex demonstrates this.


4. I was wondering if anyone had any pointers on improving  
performance and reducing memory usage with natural tables. Are there  
particular options or settings to avoid, and so on?  I'm using Perl  
scripts to generate the ConTeXt code, so tend to output many  
setupTABLE commands.  I have some tables which can take a minute or  
two to render for one page, and might have a document with 15 pages,  
so it takes some time.  I saw some recent postings regarding  
linetables; I did not use them initially given they did not seem  
actively used and natural tables provide all the features I need; but  
I would be willing to give them a try if I understood what  
limitations they might have relative to natural tables.

Many thanks!
Brian

[-- Attachment #1.2.1: Type: text/html, Size: 1238 bytes --]

[-- Attachment #1.2.2: test1.tex --]
[-- Type: application/octet-stream, Size: 526 bytes --]

\newdimen\pageleft%
\starttext%
\start%
\bTABLE[align={middle,lohi},frame=on,width=3.0in,height=1.0in]%
\bTR%
\bTD{1-1}\eTD%
\bTD{2-1}\eTD%
\eTR%
\bTR%
\bTD{1-2}\eTD%
\bTD{\vbox{\noindent\externalfigure[./weight][factor=max,,location=middle]}}\eTD%
\eTR%
\eTABLE%
\stop%
\par
\start%
\bTABLE[align={middle,lohi},frame=on,width=1.0in,height=2.0in]%
\bTR%
\bTD{1-1}\eTD%
\bTD{2-1}\eTD%
\eTR%
\bTR%
\bTD{1-2}\eTD%
\bTD{\vbox{\noindent\externalfigure[./weight][factor=max,,location=middle]}}\eTD%
\eTR%
\eTABLE%
\stop%
\stoptext%

[-- Attachment #1.2.3: weight.pdf --]
[-- Type: application/pdf, Size: 8347 bytes --]

[-- Attachment #1.2.4: test1-good.pdf --]
[-- Type: application/octet-stream, Size: 26875 bytes --]

[-- Attachment #1.2.5: Type: text/html, Size: 841 bytes --]

[-- Attachment #1.2.6: test2.tex --]
[-- Type: application/octet-stream, Size: 713 bytes --]

\setupcolors[state=start]%
\definecolor[ice][r=0.867, g=0.945, b=0.973, s=0.9]%
\starttext
\bTABLE[align=middle,background=color,frame=off]%
\bTR[bottomframe=on]%
\bTH{test1}\eTH%
\bTH{test2}\eTH%
\eTR%
\bTR%
\bTH[rightframe=on]{test1}\eTH%
\bTH{test2}\eTH%
\eTR%
\eTABLE%
\crlf%
\crlf%
\bTABLE[align=middle,background=color,frame=off]%
\bTR[bottomframe=on]%
\bTH{test1}\eTH%
\bTH{test2}\eTH%
\eTR%
\bTR%
\bTH[rightframe=on]{test1}\eTH%
\bTH[backgroundcolor=ice]{test2}\eTH%
\eTR%
\eTABLE%
\crlf%
\crlf%
\bTABLE[align=middle,background=color,frame=off]%
\bTR%
\bTH{test1}\eTH%
\bTH{test2}\eTH%
\eTR%
\bTR[topframe=on]%
\bTH{test1}\eTH%
\bTH[backgroundcolor=ice,leftframe=on]{test2}\eTH%
\eTR%
\eTABLE%
\stoptext%

[-- Attachment #1.2.7: Type: text/html, Size: 1053 bytes --]

[-- Attachment #1.2.8: test3.tex --]
[-- Type: application/octet-stream, Size: 1454 bytes --]

\starttext
\hbox{
\framed[width=1.5in,frame=off,align=flushleft]{
\bTABLE
\setupTABLE[column][1][align=right]
\setupTABLE[column][2][alignmentcharacter={.},aligncharacter=yes,align=middle]
\bTR \bTH A \eTH \bTH B \eTH \eTR
\bTR \bTD First \eTD \bTD 71 \eTD \eTR
\bTR \bTD Second \eTD \bTD 43 \eTD \eTR
\bTR \bTD Total \eTD \bTD 115 \eTD \eTR
\eTABLE
}
\framed[width=1.5in,frame=off,align=flushleft]{
\bTABLE
\setupTABLE[column][1][align=right]
\setupTABLE[column][2][alignmentcharacter={.},aligncharacter=yes,align=middle]
\bTR \bTH A \eTH \bTH B \eTH \eTR
\bTR \bTD First \eTD \bTD 71.0 \eTD \eTR
\bTR \bTD Second \eTD \bTD 43 \eTD \eTR
\bTR \bTD Total \eTD \bTD 115 \eTD \eTR
\eTABLE
}
}
\crlf

\hbox{
\framed[width=1.5in,frame=off,align=flushleft]{
\bTABLE
\setupTABLE[column][1][align=right]
\setupTABLE[column][2][alignmentcharacter={.},aligncharacter=yes,align=middle]
\chardef\characteralignmentmode=2
\bTR \bTH A \eTH \bTH B \eTH \eTR
\bTR \bTD First \eTD \bTD 71 \eTD \eTR
\bTR \bTD Second \eTD \bTD 43 \eTD \eTR
\bTR \bTD Total \eTD \bTD 115 \eTD \eTR
\eTABLE
}
\framed[width=1.5in,frame=off,align=flushleft]{
\bTABLE
\setupTABLE[column][1][align=right]
\setupTABLE[column][2][alignmentcharacter={.},aligncharacter=yes,align=middle]
\chardef\characteralignmentmode=2
\bTR \bTH A \eTH \bTH B \eTH \eTR
\bTR \bTD First \eTD \bTD 71.0 \eTD \eTR
\bTR \bTD Second \eTD \bTD 43 \eTD \eTR
\bTR \bTD Total \eTD \bTD 115 \eTD \eTR
\eTABLE
}
}
\stoptext

[-- Attachment #1.2.9: Type: text/html, Size: 1681 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

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

maillist : ntg-context@ntg.nl / 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	other threads:[~2007-07-21 23:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=34879157-68E5-4ABD-BF0B-0961CCB61E6D@alumni.caltech.edu \
    --to=landy@alumni.caltech.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).