Re: Re[2]: [NTG-context] Known nath bugs?

2004-05-29 Thread Sebastian Sturm
Hi,
Yes, this is generally true. All modules should get loaded
before \starttext.
Well, I had loaded it before \starttext in both cases. But when I 
loaded it in the first line of my file, it didn't adjust the 
delimiters; after moving the \usemodule[nath] line directly above the 
\starttext line, it worked like a charm. Maybe I produced some garbage 
inbetween. :-)

However, the units module still isn't working when nath is
loaded. Is it supposed to?
[...]
Anyway, it looks like the fix is easy: the problem is that
dimension commands are not protected (unexpandable).
[...]
Thank you very much, I'll try that. If it doesn't work, I can still get 
along without units, though it would have been nice to have that too. 
BTW, is there some kind of manual on aligning nath equations? I tried 
to align multiline equations using \startalign, but that only worked 
(in display mode) as long as no delimiters were used;
\[ \startalign a &= (b \\
b &= c) \stopalign \]
always produced an error message saying that I had left out an "}". I 
probably made some mistake, so a tutorial on aligning equations with 
nath would be great. The nathguide.pdf mentions eqnarray, but I guess 
that's not available in ConTeXt, or is it?

Best regards,
Sebastian
___
ntg-context mailing list
[EMAIL PROTECTED]
http://www.ntg.nl/mailman/listinfo/ntg-context


Re[2]: [NTG-context] Known nath bugs?

2004-05-29 Thread Giuseppe Bilotta
Saturday, May 29, 2004 Sebastian Sturm wrote:

> Hi,

> the delimiter sizing is working now; i had to load the module directly
> before \starttext.

Yes, this is generally true. All modules should get loaded
before \starttext.

> However, the units module still isn't working when nath is
> loaded. Is it supposed to?

Well, I had never tested them together, and given the very
extensive changes nath enacts, I'm not surprised it doesn't
work.

Anyway, it looks like the fix is easy: the problem is that
dimension commands are not protected (unexpandable).

In m-units.tex, look for the lines

\def\dimensionprefix#1%
  {\gdef\thedimensionprefix{#1}}

\def\dimensionaddfix#1%
  {\unskip
  %\mathematics{\umathematicstypeface#1}%
   \ustartmathmode\umathematicstypeface#1\ustopmathmode
   \nobreak
   \hskip\dimensionaddfixsignal}

\def\dimensionnopfix#1%
  {\dontbreakdimension
   \ifdim\scratchdimen=\dimensionpowersignal\relax
 \ustartmathmode
   \else
 \ustartmathmode
 \udimensionhalfspace
 \nobreak
   \fi
   \umathematicstypeface#1%
   \ustopmathmode
   \nobreak
   \hskip\dimensionsignal}

\def\dimensionmidfix#1%
  {\dontbreakdimension
   \ifdim\scratchdimen=\dimensionpowersignal\relax
 \ustartmathmode
 \udimensionbackspace
 \nobreak
   \else
 \ustartmathmode
   \fi
   \umathematicstypeface#1%
   \ustopmathmode
   \nobreak
   \hskip\dimensionmidfixsignal}

\def\dimensionpower#1%
  {\gdef\thedimensionpower{#1}}

and change each

\def\dimension...

into

\unexpanded\def\dimension

This should solve the problem.

I'm not 100% sure this is the best solution, though. An
alternative could be to keep those definition as they are and
instead make unexpandable the actual commands (\Micro etc).

Hans, what do you think?

-- 
Giuseppe "Oblomov" Bilotta

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