Re: [NTG-context] Reg. fonts and math

2006-01-14 Thread Aditya Mahajan

--- On Jan 13, Aditya Mahajan wrote ---


--- On Jan 13, Hans Hagen wrote ---


Aditya Mahajan wrote:


No, I mean the complicated math is much harder in context. Consider

\begin{align}
 a = b \\
 c = d \notag \\
   = f \notag \\
   = g
\end{align}

which will typeset as

 a = b(1)
 c = d
   = f
   = g(2)

\begin{subequations}
\begin{align}
 a = b \\
 c = d
\end{align}
\end{subequations}

Compare this from how to do this in context (see the wiki). You have to 
*manually* set the number of the subequation. Actually, for equation 
numbering and refering, the context way is rather limited. Consider 
something like an align environment


a = b\\
c = d\\
e = f

Suppose, I want to refer to the second equation.  In latex, I can simply 
add \label{eq:2} and the end of c= d and then \ref{eq:2}. For context, 
the reference label goes at the top, with \placeformula[eqs]. But I am not 
sure, how to give individual labels to each equations.


this 'loose label' is one of the ugliest concept i can think of -)


If you come up with any other way, I will be glad to use it. Frankly, I do 
not think that the latex syntax is the best, but plain tex looks too 
indimidating and context does not have anything yet.


btw, defaulting to numbers and then using \notag is messy; i prefer 
readable code, even if it takes more  bytes;  inventing a formula takes 
more time than keying it in.  Also, more structure,  means more hooks for 
configurability


Fine by me. Your method is perfectly acceptable.

much if this 'complicated' math is not that complicated to support,see 
attached file


Wonderful. I did not know that something like this can be done so easily in 
context.


i'm willing to implement anything reasonable but since i  hardly use such 
math i only act on 'i want to achieve this' kind of specs (i have no time 
to read tons of tex documents)


Here are features that I would want context math to have. I do not care about 
the input syntax (whether it is same as latex or not) as long as the features 
are there.


[snipped]


One more request. Allow these align, gather environments to break 
across a page. Allow the user some kind of customization, whether the 
break can occur at a particular location or not.


--
Aditya Mahajan, EECS Systems, University of Michigan
http://www.eecs.umich.edu/~adityam || Ph: 7342624008
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Reg. fonts and math

2006-01-14 Thread Tobias Burnus

Hello,


%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

Can this be enhanced to allow more than one alignment points?
For instance
f(x)   = x²+b²  = g(x)  (1)
h(x,y) = x²-5y² = g_2(x,y)  (2)
should be aligned at the each =, currently - using \equalign(no) or 
\startalign - one can only align at one.


Tobias

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Reg. fonts and math

2006-01-14 Thread Adam Duck
Just to give you some hints what's already there...

Aditya Mahajan [EMAIL PROTECTED] writes:

 63 lines deleted by Adam Duck 
 1. Have align support with variable number of columns.
  a = b
= c + d
+ e

 should be typeset as

  a = b
= c + d
+ e

At least this should be possible with \wall and \return (using the
nath module), like this:

#v+
a \wall = b \\
= c \wall + d \\
+ e
\return\return
#v-

 20 lines deleted by Adam Duck 
 5. have a splitformula environment that allows

  a = b
  + c \\
  + d

 to come out as

   a = b
   + c
   + e(1)

 with only one formula number. The formula number should be at the last
 line or the center of the whole formula, configurable by an option.
 142 lines deleted by Adam Duck 

Again, this is a \wall-\return thingy, but \placeformula places the
number vertically centered...

#v+
\usemodule[nath]
\starttext

\placeformula
\startformula
a \wall = b \\
+c \\
+e \return
\stopformula

\startformula
a \wall = b \\
= c \wall + d \\
+e \return\return
\stopformula

\stoptext
#v-

cu, Adam.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Reg. fonts and math

2006-01-14 Thread Aditya Mahajan

--- On Jan 14, Adam Duck wrote ---


Just to give you some hints what's already there...

Aditya Mahajan [EMAIL PROTECTED] writes:

 63 lines deleted by Adam Duck 

1. Have align support with variable number of columns.
 a = b
   = c + d
   + e

should be typeset as

 a = b
   = c + d
   + e


At least this should be possible with \wall and \return (using the
nath module), like this:

#v+
a \wall = b \\
= c \wall + d \\
+ e
\return\return
#v-



Unfortunately, if I use nath, I can not use underbrace inside 
\startstop align of nath. See a previous post of mine with the subject 
'Nath bug?'. It will be nice if I can use both solutions.




 20 lines deleted by Adam Duck 

5. have a splitformula environment that allows

 a = b
 + c \\
 + d

to come out as

  a = b
  + c
  + e(1)

with only one formula number. The formula number should be at the last
line or the center of the whole formula, configurable by an option.

 142 lines deleted by Adam Duck 

Again, this is a \wall-\return thingy, but \placeformula places the
number vertically centered...


Is there someway in which the formula numbering can be forced to be at 
the bottom. Maybe by adding an option to setupformulae. Latex has a 
class option ctags/tbtags which controls this.




[ useful example snipped]


Thanks,
Aditya

--
Aditya Mahajan, EECS Systems, University of Michigan
http://www.eecs.umich.edu/~adityam || Ph: 7342624008
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Reg. fonts and math

2006-01-13 Thread Hans Hagen

Aditya Mahajan wrote:


No, I mean the complicated math is much harder in context. Consider

\begin{align}
 a = b \\
 c = d \notag \\
   = f \notag \\
   = g
\end{align}

which will typeset as

 a = b(1)
 c = d
   = f
   = g(2)

\begin{subequations}
\begin{align}
 a = b \\
 c = d
\end{align}
\end{subequations}

Compare this from how to do this in context (see the wiki). You have 
to *manually* set the number of the subequation. Actually, for 
equation numbering and refering, the context way is rather limited. 
Consider something like an align environment


a = b\\
c = d\\
e = f

Suppose, I want to refer to the second equation.  In latex, I can 
simply add \label{eq:2} and the end of c= d and then \ref{eq:2}. For 
context, the reference label goes at the top, with \placeformula[eqs]. 
But I am not sure, how to give individual labels to each equations.


this 'loose label' is one of the ugliest concept i can think of -)

i'm willing to implement anything reasonable but since i  hardly use 
such math i only act on 'i want to achieve this' kind of specs (i have 
no time to read tons of tex documents)


much if this 'complicated' math is not that complicated to support,see 
attached file


btw, defaulting to numbers and then using \notag is messy; i prefer 
readable code, even if it takes more  bytes;  inventing a formula takes 
more time than keying it in.  Also, more structure,  means more hooks 
for configurability


Hans





% some simple math constructs

\unprotect

\def\numberedeqalign
  {\doifelse\@@fmlocation\v!left\leqalignno\eqalignno}

\def\doalignNR[#1][#2]%
  {\doifsomething{#1}
 {\doifelse{#1}{+}
{\doformulanumber[][#2][]{}}
{\doformulanumber[#1][#2][]{

\long\def\startalign#1\stopalign
  {\def\NC{\crcr\def\NC1{1}}%
   \def\EQ{=}
   \def\NR{\dodoubleempty\doalignNR}%
   % amstex compatibility mode:
   \def\notag{\def\\{\crcr}}%
   \def\\{\doalignNR[+][]\crcr}%
   % end of compatibility mode
   \numberedeqalign{#1\relax}}

%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

\protect \endinput
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Reg. fonts and math

2006-01-13 Thread Aditya Mahajan

--- On Jan 13, Hans Hagen wrote ---


Aditya Mahajan wrote:


No, I mean the complicated math is much harder in context. Consider

\begin{align}
 a = b \\
 c = d \notag \\
   = f \notag \\
   = g
\end{align}

which will typeset as

 a = b(1)
 c = d
   = f
   = g(2)

\begin{subequations}
\begin{align}
 a = b \\
 c = d
\end{align}
\end{subequations}

Compare this from how to do this in context (see the wiki). You have to 
*manually* set the number of the subequation. Actually, for equation 
numbering and refering, the context way is rather limited. Consider 
something like an align environment


a = b\\
c = d\\
e = f

Suppose, I want to refer to the second equation.  In latex, I can simply 
add \label{eq:2} and the end of c= d and then \ref{eq:2}. For context, the 
reference label goes at the top, with \placeformula[eqs]. But I am not 
sure, how to give individual labels to each equations.


this 'loose label' is one of the ugliest concept i can think of -)


If you come up with any other way, I will be glad to use it. Frankly, 
I do not think that the latex syntax is the best, but plain tex looks 
too indimidating and context does not have anything yet.


btw, defaulting to numbers and then using \notag is messy; i prefer readable 
code, even if it takes more  bytes;  inventing a formula takes more time than 
keying it in.  Also, more structure,  means more hooks for configurability


Fine by me. Your method is perfectly acceptable.

much if this 'complicated' math is not that complicated to support,see 
attached file


Wonderful. I did not know that something like this can be done so 
easily in context.


i'm willing to implement anything reasonable but since i  hardly use such 
math i only act on 'i want to achieve this' kind of specs (i have no time to 
read tons of tex documents)


Here are features that I would want context math to have. I do not 
care about the input syntax (whether it is same as latex or not) as 
long as the features are there.


1. Have align support with variable number of columns.
 a = b
   = c + d
   + e

should be typeset as

 a = b
   = c + d
   + e

2. Have a mechanism to individually number/not-number an equation.

3. Have a gather environment. Depending on the user option should 
either center, left justify or right justify all equations. Useful 
when you have a bunch of equation together and do not want to have 
startforumla and stopformula after each of them.


4. In align you should be able to specify the separation between 
columns. There should be some input syntax that allows you to typeset 
an output like


  a = b c = d
  e = f g = h


It will be great if you can number each equation (i.e. four number in 
the above example). There should be an option to  only number each 
line.



5. have a splitformula environment that allows

 a = b
 + c \\
 + d

to come out as

  a = b
  + c
  + e(1)

with only one formula number. The formula number should be at the last 
line or the center of the whole formula, configurable by an option.


6. Allow, someway of typesetting

  a = b + c
Using some result
= d + e

that is, you should be able to come out of the align mode temporarily 
and then go back. Latex calls this intertext. Have some means to 
adjust the before and after skips of intertext. Something like


\setupintertextskip[small or medium or big]

7. Allow some way of typesetting multilined formula where

first line is left aligned
  second line after some hskip
  third line after some hskip
  ...
  last line right alinged


This should have only one formula number, either on the last line or 
in the center of the display.


8. Have a version of align, gather and  multiline that can be used 
inside a formula. So one should be able to type


\startformula
 \left.\startaligned
  \NC a \NC= b \NR
  \NC c \NC= d \NR
  \stopaligned\right\}
  \implies
  \startaligned
  \NC b \NC= a \NR
  \NC d \NC= c \NR
  \stopaligned
\stopformula

to get

  a = b } =  b = a
  c = d } d = c

where the implies is centered between the two lined.

Have an option to make these environments come at the top, middle or 
bottom of the baseline.


9. Allow easy input of multiline subscripts. Suppose I want

  \sum
  a  b
  c  d
  e  f


10. Allow the big subscripts of math operators to be smashed to the 
left or right. Suppse, I have


 a \times \lim_{a very long equation} b_n

There should be a command, say \smashoperator such that

 a \times \smashoperator\lim_{a very long equation} b_n

comes as
  a lim b_n
a very long eq

where (a very long equation) in centered beneath the center of lim but 
the bounding box is the bb of lim not the bb of the subscript

Also

 a \times \smashoperator[r]\lim_{a very long equation} b_n

should come as

 a  lim b_n
   a very lone eq

where the bounding box of a lim on the right is the bb of the lim, 
on the left is the bb of the subscript.


Similarly of \smashoperator[l]

11. 

Re: [NTG-context] Reg. fonts and math

2006-01-12 Thread Hans Hagen

Aditya Mahajan wrote:

Most math in latex is *not* same as tex math. Though, most that can be 
done with latex can also be done in tex, but latex does provide a nice 
interface which sadly is missing in context. amsl and nath modules 
provide some of this functionality but a lot still needs to be done to 
make Context math handling as easy as it is in Latex.



Do you mean that everything between $ $ and \begin{math} \end{math} is 
different?


a + b
\int ...
\sqrt

etc is not different is it?

Hans
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Reg. fonts and math

2006-01-12 Thread Aditya Mahajan

On Thu, 12 Jan 2006, Hans Hagen wrote:


Aditya Mahajan wrote:

Most math in latex is *not* same as tex math. Though, most that can be done 
with latex can also be done in tex, but latex does provide a nice interface 
which sadly is missing in context. amsl and nath modules provide some of 
this functionality but a lot still needs to be done to make Context math 
handling as easy as it is in Latex.



Do you mean that everything between $ $ and \begin{math} \end{math} is 
different?


a + b
\int ...
\sqrt

etc is not different is it?


No, I mean the complicated math is much harder in context. Consider

\begin{align}
 a = b \\
 c = d \notag \\
   = f \notag \\
   = g
\end{align}

which will typeset as

 a = b(1)
 c = d
   = f
   = g(2)


There is no Context way to do it, and one has to resort to plain tex

\placeformula
$$
\eqalignno{
 a = b \formulanumber \cr
 c = d \cr
   = f \cr
   = g \formulanumber}
$$

Context gives the same result, but the input syntax is much more verbose 
than the latex syntax.


Latex also has a lot of other useful enviromnemts like

\begin{equation}
 \begin{split}
   a = b \\
 = c
  \end{split}
\end{equation}

Again, the same effect can be achieved in plain tex, but it is more 
verbose.


amsmath also has some useful environments like multalign and aligned, 
gathered, faligned, alignat, etc. Some of their functionality can be 
achieved using \start stop array from amsl but the amsmath environments 
have a lot more features.


There are certain features that are much more difficult to achieve using 
context. Consider equation subnumbering. In latex, it is as simple as


\begin{subequations}
\begin{align}
 a = b \\
 c = d
\end{align}
\end{subequations}

Compare this from how to do this in context (see the wiki). You have to 
*manually* set the number of the subequation. Actually, for equation 
numbering and refering, the context way is rather limited. Consider 
something like an align environment


a = b\\
c = d\\
e = f

Suppose, I want to refer to the second equation.  In latex, I can simply 
add \label{eq:2} and the end of c= d and then \ref{eq:2}. For context, 
the reference label goes at the top, with \placeformula[eqs]. But I am not 
sure, how to give individual labels to each equations.



Browse through http://www-sop.inria.fr/miaou/latex/voss-math.pdf which 
explains almost all math tricks in latex. For some of the more complicated 
stuff, compare the latex code and the context code to achieve that result. 
Context has all the features, but for complicated maths, they are low 
level tricks. There is no upper layer like amsmath making life easier for 
the user. It will be nice to have such a layer.


Aditya
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context