From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/25232 Path: news.gmane.org!not-for-mail From: David Arnold Newsgroups: gmane.comp.tex.context Subject: Re: math align Date: Sun, 15 Jan 2006 22:17:13 -0800 Message-ID: <9191DCDC-79FF-4FD0-90D5-FCEB48849EEB@cox.net> References: <43CACEB2.7030708@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1137392328 521 80.91.229.2 (16 Jan 2006 06:18:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 16 Jan 2006 06:18:48 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Mon Jan 16 07:18:44 2006 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 ciao.gmane.org with esmtp (Exim 4.43) id 1EyNhN-0004Pc-Ut for gctc-ntg-context-518@m.gmane.org; Mon, 16 Jan 2006 07:18:38 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7DA1F12791; Mon, 16 Jan 2006 07:18:37 +0100 (CET) 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 18705-03; Mon, 16 Jan 2006 07:18:35 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DA64D1277B; Mon, 16 Jan 2006 07:18:34 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B71921277B for ; Mon, 16 Jan 2006 07:18:32 +0100 (CET) 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 18706-02 for ; Mon, 16 Jan 2006 07:18:31 +0100 (CET) Original-Received: from fed1rmmtao05.cox.net (fed1rmmtao05.cox.net [68.230.241.34]) by ronja.ntg.nl (Postfix) with SMTP id B15AE1276C for ; Mon, 16 Jan 2006 07:18:30 +0100 (CET) Original-Received: from [10.0.1.2] (really [70.191.56.23]) by fed1rmmtao05.cox.net (InterMail vM.6.01.05.02 201-2131-123-102-20050715) with ESMTP id <20060116061630.PHLK17838.fed1rmmtao05.cox.net@[10.0.1.2]> for ; Mon, 16 Jan 2006 01:16:30 -0500 In-Reply-To: <43CACEB2.7030708@wxs.nl> Original-To: mailing list for ConTeXt users X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: 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: , 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:25232 Archived-At: Hans et al, I tried saving this file as ~/tmp/math-ext.tex and compiling with: texexec --module math-ext.tex But I got: [MP texexec-mpgraph.4000] [1.1] [2.1] . (/usr/local/teTeX/share/texmf.local/tex/context/base/verb-tex.tex loading : Context Support Macros / Pretty TEX Verbatim ) . . . . . . . . . Overfull \hbox (98.21335pt too wide) in paragraph at lines 72--72 [][][] [][] [][] [][] [][] [][]\*10pttttf* {[][]\ifnum\recurselevel[] []>[][]\pl usone\appendtoks\tabskip\@@eqdistance[][]&[][]\tabskip\zeropoint\to \scratchtoks \fi[] . . . [3.1] . Overfull \hbox (87.71338pt too wide) in paragraph at lines 112--112 [][][] [][] [][] [][]\*10pttttf* \!!toksc[][]{[][]\hfil\tabskip \centering[][]&[ ][]\kern[][]-[][]\displaywidth\rlap[][]{[][]$[][]\forgetalign[][]##[] []$[][]}[] []\tabskip\displaywidth[][]}[][]%[] . . . . . . . (./texexec-texexec.tmp [4.2]) (./texexec-texexec.tmp ! Undefined control sequence. \startalign l.1 \placeformula \startformula \startalign ? Am I doing something wrong? On Jan 15, 2006, at 2:37 PM, Hans Hagen wrote: > Hi, > > Here a first attempts for a flexible alignment mechanism (i depend > on taco for the fine points of math typesetting since he's typeset > \infty more complex formulas than i have) > > (n=n_of_columns, m=n_of_pairs, so both requested multiple column > features are supported) > > Hans > %D \module > %D [ file=math-ext, > %D version=2006.01.14, > %D title=\CONTEXT\ Math Macros, > %D subtitle=Extra Macros, > %D author=Hans Hagen, > %D date=\currentdate, > %D copyright=\PRAGMA] > %C > %C This module is part of the \CONTEXT\ macro||package and is > %C therefore copyrighted by \PRAGMA. See mreadme.pdf for > %C details. > > % some simple math constructs (based on user requests) > % > % preliminary > > \unprotect > > % adapted stuff > > % we need to make this plain code a bit more 'readable' > > \def\openup > {\afterassignment\dopenup\scratchdimen=} > > \def\dopenup > {\advance\lineskip \scratchdimen > \advance\baselineskip \scratchdimen > \advance\lineskiplimit\scratchdimen} > > \def\jot{.25\bodyfontsize} % plain tex: 3 pt (todo: better name) > > \newif\ifdt@p > > \def\displ@y % \presetdisplayspacing or so > {\global\dt@ptrue > \openup\jot > \mathsurround\zeropoint > \everycr{\noalign{% > \ifdt@p > \global\dt@pfalse > \ifdim\prevdepth>-\thousandpoint > \vskip-\lineskiplimit > \vskip\normallineskiplimit > \fi > \else > \penalty\interdisplaylinepenalty > \fi}}} > > % context (hooks) > > \let\normaldispl@y\displ@y > > \def\displ@y{\resetdisplaymatheq\normaldispl@y} > > \let\presetdisplaymath\displ@y > > % plain tex value: \centering = 0pt plus 1000pt minus 1000pt > % plain tex valye: \jot = 3pt > > % n>1 #### needed, strange # interaction (maybe we need a toks in > recurse ane no macro) > > \def\buildeqalign > {\scratchtoks\emptytoks > \dorecurse\@@eqm > {\ifnum\recurselevel>\plusone\appendtoks\tabskip\@@eqdistance& > \tabskip\zeropoint\to\scratchtoks\fi > \expanded{\scratchtoks{\the\scratchtoks\the\!!toksa}}% > \dorecurse{\numexpr\@@eqn-\plusone\relax} > {\expanded{\scratchtoks{\the\scratchtoks\the\!!toksb}}}}% > \expanded{\scratchtoks{\the\scratchtoks\the\!!toksc}}} > > \def\forgetalign > {\tabskip\zeropoint\everycr\emptytoks} > > \def\eqalign#1% why no halign here, probably because of displaywidth > {\!!toksa{\strut\hfil$\displaystyle{##}$}% > \!!toksb{&$\displaystyle{{}##}$\hfil}% > \!!toksc\emptytoks > \buildeqalign > \null\,\vcenter > {\openup\jot > \mathsurround\zeropoint > \expandafter \ialign \expandafter {\the\scratchtoks\crcr#1 > \crcr}% > }\,} > > \def\eqalignno#1% > {\!!toksa{\hfil$\forgetalign\displaystyle{##}$\tabskip\zeropoint}% > \!!toksb{&$\forgetalign\displaystyle{{}##}$\tabskip\zeropoint}% > \!!toksc{\hfil\tabskip\centering&\llap{$\forgetalign##$}\tabskip > \zeropoint}% > \buildeqalign > \presetdisplaymath > \tabskip\centering > \halign to \displaywidth \expandafter {\the\scratchtoks\crcr#1 > \crcr}} > > \def\leqalignno#1% > {\!!toksa{\hfil$\forgetalign\displaystyle{##}$\tabskip\zeropoint}% > \!!toksb{&$\forgetalign\displaystyle{{}##}$\tabskip\zeropoint}% > \!!toksc{\hfil\tabskip\centering&\kern-\displaywidth\rlap{$ > \forgetalign##$}\tabskip\displaywidth}% > \buildeqalign > \presetdisplaymath > \tabskip\centering > \halign to \displaywidth \expandafter {\the\scratchtoks\crcr#1 > \crcr}} > > \definesystemvariable{eq} > > \def\setupmathalign > {\dodoubleargument\getparameters[\??eq]} > > \setupmathalign > [\c!n=2, > \c!m=1, > \c!distance=1em] > > \def\numberedeqalign > {\doifelse\@@fmlocation\v!left\leqalignno\eqalignno} > > \def\doalignNR[#1][#2]% > {\doifsomething{#1} > {\doifelse{#1}{+} > {\doformulanumber[][#2][]{}} > {\doformulanumber[#1][#2][]{}}}} > > \def\startalign > {\dosingleempty\dostartalign} > > \long\def\dostartalign[#1]#2\stopalign > {\doifassignmentelse{#1}{\setupmathalign[#1]}\donothing > \def\NC{\crcr\def\NC####1{&####1}}% > \def\EQ{&=} > \def\NR{&\dodoubleempty\doalignNR}% > % amstex compatibility mode: (ugly) > \def\notag{\def\\{&\crcr}}% > \doifelse{#1}{*}{\def\\{&\crcr}}{\def\\{&\doalignNR[+][]\crcr}}% > % end of compatibility mode > \numberedeqalign{#2}} > > %D \startbuffer > %D \placeformula \startformula \eqalignno { > %D a &= b & \formulanumber \cr > %D c &= d \cr > %D &= e \cr > %D &= f & \formulanumber > %D } \stopformula > %D \stopbuffer > %D > %D \typebuffer \getbuffer > %D > %D \startbuffer > %D \placeformula \startformula \startalign > %D \NC a \EQ b \NR[+] > %D \NC c \EQ d \NR > %D \NC \EQ f \NR[for:hans] > %D \NC \EQ g \NR[for:whoelse][a] > %D \NC \EQ h \NR[for:whomore][b] > %D \NC \EQ i \NR > %D \stopalign \stopformula > %D \stopbuffer > %D > %D \typebuffer \getbuffer > %D > %D \startbuffer > %D \placeformula \startformula \startalign > %D \NC a \EQ b \NR[+] > %D \NC c \EQ d \NR > %D \NC \EQ f \NR > %D \NC \EQ g \NR > %D \NC \EQ h \NR > %D \NC \EQ i \NR[+] > %D \stopalign \stopformula > %D \stopbuffer > %D > %D \typebuffer \getbuffer > %D > %D \startbuffer > %D \placeformula \startformula \startalign > %D a &= b \\ > %D c &= d \notag \\ > %D &= e \notag \\ > %D &= f \\ > %D \stopalign \stopformula > %D \stopbuffer > %D > %D \typebuffer \getbuffer > %D > %D \startbuffer > %D \placeformula \startformula \startalign > %D a &= b \NR[+] > %D c &= d \NR > %D &= e \NR > %D &= f \NR[+] > %D \stopalign \stopformula > %D \stopbuffer > %D > %D \typebuffer \getbuffer > %D > %D \startbuffer > %D \placeformula \startformula \startalign > %D \NC a \NC \eq b \NR[+] > %D \NC c \NC \neq d \NR > %D \NC \NC \neq f \NR[for:hans] > %D \NC \NC \geq g \NR[for:whoelse][a] > %D \NC \NC \leq h \NR[for:whomore][b] > %D \NC \NC \neq i \NR > %D \stopalign \stopformula > %D \stopbuffer > %D > %D \typebuffer \getbuffer > %D > %D \startbuffer > %D \placeformula \startformula \startalign[*] > %D a &= b \\ > %D c &= d \notag \\ > %D &= e \notag \\ > %D &= f \\ > %D \stopalign \stopformula > %D \stopbuffer > %D > %D \typebuffer \getbuffer > %D > %D \startbuffer > %D \placeformula \startformula \startalign > %D x &= y \\ > %D a &= b \\ > %D \stopalign \stopformula > %D \stopbuffer > %D > %D \typebuffer \getbuffer > %D > %D \startbuffer > %D \placeformula \startformula \startalign[m=3] > %D x &= y & x &= y & z &= t \\ > %D a &= b & p &= q & w &= s \\ > %D \stopalign \stopformula > %D \stopbuffer > %D > %D \typebuffer \getbuffer > %D > %D \startbuffer > %D \placeformula \startformula \startalign[m=3,distance=0pt] > %D x &= y &= x &= y &= z &= t \\ > %D a &= b &= p &= q &= w &= s \\ > %D \stopalign \stopformula > %D \stopbuffer > %D > %D \typebuffer \getbuffer > %D > %D \startbuffer > %D \placeformula \startformula \startalign[n=5,distance=0pt] > %D x &= yy &= xx &= yy &= zz \\ > %D a &= b &= p &= q &= w \\ > %D \stopalign \stopformula > %D \stopbuffer > %D > %D \typebuffer \getbuffer > > \protect \endinput > _______________________________________________ > ntg-context mailing list > ntg-context@ntg.nl > http://www.ntg.nl/mailman/listinfo/ntg-context