ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Math module alpha version
@ 1999-10-22 14:05 Taco Hoekwater
  1999-10-23 14:03 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Taco Hoekwater @ 1999-10-22 14:05 UTC (permalink / raw)


Hi all,

I just uploaded a preliminary, very alpha version of the math
module. The largest portion of the module is actually a more or less
automatic conversion of Michael Downes' breqn package for latex.

The code is far from perfect, but it is about time to get some
feedback on macros that should be added and/or stuff that is *really*
broken. Therefore, if you are interested, have a go!

  http://wwww.cybercomm.nl/~bittext/temp/m-math.zip

Stuff I already know:

 - all the limitations in Downes' package still apply
 - no amsfonts support
 - no 'array'-like command

Greetings,

Taco

-- 
Taco Hoekwater                                 taco.hoekwater@wkap.nl
Kluwer Academic Publishers                            -- Pre Press --
Achterom 119, 3311 KB Dordrecht, The Netherlands  tel.  31-78-6392550
---------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Math module alpha version
  1999-10-22 14:05 Math module alpha version Taco Hoekwater
@ 1999-10-23 14:03 ` Hans Hagen
  1999-10-25 10:17   ` Taco Hoekwater
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 1999-10-23 14:03 UTC (permalink / raw)
  Cc: ntg-context

[sorry for this rather technical reply, but since many present on this
list use math ...]

Taco Hoekwater wrote:

> I just uploaded a preliminary, very alpha version of the math
> module. The largest portion of the module is actually a more or less
> automatic conversion of Michael Downes' breqn package for latex.
> 
> The code is far from perfect, but it is about time to get some
> feedback on macros that should be added and/or stuff that is *really*
> broken. Therefore, if you are interested, have a go!
> 
>   http://wwww.cybercomm.nl/~bittext/temp/m-math.zip
           ^^^
> Stuff I already know:
> 
>  - all the limitations in Downes' package still apply
>  - no amsfonts support
>  - no 'array'-like command

Some first remarks:

(1) Can we still use the \dostartformula in this form, since it is tuned
for grid snapping and spacing, or should it be applied to math lines?  

(2) Option processing: moving the inits to the setup macro will speed up
things. (To suit the current code: 

   \appendtoks \processaction[..]\to \everymathsetup 

combined with 

  \def\setupmath[#1]{\getparameters[..][#1]\the\everymathsetup}

this saves some init time.

(3) Change hard coded 12pt (10pt) into \bodyfontsize. 

(4) \dotext cum suis can be combine with existing stuff in core-mat.tex

(5) Suggestion: 

\def\definemathoperator#1 #2 #3 %
  {\unexpanded\def#1{\dohandlemathoperator{#2}{#3}}

\def\dohandlemathoperator#1#2%
  {..}

saves memory (which is I admit a bit of a joke) but permits runtime
overruling e.g. when stripping down. 

(6) \def\boldmath... 

more efficient is to use an additional level of indirectness, and only
change the file name mappings (see preliminary unicode/chinese module). 

\def\boldmath%
  {\definefontsynonym[MathRoman][BoldMathRoman]....\setmathfamilies}

or, 

[mr=\truefontname{Math}Roman,...]

and \definefontsynonym[Math][MathRoman] which is only one call! Untested
for \setmathfamilies, but when failing there it can be made to work. 

(7) Extend the symbols module with math symbols, and then map the latex
stuff on that. \usesymbols is already taken / reserved, so loading latex
symbols will take place with \UseMathSymbols (uppercase suits the
definition macros better

(8) Use \convertargument/command instead of \meaning stuff. 

(9) Reverse \; and \stickspace defs. Functionally the same but looks
better -) 

(10) This root macro is awful indeed. A cold winternight challenge. 

(11) sans and type: not a mistake, on purpose; switching style is a
massive operation. We can use fma 15 for someting like that, but then I
prefer a more functional name over ss 

(12) This ^ _ looks solvable since we know that we're dealing with
context. 

(13) \let\samplerelation\hiderel

(14) use [style=] for style only and add use [inner=] (more in tune with
context) 

(15) replace the ams framed stuff and parameters: 

   \presetlocalframed[mo]

(frame=1pt does not suit context anyway, frameset => offset) 

by hooking framed into this we get much more functionality! Actually I
would like to have frame applied to every component of an eq, but that's
for later. I also want a [command=] hook. 

(16) Is this ifstar thing needed? 

(17) Can't you use a \hbox{}\setbox\scratchbox=\lastbox instead of relax
in \z@rule?

(18) \saveprimitive -> syst module and more in tune with context,
\normal...

(19) Ah, this \do#1#2 is a joke, isn't it? par 124-126 can best be
parameterized. 

(20) \listwidth; you can use \setlocalhsize .. 

(21) .. incorrectly set .. this was rather on purpose -) Just beter
avarage spacing with the normal correction macros but maybe the ams
alternative shortskip macros take care of this. 

(22) Nice \lowercase hack (if I get it right) in 180. Can't you use
syst-* macros for this btw?  

(23) Inserts and marks. Something for later (at least \localcolorstrue
and \postponefootnote..). 

(x) Off line we can discuss removing some of the code uggliness you
mention. 
(y) Corrections to documentation not included here. 
(z) Now we need a sample document (with davids examples etc). 

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Math module alpha version
  1999-10-25 10:17   ` Taco Hoekwater
@ 1999-10-25  9:29     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 1999-10-25  9:29 UTC (permalink / raw)
  Cc: ntg-context

Taco Hoekwater wrote:

>     Hans> (4) \dotext cum suis can be combine with existing stuff in
>     Hans> core-mat.tex
> 
> Will check. But the idea is that this will stay a module, agreed?.

Sure. I like the idea of field related modules (chemistry, math,
humanities, etc). 

>     Hans> and \definefontsynonym[Math][MathRoman] which is only one
>     Hans> call! Untested for \setmathfamilies, but when failing there
>     Hans> it can be made to work.
> 
> Clear. But this is still a hack. I want a 'mx' family along with 'mm',
> since \boldmath might well mean \serifmath or something. It all depends
> on how you define your headings.

Well, why not take \fam<15> for that? It's still free? 

> I don't care about the name here, but lots of math really needs a
> sans-serif shape for identifiers and constants. (much like the way
> bold is used for vector notation). I think we can live without tt, but
> the sans is really needed.

Hm. Can we use the nnfam for that? 

>     Hans> (13) \let\samplerelation\hiderel
> 
> Huh?

Well, isn't \hiderel (as you describe it) a sample fused to calculate
something (e.g. width) to be used later? 

> OK, but style= doesn't make much sense then. Anyway, we are not
> limited by the latex commands

Right, so get rid of 'style' because it's a different animal, use either
'inner' or 'commands' (prefered). 

> Just use
> 
>   \saveprimitive \mark
> 
> then, with automatic addition of 'normal' by \saveprimitive?

Yes. 

> Hm. The \listwidth is another latex artifact, and it is related to
> latex's list handling macros. This is actually a part of context I
> don't understand very well. Suppose I am in e.g. a nested
> \startsmaller or a second-level \item.  Then where is the identation
> coming from? Is there a macro I can use to get at these values?

Context list macros just use left- and rightskip, which is why
startsmaller and itemize etc all work together. The \setlocalhsize gives
you the \localhsize you want, and then \leftskip is your margin.  

>     Hans> (21) .. incorrectly set .. this was rather on purpose -)
>     Hans> Just beter avarage spacing with the normal correction macros
>     Hans> but maybe the ams alternative shortskip macros take care of
>     Hans> this.
> 
> That's the idea.

Ok, then I simply wait and cross my fingers. 

Hans

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.nl
-----------------------------------------------------------------


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Math module alpha version
  1999-10-23 14:03 ` Hans Hagen
@ 1999-10-25 10:17   ` Taco Hoekwater
  1999-10-25  9:29     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Taco Hoekwater @ 1999-10-25 10:17 UTC (permalink / raw)


>>>>> "Hans" == Hans Hagen <pragma@wxs.nl> writes:

    Hans> [sorry for this rather technical reply, but since many
    Hans> present on this list use math ...]

Amount of feedback is truely amazing. Thanks all!

    >> Stuff I already know:
    >> 
    >> - all the limitations in Downes' package still apply - no
    >> amsfonts support - no 'array'-like command

    Hans> Some first remarks:

    Hans> (1) Can we still use the \dostartformula in this form, since
    Hans> it is tuned for grid snapping and spacing, or should it be
    Hans> applied to math lines?

Grid snapping etc. should be applied to both. I'll start working on
that today.  \dostartformula is still functional (even has some extra
options), but \startdmath has the 'advantage' of automatic line
breaking. I think both should stay (at least until \startdmath is as
good as \startformula).

    Hans> (2) Option processing: moving the inits to the setup macro
    Hans> will speed up things. (To suit the current code:

Still needs work anyway. Too much stuff is hardwired as it is.

    Hans>    \appendtoks \processaction[..]\to \everymathsetup

    Hans> combined with

    Hans>
    Hans> \def\setupmath[#1]{\getparameters[..][#1]\the\everymathsetup}

    Hans> this saves some init time.

OK, I understand that.

    Hans> (3) Change hard coded 12pt (10pt) into \bodyfontsize.

This is in \QED? \QED Should be merged with the trailing punct. code,
since it is essentially a very special kind of punctuation.

    Hans> (4) \dotext cum suis can be combine with existing stuff in
    Hans> core-mat.tex

Will check. But the idea is that this will stay a module, agreed?.

    Hans> (5) Suggestion:

    Hans> \def\definemathoperator#1 #2 #3 %
    Hans> {\unexpanded\def#1{\dohandlemathoperator{#2}{#3}}

    Hans> \def\dohandlemathoperator#1#2% {..}

    Hans> saves memory (which is I admit a bit of a joke) but permits
    Hans> runtime overruling e.g. when stripping down.

Saving memory is hardly a concern, but the flexibility gain is
important. Will do (and try to blend in the name with the other
command names).

    Hans> (6) \def\boldmath...

    Hans> more efficient is to use an additional level of
    Hans> indirectness, and only change the file name mappings (see
    Hans> preliminary unicode/chinese module).

    Hans> \def\boldmath%
    Hans> {\definefontsynonym[MathRoman][BoldMathRoman]....\setmathfamilies}

    Hans> or,

    Hans> [mr=\truefontname{Math}Roman,...]

    Hans> and \definefontsynonym[Math][MathRoman] which is only one
    Hans> call! Untested for \setmathfamilies, but when failing there
    Hans> it can be made to work.

Clear. But this is still a hack. I want a 'mx' family along with 'mm',
since \boldmath might well mean \serifmath or something. It all depends
on how you define your headings.

    Hans> (7) Extend the symbols module with math symbols, and then
    Hans> map the latex stuff on that. \usesymbols is already taken /
    Hans> reserved, so loading latex symbols will take place with
    Hans> \UseMathSymbols (uppercase suits the definition macros
    Hans> better

Will check and merge if doable.

    Hans> (8) Use \convertargument/command instead of \meaning stuff.

The \meaning stuff is typically amstex.

    Hans> (9) Reverse \; and \stickspace defs. Functionally the same
    Hans> but looks better -)

Sure.

    Hans> (10) This root macro is awful indeed. A cold winternight
    Hans> challenge.

Wait till you see the \dots one... I'll reinsert that sooner or later 
anyway.

    Hans> (11) sans and type: not a mistake, on purpose; switching
    Hans> style is a massive operation. We can use fma 15 for someting
    Hans> like that, but then I prefer a more functional name over ss

I don't care about the name here, but lots of math really needs a
sans-serif shape for identifiers and constants. (much like the way
bold is used for vector notation). I think we can live without tt, but 
the sans is really needed.

    Hans> (12) This ^ _ looks solvable since we know that we're
    Hans> dealing with context.

I dont care if ^ and _ are active, but I need to check some conflicts
with the mathtime macros (where _ is active to solve a spacing problem 
for $x_j$).

    Hans> (13) \let\samplerelation\hiderel

Huh?

    Hans> (14) use [style=] for style only and add use [inner=] (more
    Hans> in tune with context)

OK, but style= doesn't make much sense then. Anyway, we are not
limited by the latex commands

    Hans> (15) replace the ams framed stuff and parameters:

    Hans>    \presetlocalframed[mo]

    Hans> (frame=1pt does not suit context anyway, frameset => offset)

    Hans> by hooking framed into this we get much more functionality!
    Hans> Actually I would like to have frame applied to every
    Hans> component of an eq, but that's for later. I also want a
    Hans> [command=] hook.

I know. Just hacked something quickly so that it will more or less
work. I didn't want to get into the \framed stuff then, because lots
of portions of the code wouldn't even compile yet.

    Hans> (16) Is this ifstar thing needed?

No, not any more. LaTeX artifact, I'll kill it in the next version. 

    Hans> (17) Can't you use a \hbox{}\setbox\scratchbox=\lastbox
    Hans> instead of relax in \z@rule?

No, not the way the macros are now. See Michael's comments on the subject.

    Hans> (18) \saveprimitive -> syst module and more in tune with
    Hans> context, \normal...

Just use

  \saveprimitive \mark

then, with automatic addition of 'normal' by \saveprimitive?

    Hans> (19) Ah, this \do#1#2 is a joke, isn't it? par 124-126 can
    Hans> best be parameterized.

I thought it was quite funny ;-) This is probably the most compact
code I've ever seen that is still documented! Will move this into
parameters, since I do want to change some of the values
interactively. 

    Hans> (20) \listwidth; you can use \setlocalhsize ..

Hm. The \listwidth is another latex artifact, and it is related to
latex's list handling macros. This is actually a part of context I
don't understand very well. Suppose I am in e.g. a nested
\startsmaller or a second-level \item.  Then where is the identation
coming from? Is there a macro I can use to get at these values?

    Hans> (21) .. incorrectly set .. this was rather on purpose -)
    Hans> Just beter avarage spacing with the normal correction macros
    Hans> but maybe the ams alternative shortskip macros take care of
    Hans> this.

That's the idea. 

    Hans> (22) Nice \lowercase hack (if I get it right) in 180. Can't
    Hans> you use syst-* macros for this btw?

In the gp@continue, you mean? This can be done a lot cleaner than it
is now. The latex code has to go through a lot of trouble, because it
is called from somewhere in the middle of the expansion of \end{..},
but in context there is no need to be so tricky.

    Hans> (23) Inserts and marks. Something for later (at least
    Hans> \localcolorstrue and \postponefootnote..).

OK, later.

    Hans> (x) Off line we can discuss removing some of the code
    Hans> uggliness you mention.  (y) Corrections to documentation not
    Hans> included here.  (z) Now we need a sample document (with
    Hans> davids examples etc).

    Hans> Hans

    Hans> -----------------------------------------------------------------
    Hans> Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt |
    Hans> The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 |
    Hans> www.pragma-ade.nl
    Hans> -----------------------------------------------------------------

-- 
Taco Hoekwater                                 taco.hoekwater@wkap.nl
Kluwer Academic Publishers                            -- Pre Press --
Achterom 119, 3311 KB Dordrecht, The Netherlands  tel.  31-78-6392550
---------------------------------------------------------------------


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1999-10-25 10:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-22 14:05 Math module alpha version Taco Hoekwater
1999-10-23 14:03 ` Hans Hagen
1999-10-25 10:17   ` Taco Hoekwater
1999-10-25  9:29     ` Hans Hagen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).