From: Brian Landy <brian@landy.cx>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: xtable formatting issues
Date: Wed, 18 Jan 2012 23:30:45 -0500 [thread overview]
Message-ID: <E416FF9B-67CD-4CB4-A3C5-9684953A080B@landy.cx> (raw)
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
___________________________________________________________________________________
reply other threads:[~2012-01-19 4:30 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=E416FF9B-67CD-4CB4-A3C5-9684953A080B@landy.cx \
--to=brian@landy.cx \
--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).