From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/34029 Path: news.gmane.org!not-for-mail From: "Brian R. Landy" Newsgroups: gmane.comp.tex.context Subject: Re: Vertical text alignment in nested natural tables Date: Thu, 29 Mar 2007 23:16:43 -0400 Message-ID: References: <20070328091156.85kplgbcggcogwo8@serenity.landy.cx> <115224fb0703290134s34cc7a11icb9d4094cd1033cd@mail.gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v752.3) Content-Type: multipart/mixed; boundary="===============1753972935==" X-Trace: sea.gmane.org 1175224768 15710 80.91.229.12 (30 Mar 2007 03:19:28 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 30 Mar 2007 03:19:28 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Fri Mar 30 05:19:26 2007 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1HX7e9-00067U-N9 for gctc-ntg-context-518@m.gmane.org; Fri, 30 Mar 2007 05:19:25 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5E0DC2045A; Fri, 30 Mar 2007 05:19:25 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 02792-02; Fri, 30 Mar 2007 05:19:25 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 96DD120426; Fri, 30 Mar 2007 05:17:32 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 736C720426 for ; Fri, 30 Mar 2007 05:17:31 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 02570-07-3 for ; Fri, 30 Mar 2007 05:17:29 +0200 (CEST) Original-Received: from smtp127.iad.emailsrvr.com (smtp127.iad.emailsrvr.com [207.97.245.127]) by ronja.ntg.nl (Postfix) with ESMTP id 8846720420 for ; Fri, 30 Mar 2007 05:17:29 +0200 (CEST) Original-Received: from serenity.landy.cx (cpe-68-174-177-241.nyc.res.rr.com [68.174.177.241]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: brlandy@landy.cx) by relay2.r2.iad.emailsrvr.com (SMTP Server) with ESMTP id 5109F44C002 for ; Thu, 29 Mar 2007 23:17:28 -0400 (EDT) Original-Received: from [192.168.170.20] (landlord.landy.cx [192.168.170.20]) by serenity.landy.cx (Postfix) with ESMTP id C63F6C4235AE for ; Thu, 29 Mar 2007 23:17:27 -0400 (EDT) In-Reply-To: <115224fb0703290134s34cc7a11icb9d4094cd1033cd@mail.gmail.com> X-Mailer: Apple Mail (2.752.3) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:34029 Archived-At: --===============1753972935== Content-Type: multipart/alternative; boundary=Apple-Mail-35--651091829 --Apple-Mail-35--651091829 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed I had played around with strut=yes, but had not realized I also needed to set autostrut=no. That approach ended up working best; my initial solution broke aligncharacter, and I like the table environment to reset. It is a bit odd that it resets to something different than the default. As an aside, what books are good for learning TeX programming for ConTeXt? Anything besides the TeXBook (and I saw TeX by Topic mentioned on the list the other day). Thanks again, Brian On Mar 29, 2007, at 4:34 AM, Wolfgang Schuster wrote: > > > 2007/3/28, Brian R. Landy : > Hi, > > I am having a problem using nested natural tables, to which I have a > solution but feel that it my not be the proper approach. I'm pretty > much a TeX and ConTeXt novice. > > The problem is that the row height it reduced when a table is nested, > breaking vertical text alignment across cells. In my example the > cells "SSSSS" and "Swap" to not align vertically due to the presence > of the "p". I have an example of the problem and my fix below. > > I'm curious if someone knows a better way to fix this. > > Thanks for your help, > Brian > > > Hi Brian, > > I will show a few solution to your problem for the following table. > We will start with a simple table that contains the error. > > \starttext > > \bTABLE > \bTR > \bTD > {\bTABLE > \bTR > \bTD SSSS \eTD > \bTD Swap \eTD > \bTR > \eTABLE} > \bTD > \eTR > \eTABLE > > \stoptext > > > Your own solution with adding a strut to the inner table can be done > in a better way by adding the strut to the setup of the beginning > of the table. > > \starttext > > \bTABLE > \bTR > \bTD > {\bTABLE[left=\strut] > \bTR > \bTD SSSS \eTD > \bTD Swap \eTD > \bTR > \eTABLE} > \bTD > \eTR > \eTABLE > > \stoptext > > > > > > Another mothod is to use the same method, that is used for the > outer table. I took a look into the source and found the following > method, > that works also. > > \starttext > > \bTABLE > \bTR > \bTD > {\bTABLE[strut=yes,autostrut=no] > \bTR > \bTD SSSS \eTD > \bTD Swap \eTD > \bTR > \eTABLE} > \bTD > \eTR > \eTABLE > > \stoptext > > > After that a was interested why we need to set the values in the > last example again, because they are already set in core-ntb. > The solution is, the values in nested tables are removed and replaced > by new ones. This behaviour can be changed and is shown in my last > example. > > \starttext > > \setfalse\resetTABLEmode > > \bTABLE > \bTR > \bTD > {\bTABLE > \bTR > \bTD SSSS \eTD > \bTD Swap \eTD > \bTR > \eTABLE} > \bTD > \eTR > \eTABLE > > \stoptext > > > Another example that shows the effect of \resetTABLEmode is: > > \starttext > > %\settrue\resetTABLEmode % default setting > > \setupTABLE[frame=off] > > \bTABLE > \bTR > \bTD > {\bTABLE\bTR\bTD Text \eTD\eTR\eTABLE} > \eTD > \bTD > Text > \eTD > \eTR > \eTABLE > > \setfalse\resetTABLEmode > > \bTABLE > \bTR > \bTD > {\bTABLE\bTR\bTD Text \eTD\eTR\eTABLE} > \eTD > \bTD > Text > \eTD > \eTR > \eTABLE > > \stoptext > > > Wolfgang > > _______________________________________________ > ntg-context mailing list > ntg-context@ntg.nl > http://www.ntg.nl/mailman/listinfo/ntg-context > --Apple-Mail-35--651091829 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=ISO-8859-1 I had played around with = strut=3Dyes, but had not realized I also needed to set autostrut=3Dno.=A0 = That approach ended up working best; my initial solution broke = aligncharacter, and I like the table environment to reset.=A0 It is a = bit odd that it resets to something different than the default.

As an aside, what books are = good for learning TeX programming for ConTeXt?=A0 Anything besides the = TeXBook (and I saw TeX by Topic mentioned on the list the other = day).


Thanks = again,
Brian


On Mar 29, = 2007, at 4:34 AM, Wolfgang Schuster wrote:



2007/3/28, Brian R. Landy <landy@alumni.caltech.edu>:=

Hi,

I am having a problem = using nested natural tables, to which I have a
solution but feel that = it my not be the proper approach.=A0=A0I'm pretty
much a TeX and = ConTeXt novice.

The problem is that the row height it reduced = when a table is nested,
breaking vertical text alignment across = cells.=A0=A0In my example the
cells "SSSSS" and "Swap" to not align = vertically due to the presence
of the "p".=A0=A0I have an example of = the problem and my fix below.

I'm curious if someone knows a = better way to fix this.

Thanks for your = help,
Brian


Hi = Brian,

I will show a few solution to your problem for the = following table.
We will start with a simple table that contains the = error.

\starttext

\bTABLE
=A0 \bTR
=A0=A0=A0 = \bTD
=A0=A0=A0=A0=A0 {\bTABLE
=A0=A0=A0 =A0 \bTR
=A0=A0=A0 =A0=A0= =A0 \bTD SSSS \eTD
=A0=A0=A0 =A0=A0=A0 \bTD Swap \eTD
=A0=A0=A0 =A0 = \bTR
=A0=A0=A0 \eTABLE}
=A0=A0=A0 \bTD
=A0 = \eTR
\eTABLE

\stoptext


Your own solution with = adding a strut to the inner table can be done
in a better way by = adding the strut to the setup of the beginning of the = table.

\starttext

\bTABLE
=A0 \bTR
=A0=A0=A0 = \bTD
=A0=A0=A0=A0=A0 {\bTABLE[left=3D\strut]
=A0=A0=A0 =A0=A0=A0 = \bTR
=A0=A0=A0 =A0=A0=A0=A0=A0 \bTD SSSS \eTD
=A0=A0=A0 =A0=A0=A0=A0= =A0 \bTD Swap \eTD
=A0 =A0 =A0 =A0 \bTR
=A0=A0 =A0=A0 = \eTABLE}
=A0=A0=A0 \bTD
=A0 = \eTR
\eTABLE

\stoptext
=A0




Another mothod = is to use the same method, that is used for the
outer table. I took = a look into the source and found the following method,
that works = also.

\starttext

\bTABLE
=A0 \bTR
=A0=A0=A0 = \bTD
=A0=A0=A0=A0=A0 {\bTABLE[strut=3Dyes,autostrut=3Dno]
=A0=A0=A0=A0= =A0=A0=A0=A0 \bTR
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 \bTD SSSS \eTD =
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 \bTD Swap \eTD
=A0=A0=A0=A0=A0=A0=A0= =A0 \bTR
=A0=A0=A0=A0=A0=A0 \eTABLE}
=A0=A0=A0 \bTD
=A0 = \eTR
\eTABLE

\stoptext


After that a was interested = why we need to set the values in the
last example again, because they = are already set in core-ntb.
The solution is, the values in nested = tables are removed and replaced
by new ones. This behaviour can be = changed and is shown in my = last
example.

\starttext

\setfalse\resetTABLEmode

= \bTABLE
=A0 \bTR
=A0=A0=A0 \bTD
=A0=A0=A0=A0=A0 = {\bTABLE
=A0=A0=A0=A0=A0=A0=A0=A0 \bTR
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= \bTD SSSS \eTD
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 \bTD Swap = \eTD
=A0=A0=A0=A0=A0=A0=A0=A0 \bTR
=A0=A0=A0=A0=A0=A0 = \eTABLE}
=A0=A0=A0 \bTD
=A0 = \eTR
\eTABLE

\stoptext


Another example that shows = the effect of \resetTABLEmode is: =

\starttext

%\settrue\resetTABLEmode % default = setting

\setupTABLE[frame=3Doff]

\bTABLE
=A0 = \bTR
=A0=A0=A0 \bTD
=A0=A0=A0=A0=A0 {\bTABLE\bTR\bTD Text = \eTD\eTR\eTABLE}
=A0=A0=A0 \eTD
=A0=A0=A0 \bTD
=A0=A0=A0=A0=A0 = Text
=A0=A0=A0 \eTD
=A0 = \eTR
\eTABLE

\setfalse\resetTABLEmode

\bTABLE
=A0 = \bTR
=A0=A0=A0 \bTD
=A0=A0=A0=A0=A0 {\bTABLE\bTR\bTD Text = \eTD\eTR\eTABLE}
=A0=A0=A0 \eTD
=A0=A0=A0 \bTD
=A0=A0=A0=A0=A0= Text
=A0=A0=A0 \eTD
=A0 \eTR
= \eTABLE

\stoptext


Wolfgang

ntg-context mailing list

= --Apple-Mail-35--651091829-- --===============1753972935== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context --===============1753972935==--