Salvete,

I finally managed to make t-nath work with \eqalign and \eqalignno. (I assume I was not the only one having trouble there?) As it appears, nath gets really confused when subformulas are enclosed in {} and contain some form of delimiters. Therefore, the original definitions just don't work, but these modifications do, at least in some sense of “work”:

\def\eqalignno#1%
  [EMAIL PROTECTED]
   \tabskip\centering
   \vcenter{%
     [EMAIL PROTECTED]
     \halign to \displaywidth
     [EMAIL PROTECTED] [EMAIL PROTECTED]
      &[EMAIL PROTECTED] {}##\stopnathdmath}\hfil\tabskip\centering
      &[EMAIL PROTECTED]@skip\crcr
       #1\crcr}}}

\def\eqalign#1%
  {\null
   \,%
   \vcenter
     {\openup
      [EMAIL PROTECTED]
      \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 continued fractions in a linear format, using the “best” way of doing so 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
  [EMAIL PROTECTED]@
  [EMAIL PROTECTED] .7\mex\!!width 0pt
    [EMAIL PROTECTED] #1}%
   \!!dimena=\ht\nathbox \advance\!!dimena-\ht\sizebox@
   [EMAIL PROTECTED]
%  \!!dimena=\dp\nathbox \advance\!!dimena .5ex \dp\nathbox=\!!dimena
   \global\!!dimend=\dp\nathbox
   \box\nathbox
  \above\fracrulethickness@
   [EMAIL PROTECTED] 2\mex\!!width 0pt
    [EMAIL PROTECTED] #2}%
   \!!dimenb=\dp\nathbox \advance\!!dimenb-\dp\sizebox@
   [EMAIL PROTECTED]
%  \!!dimenb=\ht\nathbox \advance\!!dimenb .5ex \ht\nathbox=\!!dimenb
   \global\!!dimene=\ht\nathbox
   \box\nathbox
   }%
  [EMAIL PROTECTED]
%
%
  %% See the TeXbook, page 444 f., for what is happening here.
  \ifcase\mathcount@
    \!!dimenf=\fontdimen8\textfont2
    \!!dimeng=\fontdimen11\textfont2
    \!!dimenh=3\fracrulethickness@
    \!!dimeni=\fontdimen22\textfont2
  \or
    \!!dimenf=\fontdimen9\scriptfont2
    \!!dimeng=\fontdimen12\scriptfont2
    \!!dimenh=\fracrulethickness@
    \!!dimeni=\fontdimen22\scriptfont2
  \else
    \!!dimenf=\fontdimen9\scriptscriptfont2
    \!!dimeng=\fontdimen12\scriptscriptfont2
    \!!dimenh=\fracrulethickness@
    \!!dimeni=\fontdimen22\scriptscriptfont2
  \fi
%
  \!!dimenj=\dimexpr(\!!dimenf-\!!dimend)-
    (\!!dimeni+0.5\fracrulethickness@)\relax
  \ifdim\!!dimenj<\!!dimenh
    \advance\!!dimenf by \dimexpr(\!!dimenh-\!!dimenj)\relax
  \fi
  \!!dimenj=\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{%
    [EMAIL PROTECTED]@
  [EMAIL PROTECTED] .7\mex\!!width 0pt
    [EMAIL PROTECTED] #1}%
   \ifdim\ht\nathbox<1.6ex
     \ht\nathbox=1.6ex
   \fi
   \!!dimena=\ht\nathbox \advance\!!dimena-\ht\sizebox@
   [EMAIL PROTECTED]
   \setbox\!!boxb\hbox{%
     \vrule
       \!!depth\!!dimenf
       \!!height\ht\nathbox
       \!!width\fracrulethickness@
   }%
   \dp\!!boxb=0pt
   \hfill\,
   \box\nathbox
   \,\hfill
   [EMAIL PROTECTED]
  \above\fracrulethickness@
   [EMAIL PROTECTED] 2\mex\!!width 0pt
    [EMAIL PROTECTED] #2}%
   \ifdim\dp\nathbox<.4ex
     \dp\nathbox=.4ex
   \fi
   \!!dimenb=\dp\nathbox \advance\!!dimenb-\dp\sizebox@
   [EMAIL PROTECTED]
   \setbox\!!boxb\hbox{%
     \vrule
       \!!depth\dp\nathbox
       \!!height\!!dimeng
       \!!width\fracrulethickness@
   }%
   \ht\!!boxb=0pt
   \box\!!boxb\hskip\fracrulethickness@
   \hfill\,
   \box\nathbox
   \,\hfill
   }%
  [EMAIL PROTECTED]
 \setbox\nathbox\copy\!!boxa
 \iftoprestricted@ \else
   \!!dimenb=\ht\nathbox \advance\!!dimenb .4\mex \ht\nathbox=\!!dimenb
 \fi
 \ifbotrestricted@ \else
   \!!dimenb=\dp\nathbox \advance\!!dimenb .5\mex \dp\nathbox=\!!dimenb
 \fi
 \box\nathbox  % print
 \!!dimena=\ht\!!boxa \advance\!!dimena-\htdecrement@
 \ht\!!boxa=\!!dimena
 \!!dimena=\dp\!!boxa \advance\!!dimena-\dpdecrement@
 \dp\!!boxa=\!!dimena
 [EMAIL PROTECTED]
 \endgroup
 [EMAIL PROTECTED]@}}


I do assume the whole thing could be done with about half as many lines of code, but I was glad to finally understand how TeX typesets fractions and just ignored beautifying the code. Also note that the snippet uses \fracrulethickness@ from t-nath.tex, while I honestly consider using \fontdimen8\textfont3 or whichever font size is in use for the fraction. Well, work in progress.


regards,
        Christopher Creutzig

_______________________________________________
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context

Reply via email to