ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* xtable formatting issues
@ 2012-01-19  4:30 Brian Landy
  0 siblings, 0 replies; only message in thread
From: Brian Landy @ 2012-01-19  4:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi, I’ve been experimenting a bit with converting some natural tables into xtables and ran across two issues.

The first has to do with nested xtables and settings.  In particular, if you attempt to set a cell’s width on the internal table using \setupxtable the option is lost.  In the below example testtable1 doesn’t format properly when nested; testtable2 does.  I also included some font and color examples to show they cascade more as I’d expect (the outer table’s settings are used unless overridden by the inner table).

The second thing I noticed is that attempting to set the font via foregroundstyle only works when done vie \setupxtable.  Attempting to assign this directly to the cell causes compile errors (the commented table in the example).  Maybe I should be setting the font some other way?  (this is how I always did it with natural tables).

Finally, does xtable have something like the aligncharacter mechanism in natural tables?

Thanks,
Brian


\starttext

\setupxtable[wd1][background=color,backgroundcolor=yellow,width=1.0in]
\setupxtable[wd2][background=color,backgroundcolor=green,width=2.0in]
\setupxtable[fnit][foregroundstyle={\switchtobodyfont[modern,ss]\it}]
\setupxtable[fnbf][foregroundstyle={\switchtobodyfont[modern,ss]\bf}]

\startbuffer[testtable1]
\startxtable
\startxrow \startxcell[fnbf] bold \stopxcell \startxcell[wd1] 1in? \stopxcell \stopxrow
\stopxtable
\stopbuffer

\startbuffer[testtable2]
\startxtable
\startxrow \startxcell[fnbf] bold \stopxcell \startxcell[background=color,backgroundcolor=yellow,width=1.0in] 1in?  \stopxcell \stopxrow
\stopxtable \stopbuffer

\getbuffer[testtable1]
\getbuffer[testtable2]

\startxtable
\startxrow \startxcell[fnit] \getbuffer[testtable1] \stopxcell \startxcell[wd2] \getbuffer[testtable1] \stopxcell \stopxrow
\startxrow \startxcell[fnit] \getbuffer[testtable2] \stopxcell \startxcell[wd2] \getbuffer[testtable2] \stopxcell \stopxrow
\stopxtable

% below fails, foregroundstyle set in this fashion must be done through \setuptable
%\startxtable
%\startxrow \startxcell[foregroundstyle={\switchtobodyfont[modern,rm]\it}] italic \stopxcell \stopxrow
%\stopxtable

\stoptext


___________________________________________________________________________________
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  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


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

only message in thread, other threads:[~2012-01-19  4:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-19  4:30 xtable formatting issues Brian Landy

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