From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/16776 Path: main.gmane.org!not-for-mail From: Christopher Creutzig Newsgroups: gmane.comp.tex.context Subject: more nath patches Date: Tue, 26 Oct 2004 15:08:08 +0200 Sender: ntg-context-bounces@ntg.nl Message-ID: <417E4C38.1060107@creutzig.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1098796222 10686 80.91.229.6 (26 Oct 2004 13:10:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 26 Oct 2004 13:10:22 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Oct 26 15:10:02 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 1CMR5O-0002Cg-00 for ; Tue, 26 Oct 2004 15:10:02 +0200 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 8231012772; Tue, 26 Oct 2004 15:10:01 +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 19340-01; Tue, 26 Oct 2004 15:10:00 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C76A212777; Tue, 26 Oct 2004 15:08:15 +0200 (CEST) Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 6B2C312777 for ; Tue, 26 Oct 2004 15:08:14 +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 19044-05 for ; Tue, 26 Oct 2004 15:08:13 +0200 (CEST) Original-Received: from mailgate2.uni-paderborn.de (unknown [131.234.22.35]) by ronja.ntg.nl (Postfix) with ESMTP id 50F7712772 for ; Tue, 26 Oct 2004 15:08:13 +0200 (CEST) Original-Received: from mlt131.math.uni-paderborn.de ([131.234.103.131]) by mailgate2.uni-paderborn.de with asmtp (TLSv1:AES256-SHA:256) (Exim 4.34) id 1CMR3D-0004tl-L8 for ntg-context@ntg.nl; Tue, 26 Oct 2004 15:07:47 +0200 User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: de, en-gb, en, en-us Original-To: ConTeXt Mailingliste X-Enigmail-Version: 0.84.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime X-UNI-PB_FAK-EIM-MailScanner-Information: Please see http://imap.uni-paderborn.de for details X-UNI-PB_FAK-EIM-MailScanner: Found to be clean X-UNI-PB_FAK-EIM-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-5, required 4, AUTH_EIM_USER -5.00) X-MailScanner-From: christopher@creutzig.de 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:16776 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:16776 Salvete, I finally managed to make t-nath work with \eqalign and \eqalignno. (I=20 assume I was not the only one having trouble there?) As it appears,=20 nath gets really confused when subformulas are enclosed in {} and=20 contain some form of delimiters. Therefore, the original definitions=20 just don't work, but these modifications do, at least in some sense of=20 =93work=94: \def\eqalignno#1% {\displ@y \tabskip\centering \vcenter{% \openup\jot\m@th \halign to \displaywidth {\hfil{\startnathdmath\@lign ##\stopnathdmath}\tabskip\z@skip &{\startnathdmath\@lign {}##\stopnathdmath}\hfil\tabskip\centering &\llap{$\@lign##$}\tabskip\z@skip\crcr #1\crcr}}} \def\eqalign#1% {\null \,% \vcenter {\openup \jot\m@th \ialign {\strut\hfil{\startnathdmath ##\stopnathdmath}&% {\startnathdmath {}##\stopnathdmath}\hfil\crcr #1\crcr}}% \,} And I've got another snippet I'd like to share, which helps displaying=20 continued fractions in a linear format, using the =93best=94 way of doing= so=20 I've met so far: \def\contfrac#1#2{% % To get the lines at the top right and bottom left % at the correct lengths, we need to know the final heights % of both top and bottom. Since styles ``C-up'' and ``C-down'' % are used only in generalized fractions, we need a trial % typesetting run for this. \begingroup \setbox\!!boxa\hbox{\trialtypesettingtrue\o@math\dcurrstyle@ {\setbox\nathbox\currstyle@hbox{%\vrule\!!depth .7\mex\!!width 0pt \botrestricted@false #1}% \!!dimena=3D\ht\nathbox \advance\!!dimena-\ht\sizebox@ \global\htdecrement@=3D\!!dimena % \!!dimena=3D\dp\nathbox \advance\!!dimena .5ex \dp\nathbox=3D\!!dimena \global\!!dimend=3D\dp\nathbox \box\nathbox \above\fracrulethickness@ \setbox\nathbox\currstyle@hbox{%\vrule\!!height 2\mex\!!width 0pt \toprestricted@false #2}% \!!dimenb=3D\dp\nathbox \advance\!!dimenb-\dp\sizebox@ \global\dpdecrement@=3D\!!dimenb % \!!dimenb=3D\ht\nathbox \advance\!!dimenb .5ex \ht\nathbox=3D\!!dimenb \global\!!dimene=3D\ht\nathbox \box\nathbox }% \o@math}% % % %% See the TeXbook, page 444 f., for what is happening here. \ifcase\mathcount@ \!!dimenf=3D\fontdimen8\textfont2 \!!dimeng=3D\fontdimen11\textfont2 \!!dimenh=3D3\fracrulethickness@ \!!dimeni=3D\fontdimen22\textfont2 \or \!!dimenf=3D\fontdimen9\scriptfont2 \!!dimeng=3D\fontdimen12\scriptfont2 \!!dimenh=3D\fracrulethickness@ \!!dimeni=3D\fontdimen22\scriptfont2 \else \!!dimenf=3D\fontdimen9\scriptscriptfont2 \!!dimeng=3D\fontdimen12\scriptscriptfont2 \!!dimenh=3D\fracrulethickness@ \!!dimeni=3D\fontdimen22\scriptscriptfont2 \fi % \!!dimenj=3D\dimexpr(\!!dimenf-\!!dimend)- (\!!dimeni+0.5\fracrulethickness@)\relax \ifdim\!!dimenj<\!!dimenh \advance\!!dimenf by \dimexpr(\!!dimenh-\!!dimenj)\relax \fi \!!dimenj=3D\dimexpr(\!!dimeni-0.5\fracrulethickness@)- (\!!dimene-\!!dimeng)\relax \ifdim\!!dimenj<\!!dimenh \advance\!!dimeng by \dimexpr(\!!dimenh-\!!dimenj)\relax \fi % \advance\!!dimenf by\dimexpr(-\!!dimeni)\relax \advance\!!dimeng by\dimexpr(+\!!dimeni)\relax % \setbox\!!boxa\hbox{% \o@math\dcurrstyle@ {\setbox\nathbox\currstyle@hbox{%\vrule\!!depth .7\mex\!!width 0pt \botrestricted@false #1}% \ifdim\ht\nathbox<1.6ex \ht\nathbox=3D1.6ex \fi \!!dimena=3D\ht\nathbox \advance\!!dimena-\ht\sizebox@ \global\htdecrement@=3D\!!dimena \setbox\!!boxb\hbox{% \vrule \!!depth\!!dimenf \!!height\ht\nathbox \!!width\fracrulethickness@ }% \dp\!!boxb=3D0pt \hfill\, \box\nathbox \,\hfill \hskip\fracrulethickness@\box\!!boxb \above\fracrulethickness@ \setbox\nathbox\currstyle@hbox{%\vrule\!!height 2\mex\!!width 0pt \toprestricted@false #2}% \ifdim\dp\nathbox<.4ex \dp\nathbox=3D.4ex \fi \!!dimenb=3D\dp\nathbox \advance\!!dimenb-\dp\sizebox@ \global\dpdecrement@=3D\!!dimenb \setbox\!!boxb\hbox{% \vrule \!!depth\dp\nathbox \!!height\!!dimeng \!!width\fracrulethickness@ }% \ht\!!boxb=3D0pt \box\!!boxb\hskip\fracrulethickness@ \hfill\, \box\nathbox \,\hfill }% \o@math}% \setbox\nathbox\copy\!!boxa \iftoprestricted@ \else \!!dimenb=3D\ht\nathbox \advance\!!dimenb .4\mex \ht\nathbox=3D\!!dim= enb \fi \ifbotrestricted@ \else \!!dimenb=3D\dp\nathbox \advance\!!dimenb .5\mex \dp\nathbox=3D\!!dim= enb \fi \box\nathbox % print \!!dimena=3D\ht\!!boxa \advance\!!dimena-\htdecrement@ \ht\!!boxa=3D\!!dimena \!!dimena=3D\dp\!!boxa \advance\!!dimena-\dpdecrement@ \dp\!!boxa=3D\!!dimena \global\setbox\sizebox@\copy\!!boxa \endgroup \resizebox@{\sizebox@}} I do assume the whole thing could be done with about half as many=20 lines of code, but I was glad to finally understand how TeX typesets=20 fractions and just ignored beautifying the code. Also note that the=20 snippet uses \fracrulethickness@ from t-nath.tex, while I honestly=20 consider using \fontdimen8\textfont3 or whichever font size is in use=20 for the fraction. Well, work in progress. regards, Christopher Creutzig