From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/15902 Path: main.gmane.org!not-for-mail From: Brooks Moses Newsgroups: gmane.comp.tex.context Subject: Some proposed improvements for t-amsl.tex. Date: Mon, 02 Aug 2004 12:52:24 -0700 Sender: ntg-context-bounces@ntg.nl Message-ID: <4.3.1.2.20040802104638.01a603b0@cits1.stanford.edu> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Trace: sea.gmane.org 1091476444 26483 80.91.224.253 (2 Aug 2004 19:54:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 2 Aug 2004 19:54:04 +0000 (UTC) Cc: Giuseppe Bilotta Original-X-From: ntg-context-bounces@ntg.nl Mon Aug 02 21:53:53 2004 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Brisb-0004Xv-00 for ; Mon, 02 Aug 2004 21:53:53 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 82D1D127D3; Mon, 2 Aug 2004 21:53:53 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 20819-06; Mon, 2 Aug 2004 21:53:53 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 26571127D6; Mon, 2 Aug 2004 21:52:10 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 84FF7127D6 for ; Mon, 2 Aug 2004 21:52:09 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (ronja.vet.uu.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 20948-01 for ; Mon, 2 Aug 2004 21:52:08 +0200 (CEST) Original-Received: from smtp2.Stanford.EDU (unknown [171.67.16.125]) by ronja.ntg.nl (Postfix) with ESMTP id 7E2CA127D3 for ; Mon, 2 Aug 2004 21:52:08 +0200 (CEST) Original-Received: from Brooks1.stanford.edu (DNab42a5d0.Stanford.EDU [171.66.165.208]) by smtp2.Stanford.EDU (8.12.11/8.12.11) with ESMTP id i72Jq1u7028942; Mon, 2 Aug 2004 12:52:03 -0700 X-Sender: brooks@cits1.stanford.edu X-Mailer: QUALCOMM Windows Eudora Version 4.3.1 Original-To: ConTeXt users list X-Virus-Scanned: by amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: by amavisd-new at ntg.nl Xref: main.gmane.org gmane.comp.tex.context:15902 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:15902 Giuseppe and ConTeXt list members - Having figured out how to use \grabuntil (see my previous messages to this list), I've realized that it's really an inconvenient solution in some cases, because it's searching for a literal bit of text rather than an end to the appropriate grouping level. (Apparently there isn't a way to do the latter in TeX, given that AMSmath's \collect@body also searches for literal text.) This means that, if I write a "LaTeX compatibility function" that does things like define \end{myenvironment} to expand to \stopmyenvironment, my redefinition will not work on any environments using \grabuntil. This inconvenience happens to show up in t-amsl.tex's "align" and "gather" implementations, which is one place where I really need that compatibility function. However, it turns out that there's a simple way to rewrite the implementation so to avoid needing \grabuntil. Mostly, this works on the fact that the definition of Plain TeX's \eqalign function can be split apart into a before and after part, as follows: \def\starteqalign{\null\,\vcenter\bgroup \openup\jot {\mathsurround=0pt}% \ialign\bgroup \strut\hfil$\displaystyle{##}$&$\displaystyle{{}##}$\hfil \crcr} \def\stopeqalign{\crcr\egroup\egroup\,} (This, aside from the \bgroup's and \egroup's, is copied directly from Appendix B of The TeXbook.) Thus, we could expand the instances of \eqalign in the \startalign and \startgather definitions, shuffle things around appropriately, and obtain the following: \def\startalign{\startformula \let\\\cr \starteqalign} \def\stopalign{\crcr\stopeqalign\stopformula} \def\startgather{\startformula \def\\{\cr&}% \starteqalign&} \def\stopgather{\crcr\stopeqalign\stopformula} This exactly duplicates the existing functionality in the t-amsl.tex package. However, that functionality could be improved to be a better match to what's provided in amsmath.tex; in particular, align should accept multiple columns of equations, and gather should center its lines. Thus, I propose that the following redefinitions be included in t-amsl: \def\startalign{\startformula \let\\\cr \null\vcenter\bgroup \openup\jot {\mathsurround=0pt}% \everycr={}\tabskip=4pt plus1fil \halign to \displaywidth\bgroup \strut\hfil$\displaystyle{##}$% \tabskip=0pt &$\displaystyle{{}##}$\hfil% \tabskip=4pt plus1fil &&\hfil$\displaystyle{##}$% \tabskip=0pt &$\displaystyle{{}##}$\hfil% \tabskip=4pt plus1fil \crcr} \def\stopalign{\crcr\crcr\egroup\egroup\stopformula} \def\startgather{\startformula \let\\\cr \null\,\vcenter\bgroup \openup\jot {\mathsurround=0pt}% \ialign\bgroup \strut\hfil$\displaystyle{##}$\hfil \crcr} \def\stopgather{\crcr\crcr\egroup\egroup\,\stopformula} Also, a similar method can be used to replicate the split environment (which, unlike the above, should go inside an explicit \startformula and \stopformula pair). I propose the following definition be added as well: \def\startsplit{% \let\\\cr \null\,\vcenter\bgroup \openup\jot {\mathsurround=0pt}% \ialign\bgroup \strut\hfil$\displaystyle{##}$&$\displaystyle{{}##}$\hfil \crcr} \def\stopsplit{\crcr\egroup\egroup\,} This still doesn't address the fact that the lines in the align and gather environments are not given individual equation numbers as they should be, but I think that is a project for another day. - Brooks P.S. A question: is it intentional that the array environment in t-amsl produces notably different spacing than LaTeX's array environment?