[NTG-context] Extend the fraction bar

2006-07-01 Thread David Arnold
All,

How can I extend the main fraction bar in the following expression,  
making it a tad longer?

\placeformula
\startformula
\dfrac{\dfrac{9+3x-2x^2}{x^2-16}}{\dfrac{4x^3-9x}{2x^2+5x-12}}.
\stopformula
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Malicious little bugger

2006-07-01 Thread David Arnold
All,

Came across this again.

\placeformula[-]
\startformula
[9,\infty)=\{x:\,x\ge 9\}
\stopformula

Got it to compile with:

\placeformula[-]
\startformula\relax
[9,\infty)=\{x:\,x\ge 9\}
\stopformula

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


[NTG-context] Oh no! Never update in the middle of a project. I am in trouble.

2006-06-27 Thread David Arnold
All,

I updated to Gerben's latest context and now files that formally  
compiled will not.

Here's one error:

The code:

Let's look at another example.

\startexample[exam:relT]
Consider the relation $T$ defined by

\placeformula[eq:rel2]
\startformula
T=\big\{(1,2), (3,2), (4,5)\big\}.
\stopformula

What is the domain and range of this relation?

The result:

! Extra }, or forgotten \endgroup.
\doattributes ...name [EMAIL PROTECTED] \endcsname \fi {#4}
   \dostopattributes
\special@@descriptionhandler ...t #2\endstrut 
   \doifsomething  
{\descripti...

\@@dostartdescription ...gnorespaces #3\endstrut }
   }\assignwidth \!! 
widtha {\...

\@@descriptionserriedbroad ...\def \\{\crlf }}{#2}
   \noindent  
\ignorespaces \i...

\dodogotopar ...description {example}[exam:relT]{}
   \BeforePar \emptytoks
to be read again
C
l.100 C
onsider the relation $T$ defined by
?

Example is defined by:

\defineenumeration
[example]
[location=serried,
width=broad,
text={\color[heavygreen]\bgroup\bold{Example}},
stopper={.\egroup},
style=slanted,
inbetween=\blank,
after=\blank]


I need help!
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] eqno not in math

2006-05-29 Thread Taco Hoekwater
Hans van der Meer wrote:
 Something strange occurs in math, doing:
 
 \placeformula\startformula
   H(K|M,C) = H(K|C) - H(M|C)\eqno{\hbox{(\in{}[eq:keyapp])}}
 \stopformula

Please use:

\placeformula[-]\startformula


 produces the following error:
 
 ! You can't use `\eqno' in math mode.

This message is a bit misleading. Knuth means to say:

   ! You can't use `\eqno' in non-display math mode.

... and that is precisely what happens when you try to use
\eqno in a formula that is numbered automatically already.

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


Re: [NTG-context] eqno not in math

2006-05-29 Thread Hans van der Meer

On May 29, 2006, at 9:01, Taco Hoekwater wrote:

 Hans van der Meer wrote:
 Something strange occurs in math, doing:

 \placeformula\startformula
  H(K|M,C) = H(K|C) - H(M|C)\eqno{\hbox{(\in{}[eq:keyapp])}}
 \stopformula

 Please use:

 \placeformula[-]\startformula


 produces the following error:
 
 ! You can't use `\eqno' in math mode.

 This message is a bit misleading. Knuth means to say:

! You can't use `\eqno' in non-display math mode.


Taco,

Thanks for that explanation. I would not have found out by myself  
that this error is not about being in math mode, but about being in a  
numbered equation.
I am inclined to stick to this as a bug. Not of ConTeXt, of course,  
but of TeX's error reporting system. It would be nice if someone in  
the pdfetex community took it as a challenge to make this error item  
more to the point.

Hans van der Meer



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


Re: [NTG-context] eqno not in math

2006-05-29 Thread Hans Hagen
Hans van der Meer wrote:
 On May 29, 2006, at 9:01, Taco Hoekwater wrote:

   
 Hans van der Meer wrote:
 
 Something strange occurs in math, doing:

 \placeformula\startformula
 H(K|M,C) = H(K|C) - H(M|C)\eqno{\hbox{(\in{}[eq:keyapp])}}
 \stopformula
   
 Please use:

 \placeformula[-]\startformula


 
 produces the following error:
 
 ! You can't use `\eqno' in math mode.
   
 This message is a bit misleading. Knuth means to say:

! You can't use `\eqno' in non-display math mode.

 

 Taco,

 Thanks for that explanation. I would not have found out by myself  
 that this error is not about being in math mode, but about being in a  
 numbered equation.
 I am inclined to stick to this as a bug. Not of ConTeXt, of course,  
 but of TeX's error reporting system. It would be nice if someone in  
 the pdfetex community took it as a challenge to make this error item  
 more to the point.
   
something like this ... but i first need proper testing by the math 
gurus here

\unprotect

\definemessageconstant{math}

\startmessages  all  library: math
  title: math
  1: don't use -- here (line \the\inputlineno)
\stopmessages

\def\invalidmathcommand#1{\showmessage\m!math1{#1}}

\let\normaleqno \eqno
\let\normalleqno\leqno

\appendtoks
\def\eqno {\invalidmathcommand{\string\eqno }}%
\def\leqno{\invalidmathcommand{\string\leqno}}%
\to \everydisplay

\appendtoks
\let\eqno\normaleqno
\let\leqno\normaleqno
\to \everymath

\protect

\placeformula\startformula
H(K|M,C) = H(K|C) - H(M|C)\eqno{\hbox{(\in{}[eq:keyapp])}}
\stopformula



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

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


[NTG-context] eqno not in math

2006-05-28 Thread Hans van der Meer
Something strange occurs in math, doing:

\placeformula\startformula
H(K|M,C) = H(K|C) - H(M|C)\eqno{\hbox{(\in{}[eq:keyapp])}}
\stopformula

produces the following error:

! You can't use `\eqno' in math mode.
argument \normalreqno
 {\doformulanumber [][][]{}}
\secondoftwoarguments #1#2-#2

\dostopformula -\doplaceformulanumber
\getvalue {\e!stop  
\formulaparameter ...
l.20 \stopformula


Why cannot \eqno be used in math mode? It is its raison d'etre!
Plain TeX typesets the following input without problems:
$$ a = b + c\eqno{(12)} $$
\end

Strange enough the following does work as expected:

\placeformula\startformula
\eqalignno{
H(K|M,C) = H(K|C) - H(M|C)\eqno{\hbox{(\in{}[eq:keyapp])}}\cr
}
\stopformula

Is this a little bug perhaps?

Hans van der Meer



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


[NTG-context] More Feature Requests for math

2006-05-17 Thread Aditya Mahajan
Hi Hans,

  Can you provide some more features to \definematrix and 
\definemathcases.

1. Allow \definematrix and \definemathcases to have a parameter 
displaystyle or textstyle. Right now, everything is in textstyle. 
Consider
\startformula
   a = \startcases
 \NC E = mc^2 \NC nothing interesting to see here \NR
 \NC \int_0^1 x - 3 d\,x \NC Integral is in text mode \NR
   \stopcases
\stopformula

\startformula
   \startmatrix[n=2]
 \NC x \NC y \NR
 \NC \int_0^1 x - 3 d\,x \NC 20 \NR
   \stopmatrix
\stopformula

Both integrals are in textstyle. It will be nice if one had a 
configuration like
\definemathcases[displaycases][displaystyle]

and \definemathmatrix[displaymatrix][displaystyle]

so that

\startdisplaymatrix
  \NC a \NC b \NR
  \NC d \NC e \NR
\stopdisplaymatrix

is equivalent to

\startmatrix
  \NC \displaystyle a \NC \displaystyle b \NR
  \NC \displaystyle d \NC \displaystyle e \NR
\stopmatrix

and similar for startdisplaycases.

I don't know which syntax is better displaystyle=on|off (yes|no) or 
[mathstyle=display|text].

2. Allow location=top|center|bottom for \definemathmatrix. Right now, 
inside \dostartmathmatrix there is a \vcenter. Can this be changed to 
\vtop or \vbottom depending on the value of location.


With these features, it will be straightforward to emulate the 
behaviour of aligned and gathered environments of amsmath.

3. Can pagebreak inside \startalign be restored. This used to work, 
but broke while ensuring compatibility with \setupformulas[align=??]

\placeformula \startformula \startalign
   \dorecurse{50}
   { \NC a \EQ b \NR[+] }
\stopalign \stopformula


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] List of Formulas

2006-05-10 Thread Hans Hagen
nico wrote:
 On Tue, 09 May 2006 23:38:47 +0200, Hans Hagen [EMAIL PROTECTED] wrote:

   
 nico wrote:
 
 Hello,

 Is it possible to display a list of the numbered formulas (done with
 \placeformula)? I tried \placelist[formula] without success.

   
 you want to see the formulas too?
 

 Well, no, i just wanted a list, like a list of tables, figures, or  
 enumerations, with the pages where they appear. But ok, since it is not  
 available by default, i can put each formula in a specific Equation  
 enumeration an then do a \placelist[enumeration:Equation].
   
but formulas don't have 'names' so what does such al list look like? 

it should not be too hard to add a feature of named formulas combined with a 
regular list

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.com
 | www.pragma-pod.nl
-

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


Re: [NTG-context] List of Formulas

2006-05-10 Thread Hans Hagen
nico wrote:
 On Tue, 09 May 2006 23:38:47 +0200, Hans Hagen [EMAIL PROTECTED] wrote:

   
 nico wrote:
 
 Hello,

 Is it possible to display a list of the numbered formulas (done with
 \placeformula)? I tried \placelist[formula] without success.

   
 you want to see the formulas too?
 

 Well, no, i just wanted a list, like a list of tables, figures, or  
 enumerations, with the pages where they appear. But ok, since it is not  
 available by default, i can put each formula in a specific Equation  
 enumeration an then do a \placelist[enumeration:Equation].
   
well, it takes only a few lines to have lists of formulas; you can then typeset 
the lists the way you want 


\unprotect

\def\dododoformulanumber#1#2#3#4% 
   \ifconditional\handleformulanumber
 \ifconditional\incrementformulanumber
   \incrementnumber[\v!formula]%
 \fi
 \makesectionnumber[\v!formula]%
 \setbox0\hbox{\ignorespaces#2\unskip}%
 \ifdim\wd0\zeropoint
   \edef\hetsubnummer{#2}%
 \else
   \let\hetsubnummer\empty
 \fi
 \doifsomething{#1}
{\rawreference{\s!for}{#1}{\composedsectionnumber\hetsubnummer}}%
 \setbox0\hbox{\ignorespaces#4\unskip}%
 \ifdim\wd0\zeropoint
   \edef\hetsubnummer{#4}%
 \fi
 \doifsomething{#3}
{\rawreference\s!for{#3}{\composedsectionnumber\hetsubnummer}}%
 \rm % nodig ?
 \doif{\formulaparameter\c!location}
\v!right{\hskip\formuladistance}%
 \@@fmnumbercommand
   {\dostartattributes\??fm\c!numberstyle\c!numbercolor
\strut
\@@fmleft
\preparethenumber\??fm\composedsectionnumber\preparednumber
\doflushformulalistentry{\composedsectionnumber\hetsubnummer}%
\labeltexts\v!formula
  {\ignorespaces\preparednumber
\ignorespaces\hetsubnummer\unskip}%
\@@fmright
\dostopattributes}%
  \doif{\formulaparameter\c!location}
\v!left{\hskip\formuladistance}%
   \fi
   \egroup}

% new: 

\definelist[\v!formula]

\global\let\doflushformulalistentry\gobbleoneargument

\def\placenamedformula[#1]#2%
  {\gdef\doflushformulalistentry##1%
 {\expanded{\writetolist[\v!formula]{##1}}{#2}%
  \global\let\doflushformulalistentry\gobbleoneargument}%
   \placeformula[#1]}


\starttext

\placelist[formula][criterium=text]

\placenamedformula[x]{oeps}
\startformula
a = 1
\stopformula

\placeformula
\startformula
a = 2
\stopformula

\placenamedformula[y]{more oeps}
\startformula
a = 3
\stopformula

\stoptext


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

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


[NTG-context] List of Formulas

2006-05-09 Thread nico
Hello,

Is it possible to display a list of the numbered formulas (done with  
\placeformula)? I tried \placelist[formula] without success.

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


Re: [NTG-context] List of Formulas

2006-05-09 Thread Hans Hagen
nico wrote:
 Hello,

 Is it possible to display a list of the numbered formulas (done with  
 \placeformula)? I tried \placelist[formula] without success.
   
you want to see the formulas too? 

\defineblock[formula]

\starttext

\beginformula
\placeformula
\startformula
a = 1
\stopformula
\endformula

\startformula
a = 2
\stopformula

\beginformula
\placeformula
\startformula
a = 3
\stopformula
\endformula

\page

\resetnumber[formula]

\useblocks[formula]

\stoptext

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

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


Re: [NTG-context] List of Formulas

2006-05-09 Thread nico
On Tue, 09 May 2006 23:38:47 +0200, Hans Hagen [EMAIL PROTECTED] wrote:

 nico wrote:
 Hello,

 Is it possible to display a list of the numbered formulas (done with
 \placeformula)? I tried \placelist[formula] without success.

 you want to see the formulas too?

Well, no, i just wanted a list, like a list of tables, figures, or  
enumerations, with the pages where they appear. But ok, since it is not  
available by default, i can put each formula in a specific Equation  
enumeration an then do a \placelist[enumeration:Equation].

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


[NTG-context] Breaking large equations across pages

2006-04-27 Thread Aditya Mahajan
Pagebreak of formula across pagebreaks is broken in the new release 
(ConTeXt  ver: 2006.04.27 15:59).

Consider
\starttext
\placeformula \startformula \startalign
   \dorecurse{50}
   {\NC a \NC  = b \NR[+]}
\stopalign \stopformula
\stoptext

(This used to work earlier, I can not test this, but I have document 
where the display broke across pages. Can somewith with an old ~ Mar, 
2006 release test this?)

Also, is it possible to have more control over where the display 
breaks. With latex, I can force equation break by using
\allowdisplaybreaks[1|2|3|4]

\documentclass{article}
\usepackage{amsmath}
\allowdisplaybreaks % Try with and without this.
\begin{document}
\begin{align}
   a = b \\
% Paste the above line 50 times
   a = b
\end{align}
\end{document}

Ideally, context should also provide something configurable. Maybe, it 
should be part of 
\setupformulas[displaybreak=tolerant|verytolerant|strict|verystrict]

Also there should be something like

\NC  \NR
\allowdisplaybreak[yes|no|disable...same meaning as in \page[]
\NC . \NR

to have more control over the pagebreak.

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] Breaking large equations across pages

2006-04-27 Thread Mojca Miklavec
On 4/28/06, Aditya Mahajan wrote:
 Pagebreak of formula across pagebreaks is broken in the new release
 (ConTeXt  ver: 2006.04.27 15:59).

 Consider
 \starttext
 \placeformula \startformula \startalign
   \dorecurse{50}
   {\NC a \NC  = b \NR[+]}
 \stopalign \stopformula
 \stoptext

 (This used to work earlier, I can not test this, but I have document
 where the display broke across pages. Can somewith with an old ~ Mar,
 2006 release test this?)

I have the version of 2006.04.10 here and it breaks the equation OK
(number 35 is on page 2).

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


Re: [NTG-context] emacs lisp for context in AucTeX

2006-04-20 Thread Johan Sandblom
Thank you for this. I have written the following much more amateurish
emacs lisp code in order to make it easier to enter natural tables and
flowcharts. Perhaps someone may find it useful or can suggest
improvements. I also added some keybindings for them.

Johan

(defun context-insert-nattab (rows columns)
  ;; Johan Sandblom 060128
  Insert a TABLE skeleton
  (interactive nNumber of rows: \nnNumber of columns: \n)
  (newline)
  (insert \\bTABLE\n\\setupTABLE\[\]\n)
  ;; First a TABLE header
  (insert \\bTABLEhead\n\\bTR\\bTH \\eTH\n)
  (let ((column 1))
(while ( column (- columns 1))
  (insert \\bTH \\eTH\n)
  (setq column (1+ column
  (insert \\bTH \\eTH\\eTR\n\\eTABLEhead\n\\bTABLEbody\n)
  ;; The rows and columns
  (let ((row 1))
(while (= row rows)
  (insert \\bTR\\bTD \\eTD\n)
  ;; The let expression makes sure that each loop starts at the
  ;; right place
  (let ((column 1))
(while ( column (- columns 1))
  (insert \\bTD \\eTD\n)
  (setq column (1+ column)))
(insert \\bTD \\eTD\\eTR\n)
(setq row (1+ row
(insert \\eTABLEbody\n\\eTABLE\n)))

(defun context-insert-nattab-row (columns)
 Insert a row in a TABLE
 (interactive nNumber of columns: \n)
 (newline)
 (insert \\bTR\\bTD \\eTD\n)
 (let ((column 1))
   (while ( column (- columns 1))
 (insert \\bTD \\eTD\n)
 (setq column (1+ column)))
   (insert \\bTD \\eTD\\eTR\n)))

(defun context-insert-nattab-column (optional arg)
 Insert a column in a TABLE
 (interactive P)
 (insert \\bTD \\eTD)
 (indent-for-tab-command)
 (newline)
 (backward-char 5))

(defun context-insert-FLOW-cell (n)
 ;; Johan Sandblom 060128
 Insert a FLOWchart cell
 (interactive nNumber of cells: \n)
 (newline)
 (let ((x 1))
   (while (= x n)
 (insert \\startFLOWcell\n)
 (insert   \\name  {}\n)
 (insert   \\location  {}\n)
 (insert   \\shape {action}\n)
 (insert   \\text  {}\n)
 (insert   \\connection[rl]{}\n)
 (insert \\stopFLOWcell\n)
 (setq x (1+ x)

(add-hook 'ConTeXt-mode-hook
 '(lambda ()
(local-set-key \C-c\C-fc 'context-insert-FLOW-cells)
(local-set-key \C-cnr 'context-insert-nattab-row)
(local-set-key \C-cnc 'context-insert-nattab-column)
(local-set-key \C-cnn 'context-insert-nattab)
(local-set-key $ 'start-context-math)))

2006/4/20, Sanjoy Mahajan [EMAIL PROTECTED]:
 I wrote the following emacs lisp for my .emacs and pass it on (no
 copyright) in case others find it useful.  I used variants for a decade
 with the old tex mode, but just rewrote it for auctex and for context's
 display math syntax (which deprecates $$...$$).

 The purpose:

 1. If you type {, [, or (, the appropriate right delimiter is inserted
for you and the insertion point is placed between them.  So I never
get unbalanced XYZ errors.  If you think it's a misfeature, delete
the last three local-set-key's in the TeX-mode-hook.

 2. Same feature if you type $ for inline math: you get $insertion point
here$.  The old tex-mode code would do the same on typing a second $,
so you'd get $$insertion point here$$ for tex's display math.

The code below will also do that, except in context mode.

 3. In context mode, typing the second $ will gobble up preceding
whitespace and then insert
 \placeformula\startformula
 place insertion point here
 \stopformula

 The whitespace-deletion code in start-context-math is a bit pathetic and
 any improvements are welcome.  I couldn't get re-search-backward to work
 for me because it wouldn't match greedily (so it would gobble up one
 space but not all of them, for example), so instead it just looks one
 character at a time and deletes what it should.

 -Sanjoy


 (defun insert-balanced (left right)
   Make a left, right delmiter pair and be poised to type inside of them.
   (interactive)
   (insert left)
   (save-excursion
 (insert right)))

 (defun start-context-math ()
   (interactive)
   (let* ((start (max (point-min) (- (point) 1)))
  (stop  (min (point-max) (+ (point) 1
 ; if in the middle of a $$, turn inline math into context display math
 (if (equal $$ (buffer-substring-no-properties start stop))
 (progn
   (delete-region start stop);get rid of the $$
   ; delete preceding spaces, if any
   (while (and ( (point-min) (point))
   (equal (buffer-substring-no-properties (- (point) 1)
  (point))
   ))
 (backward-delete-char 1))
   ; delete a preceding newline, if any
   (if (equal (buffer-substring-no-properties (- (point) 1)
  (point))
  \n)
 (backward-delete-char 1))
   ; place
   (insert \n\\placeformula

[NTG-context] emacs lisp for context in AucTeX

2006-04-19 Thread Sanjoy Mahajan
I wrote the following emacs lisp for my .emacs and pass it on (no
copyright) in case others find it useful.  I used variants for a decade
with the old tex mode, but just rewrote it for auctex and for context's
display math syntax (which deprecates $$...$$).

The purpose:

1. If you type {, [, or (, the appropriate right delimiter is inserted
   for you and the insertion point is placed between them.  So I never
   get unbalanced XYZ errors.  If you think it's a misfeature, delete
   the last three local-set-key's in the TeX-mode-hook.

2. Same feature if you type $ for inline math: you get $insertion point
   here$.  The old tex-mode code would do the same on typing a second $,
   so you'd get $$insertion point here$$ for tex's display math.

   The code below will also do that, except in context mode.

3. In context mode, typing the second $ will gobble up preceding
   whitespace and then insert 
\placeformula\startformula
place insertion point here
\stopformula

The whitespace-deletion code in start-context-math is a bit pathetic and
any improvements are welcome.  I couldn't get re-search-backward to work
for me because it wouldn't match greedily (so it would gobble up one
space but not all of them, for example), so instead it just looks one
character at a time and deletes what it should.

-Sanjoy


(defun insert-balanced (left right)
  Make a left, right delmiter pair and be poised to type inside of them.
  (interactive)
  (insert left)
  (save-excursion
(insert right)))

(defun start-context-math ()
  (interactive)
  (let* ((start (max (point-min) (- (point) 1)))
 (stop  (min (point-max) (+ (point) 1
; if in the middle of a $$, turn inline math into context display math
(if (equal $$ (buffer-substring-no-properties start stop))
(progn
  (delete-region start stop);get rid of the $$
  ; delete preceding spaces, if any
  (while (and ( (point-min) (point))
  (equal (buffer-substring-no-properties (- (point) 1)
 (point))
  ))
(backward-delete-char 1))
  ; delete a preceding newline, if any
  (if (equal (buffer-substring-no-properties (- (point) 1)
 (point))
 \n)
(backward-delete-char 1))
  ; place 
  (insert \n\\placeformula\\startformula\n)
  (save-excursion (insert \n\\stopformula)))
  ; else: just doing inline math
  (insert-balanced ?\$ ?\$

(add-hook 'ConTeXt-mode-hook
  '(lambda ()
 (local-set-key $ 'start-context-math)))

(add-hook 'TeX-mode-hook
  '(lambda ()
 (local-set-key $ 
'(lambda ()
   (interactive)
   (insert-balanced ?\$ ?\$)))
 (local-set-key {
'(lambda ()
   (interactive)
   (insert-balanced ?\{ ?\})))
 (local-set-key [
'(lambda ()
   (interactive)
   (insert-balanced ?\[ ?\])))
 (local-set-key (
'(lambda ()
   (interactive)
   (insert-balanced ?\( ?\))

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


Re: [NTG-context] Myway on using mathalign

2006-04-05 Thread Aditya Mahajan
On Thu, 6 Apr 2006, WN wrote:

 [EMAIL PROTECTED] wrote:
 On Wed, 5 Apr 2006, WN wrote:
 One thing I want to do with a set of subformula's is
 to reference the main formula but still subnumbering the equations
 like
 
 Try this. Warning: I do not know everything that is happening here. There 
 may be some unexpected side effects.
 
 \unprotect
 \def\placesubformulawithnumber{%
   \dodoubleempty\doplacesubformulawithnumber}
 
 \def\doplacesubformulawithnumber[#1][#2]%#2 gobbles spaces
   {\iffirstargument
 \incrementnumber[\v!formula]
 \makesectionnumber[\v!formula]
 \rawreference{\s!for}{#1}{\composedsectionnumber}
   \else
 \incrementnumber[\v!formula]
   \fi\placesubformula}
 \protect
 
 
 \starttext
 %%  \incrementnumber[formula]
 %%  \placesubformula
 \placesubformulawithnumber[eqn1] %I need to think of a smaller name
 \startformula
 \startalign
 \NC div  \vec{E} \NC =  \epsilon_{0}^{-1} \rho  \NR[eqn1:A][a]
 \NC rot  \vec{E} \NC =  0 \NR
 \NC div  \vec{B} \NC =  0 \NR[eqn1:B][b]
 \NC rot  \vec{B} \NC =  \mu_{0} \vec{j} \NR
 \stopalign
 \stopformula
 See *\in[eqn1] *for the static Maxwell equations, where we are going to 
 examine \in[eqn1:A] a bit further 
 \stoptext
 
 
 Also, note that div and rot should be in text font. You should probably do
 \startmathcollection[default]
   \definemathcommand [div]  [nolop] {\mfunction{div}}
   \definemathcommand [rot]  [nolop] {\mfunction{rot}}
 \stopmathcollection
 
 and use \div \rot etc.
 
 Hi Aditya,
 I tested your solution and it works great. I cannot see any problems 
 in my output. I wish I had your Tex programming skills, I am trying 
 to learn the language myself from the TexBook (D.Knuth) but I still 
 have a long way to go.

Well, I do not understand Tex. What I usually do is look at the 
context source, which is much easier to read than latex internals, and 
then copy from there, play around a bit, and sometimes things 
work.

 Another test to check that the formula numbers work as expected
 \placeformula[kem-chapter-eqn11]
 \startformula
 \cases{
 \eqalign{
 \widehat{\vec{x}} = - \vec{x} \cr
 \widehat{t}  = t \cr
 }}
 \quad \text{resp.} \quad
 \cases{\eqalign{
 \widehat{\vec{x}} =  \vec{x} \cr
 \widehat{t}  = -t \cr
 }}
 \stopformula

How about

\definemathmatrix
   [group]
   [left={\left\{\,},right={\right.}]

\startformula
   \startgroup
 \NC \widehat{\vec{x}} \NC= - \vec x \NR
 \NC \widehat t\NC= t\NR
   \stopgroup
   \quad \text{resp} \quad
   \startgroup
 \NC \widehat{\vec{x}} \NC= \vec x \NR
 \NC \widehat t\NC= -t \NR
   \stopgroup
\stopformula

There is also startstop cases, but that does not give the correct 
spacing in this case. May be useful otherwise.

\startformula
   \startcases
 \NC \widehat{\vec{x}} \MC= - \vec x \NR
 \NC \widehat t\MC= t\NR
   \stopcases
% Read MC as Math Column, there is also the usual NC
% which gives a text column
   \quad \text{resp} \quad
   \startcases
 \NC \widehat{\vec{x}} \MC= \vec x \NR
 \NC \widehat t\MC= -t \NR
   \stopcases
\stopformula


HTH,
Aditya

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


Re: [NTG-context] beta

2006-03-30 Thread Taco Hoekwater


Hans Hagen wrote:
 Hi,
 
 i uploaded a beta:
 
 - a fix to verbatim (has to do with linenumbering)
 - a cleaned up 'paragraph' mechanism (prelude to a real cleanup)
 - some patches to the newmml module
 
 i'll promote this to current when no problems are reported

Initial tests are fine, I say you already hard the math extensions
included as well. But I have not tested the new 'paragraph' stuff,
aqnd I do not know the status of the 'Curious blank page' problem.

Remaining open (recent) items:

Feature Reqs:

*  \definetyping[prog][numbering=line,location=intext] % from nico
*  The latest bib module
*  \usemodule[...p=...][modulename] % from Thomas and me

Bugs:

* The broken eq reference (at least IMO this is a bug)
   \starttext
   \placeformula[eqn1]
   \startformula \startalign[n=1] a\\ \stopalign \stopformula
   See \in[eqn1]
   \stoptext

* Duncan's xtag-mml patch (on this dev list, 03/24)

* My \dodoregister patch (also in this list, 02/22)
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] beta

2006-03-30 Thread Aditya Mahajan
--- On Mar 30, Taco Hoekwater wrote ---

 * The broken eq reference (at least IMO this is a bug)
   \starttext
   \placeformula[eqn1]
   \startformula \startalign[n=1] a\\ \stopalign \stopformula
   See \in[eqn1]
   \stoptext

I am not sure that this is a bug. Infact, I am not behaviour is 
expected.
\placeformula[eq1]
\startformula \startalign[n=1]
  a \\
  b \\
\stopalign \stopformula
What should \in[eqn1] refer to? The first eqn, the second, or both?

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] beta

2006-03-30 Thread Taco Hoekwater


Aditya Mahajan wrote:
 --- On Mar 30, Taco Hoekwater wrote ---
 
* The broken eq reference (at least IMO this is a bug)
  \starttext
  \placeformula[eqn1]
  \startformula \startalign[n=1] a\\ \stopalign \stopformula
  See \in[eqn1]
  \stoptext
 
 I am not sure that this is a bug. Infact, I am not behaviour is 
 expected.
 \placeformula[eq1]
 \startformula \startalign[n=1]
   a \\
   b \\
 \stopalign \stopformula
 What should \in[eqn1] refer to? The first eqn, the second, or both?

Both, perhaps. But it could as well take the first one, or the last.
My rationale is: if there is a label given by the user, then
referring to that should resolve into something that is a valid link.
It is definately inconsistent to discard a supplied label because it's
contents may be unresolvable.

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


Re: [NTG-context] beta

2006-03-30 Thread Aditya Mahajan
On Thu, 30 Mar 2006, Taco Hoekwater wrote:
 Aditya Mahajan wrote:
 --- On Mar 30, Taco Hoekwater wrote ---

 * The broken eq reference (at least IMO this is a bug)
  \starttext
  \placeformula[eqn1]
  \startformula \startalign[n=1] a\\ \stopalign \stopformula
  See \in[eqn1]
  \stoptext

 I am not sure that this is a bug. Infact, I am not behaviour is
 expected.
 \placeformula[eq1]
 \startformula \startalign[n=1]
   a \\
   b \\
 \stopalign \stopformula
 What should \in[eqn1] refer to? The first eqn, the second, or both?

 Both, perhaps. But it could as well take the first one, or the last.
 My rationale is: if there is a label given by the user, then
 referring to that should resolve into something that is a valid link.
 It is definately inconsistent to discard a supplied label because it's
 contents may be unresolvable.

I agree on that. The label must refer to something. However, explaining 
what it refers to can quickly get confusing. The numbering should remain 
consistent with or without the label.

\placeformula[eq1]
\startformula \startalign
\NC a \NC b \NR
\NC c \NC d \NR[+]
\stopalign \stopformula
The first equation should not be numbered. But then this is something like 
the ugly loose label in latex.

And what about
\placeformula[eq1]
\startformula \startalign
\NC a \NC b \NR
\NC c \NC d \NR
\stopalign \stopformula

The numbering should be consistent with or without the label. Which means 
that there should be no numbering. What should the label refer to now?

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


Re: [NTG-context] beta

2006-03-30 Thread Hans Hagen
Aditya Mahajan wrote:
 On Thu, 30 Mar 2006, Taco Hoekwater wrote:
   
 Aditya Mahajan wrote:
 
 --- On Mar 30, Taco Hoekwater wrote ---

   
 * The broken eq reference (at least IMO this is a bug)
  \starttext
  \placeformula[eqn1]
  \startformula \startalign[n=1] a\\ \stopalign \stopformula
  See \in[eqn1]
  \stoptext
 
 I am not sure that this is a bug. Infact, I am not behaviour is
 expected.
 \placeformula[eq1]
 \startformula \startalign[n=1]
   a \\
   b \\
 \stopalign \stopformula
 What should \in[eqn1] refer to? The first eqn, the second, or both?
   
 Both, perhaps. But it could as well take the first one, or the last.
 My rationale is: if there is a label given by the user, then
 referring to that should resolve into something that is a valid link.
 It is definately inconsistent to discard a supplied label because it's
 contents may be unresolvable.
 

 I agree on that. The label must refer to something. However, explaining 
 what it refers to can quickly get confusing. The numbering should remain 
 consistent with or without the label.

 \placeformula[eq1]
 \startformula \startalign
 \NC a \NC b \NR
 \NC c \NC d \NR[+]
 \stopalign \stopformula
 The first equation should not be numbered. But then this is something like 
 the ugly loose label in latex.

 And what about
 \placeformula[eq1]
 \startformula \startalign
 \NC a \NC b \NR
 \NC c \NC d \NR
 \stopalign \stopformula

 The numbering should be consistent with or without the label. Which means 
 that there should be no numbering. What should the label refer to now?
   
i've now changed the code so that in  

   \placeformula[eq1]... \NC[+] 

the number is refered to as eq1

  \placeformula[eq1]... \NC[eq2] 

here eq1 gets lost, while  

  \placeformula... \NC[eq3] 

is the prefered way 

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.com
 | www.pragma-pod.nl
-

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


Re: [NTG-context] Guide on align (was Help : Unknown references)

2006-03-24 Thread Aditya Mahajan
}]
  \NC a_1 x + b_1 y \NC = \NC c_1 \NC =  d_1 u + e_1 v \NR
  \NC a_2 x + b_2 y \NC = \NC c_2 + c_3 \NC =  d_2 u + e_2 v + f_1 w\NR
\stopalign \stopformula



Sometimes one wants to have two columns of equations, next to one another.  
This can be done by specifying the number of blocks in \typem=?.
\starttyping
\startformula \startalign[m=2]
  \NC a_1 x + b_1 y \NC = c_1 \NC d_1 u + e_1 v \NC = f_1 \NR
  \NC a_2 x + b_2 y \NC = c_2 \NC d_2 u + e_2 v \NC = f_2 \NR
\stopalign \stopformula

\stoptyping

\startformula \startalign[m=2]
  \NC a_1 x + b_1 y \NC = c_1 \NC d_1 u + e_1 v \NC = f_1 \NR
  \NC a_2 x + b_2 y \NC = c_2 \NC d_2 u + e_2 v \NC = f_2 \NR
\stopalign \stopformula



The distance between the blocks can be increased by specifying (well you 
guessed it) \typedistance in the parameters of align.
\starttyping
\startformula \startalign[m=2,distance=5em]
  \NC a_1 x + b_1 y \NC = c_1 \NC d_1 u + e_1 v \NC = f_1 \NR
  \NC a_2 x + b_2 y \NC = c_2 \NC d_2 u + e_2 v \NC = f_2 \NR
\stopalign \stopformula

\stoptyping

\startformula \startalign[m=2,distance=5em]
  \NC a_1 x + b_1 y \NC = c_1 \NC d_1 u + e_1 v \NC = f_1 \NR
  \NC a_2 x + b_2 y \NC = c_2 \NC d_2 u + e_2 v \NC = f_2 \NR
\stopalign \stopformula



However, this block mode can be cumbersome to work with. You need to work with 
two formulas at the same time and this can be confusing. There is another 
alternative in \tex{startformulas}
\starttyping
\startformulas
  \startformula \startalign
\NC a_1 x + b_1 y \NC = c_1 \NR
\NC a_2 x + b_2 y \NC = c_2 \NR
  \stopalign \stopformula
  \startformula \startalign
\NC d_1 u + e_1 v \NC = f_1 \NR
\NC d_2 u + e_2 v \NC = f_2 \NR
  \stopalign \stopformula
\stopformulas

\stoptyping

\startformulas
  \startformula \startalign
\NC a_1 x + b_1 y \NC = c_1 \NR
\NC a_2 x + b_2 y \NC = c_2 \NR
  \stopalign \stopformula
  \startformula \startalign
\NC d_1 u + e_1 v \NC = f_1 \NR
\NC d_2 u + e_2 v \NC = f_2 \NR
  \stopalign \stopformula
\stopformulas



More than two groups can also be placed.
\starttyping
\startformulas
\dorecurse{5}{\startformula
\startalign[n=3,align={middle,middle,middle}]
\NC a  \NC = \NC b  \NR
\NC 2a \NC = \NC 2b \NR
\stopalign
\stopformula}
\stopformulas

\stoptyping

\startformulas
\dorecurse{5}{\startformula
\startalign[n=3,align={middle,middle,middle}]
\NC a  \NC = \NC b  \NR
\NC 2a \NC = \NC 2b \NR
\stopalign
\stopformula}
\stopformulas



\section{Equation Numbering and referring}
To number multiline displays, two things need to be done. Write 
\tex{placeformula} before \tex{startformula} to {\em start up} equation 
numbering. To actually number the equations, you need to type \type{[+]} with 
each \tex{NR}. Going back to our basic example

\starttyping
\placeformula
\startformula \startalign
  \NC a_1 x + b_1 y \NC = c_1 \NR[+]
  \NC a_2 x + b_2 y \NC = c_2 \NR[+]
\stopalign \stopformula

\stoptyping

\placeformula
\startformula \startalign
  \NC a_1 x + b_1 y \NC = c_1 \NR[+]
  \NC a_2 x + b_2 y \NC = c_2 \NR[+]
\stopalign \stopformula



If you only want to number a some specific equations, just add \type[+] to 
that equation only. Suppose in the above example, we want to only number the 
second equation.
\starttyping
\placeformula
\startformula \startalign
  \NC a_1 x + b_1 y \NC = c_1 \NR
  \NC a_2 x + b_2 y \NC = c_2 \NR[+]
\stopalign \stopformula

\stoptyping

\placeformula
\startformula \startalign
  \NC a_1 x + b_1 y \NC = c_1 \NR
  \NC a_2 x + b_2 y \NC = c_2 \NR[+]
\stopalign \stopformula



Some more examples \unknown
\starttyping
\placeformula
\startformula \startalign[n=3, align={right,middle,left}]
  \NC a_1 x + b_1 y \NC = c_1 \NC =  d_1 u + e_1 v \NR[+]
  \NC a_2 x + b_2 y \NC = c_2 + c_3 \NC =  d_2 u + e_2 v + f_1 w\NR
\stopalign \stopformula

\stoptyping

\placeformula
\startformula \startalign[n=3, align={right,middle,left}]
  \NC a_1 x + b_1 y \NC = c_1 \NC =  d_1 u + e_1 v \NR[+]
  \NC a_2 x + b_2 y \NC = c_2 + c_3 \NC =  d_2 u + e_2 v + f_1 w\NR
\stopalign \stopformula




\starttyping
\placeformula
\startformula \startalign[m=2]
  \NC a_1 x + b_1 y \NC = c_1 \NC d_1 u + e_1 v \NC = f_1 \NR
  \NC a_2 x + b_2 y \NC = c_2 \NC d_2 u + e_2 v \NC = f_2 \NR[+]
\stopalign \stopformula

\stoptyping

\placeformula
\startformula \startalign[m=2]
  \NC a_1 x + b_1 y \NC = c_1 \NC d_1 u + e_1 v \NC = f_1 \NR
  \NC a_2 x + b_2 y \NC = c_2 \NC d_2 u + e_2 v \NC = f_2 \NR[+]
\stopalign \stopformula


\starttyping
\placeformula
\startformulas
  \startformula \startalign
\NC a_1 x + b_1 y \NC = c_1 \NR[+]
\NC a_2 x + b_2 y \NC = c_2 \NR
  \stopalign \stopformula
  \startformula \startalign
\NC d_1 u + e_1 v \NC = f_1 \NR
\NC d_2 u + e_2 v \NC = f_2 \NR[+]
  \stopalign \stopformula
\stopformulas

\stoptyping

\placeformula
\startformulas
  \startformula \startalign
\NC a_1 x + b_1 y \NC = c_1 \NR[+]
\NC a_2 x + b_2 y \NC = c_2

Re: [NTG-context] Help : Unknown references

2006-03-22 Thread WN




Hi,

I think I am using the latest context version 

 texexec --version
TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005

 texexec : TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005
 texutil : TeXUtil 9.0.1 - ConTeXt / PRAGMA ADE 1992-2006
 tex : pdfeTeX, 3.141592-1.30.6-2.2 (Web2C 7.5.5)
 context : ver: 2006.03.20 10:19
 cont-en : ver: 2006.03.20 10:19 fmt: 2006.3.21 mes:
english

When I compile your code, it works. However my code , which I think,
is similar, doesn't work. 
I cannot see any difference in the setup. I must be doing something
basically wrong ???

Here is an excerpt from my code


\def\mathrm#1{ {\rm #1}}
\def\done#1#2{ \frac{ \mathrm{d}  #1}{\mathrm{d} \mathrm{#2}} }
\def\dtwo#1#2{ \frac{\mathrm{d}^{2}  #1}{\mathrm{d} \mathrm{#2}^{2}} }
\starttext
Als op het tijdstip $t_{0}$ plaats $\vec{r}_{0}$ en snelheid $v_{0}$ zijn gegeven, 
dan kan de plaats $\vec{r}$ van een deeltje op ieder tijdstip worden berekend met de
vergelijkingen
\placeformula[eqn1]
\startformula
\startalign[n=3]
\vec{v}  =  \done{\vec{r}}{t}\quad \quad \vec{r} - \vec{r}_{0} = \int_{t_{0}}^{t} \vec{v} \: dt \\
\stopalign
\stopformula
\placeformula[eqn2]
\startformula
\startalign[n=3]
\vec{a}  =  \done{\vec{v}}{t}\quad \quad \vec{v} - \vec{v}_{0} = \int_{t_{0}}^{t} \vec{a} \: dt  \\
\stopalign
\stopformula
Voor $\vec{a}$ constant volgt uit \in[eqn2] 
\startformula
\vec{v} = \vec{v}_{0} + \vec{a} \: (t - t_0)
\stopformula
en hieruit met behulp van \in[eqn1] 
\stoptext


Wim


[EMAIL PROTECTED] wrote:

  On Tue, 21 Mar 2006, WN wrote:

  
  
Hi,

I am getting unknown references when I use
\startformula
\startalign[n=3]
 Some math ..
\stopalign
\stopformula
in conjunction with
\placeformula[eqn1]
\startformula
 math ..
\stopformula
See \in[eqn1]  --- unknown reference

It has something to do with the formulanumber not set, I know, but how 
do I fix this in the above ??

  
  
Which context version are you using? The following compiles correctly on 
live.contextgarden.net

\starttext
\startformula \startalign[n=3]
  \NC a \NC b \NC d \NR
  \NC a \NC b \NC d \NR
\stopalign \stopformula

in conjunction with
\placeformula[eqn1]
  \startformula
a = b
   \stopformula
See \in[eqn1] \unknown

\stoptext

See if this works for you.

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




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


Re: [NTG-context] Help : Unknown references

2006-03-22 Thread Taco Hoekwater


WN wrote:
 Hi,
 
 I think I am using the latest context version

 I  cannot see any difference in the setup. I must be doing something 
 basically wrong ???

There is a bug, and it is caused by the embedded \startalign
environment. Minimal file:

   \starttext
   \placeformula[eqn1]
   \startformula \startalign[n=1] a\\ \stopalign \stopformula
   See \in[eqn1]
   \stoptext

Sorry, I have no time for further debugging tonight.

Cheers, Taco

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


Re: [NTG-context] Help : Unknown references

2006-03-22 Thread Aditya Mahajan
On Wed, 22 Mar 2006, Taco Hoekwater wrote:
 WN wrote:
 Hi,
 
 I think I am using the latest context version

 I  cannot see any difference in the setup. I must be doing something 
 basically wrong ???

 There is a bug, and it is caused by the embedded \startalign
 environment. Minimal file:

  \starttext
  \placeformula[eqn1]
  \startformula \startalign[n=1] a\\ \stopalign \stopformula
  See \in[eqn1]
  \stoptext

To WN, quick workaround, use \NR construct rather than \\.

\starttext
\placeformula
  \startformula \startalign[n=1]
   a \NR[eqn1]
  \stopalign \stopformula
\stoptext


From what I understand, Hans said that this loose label was an ugly method 
to refer to equations. Consider
\placeformula[eq1]
  \startformula \startalign[n=1]
eqn 1 \NR
eqn 2 \NR
  \stopalign \stopformula

What should eq1 refer to? The first equation or the second? The correct 
way is to specify which one you want to be refered, so
\placeformula
  \startformula \startalign[n=1]
eqn 1 \NR[eq1]
eqn 2 \NR
  \stopalign \stopformula

And this does work correctly.


Actually, there is another problem. Consider this

\placeformula \startformula \startalign
  \NC ... \NC ... \NR
  \NC ... \NC \NR
  \NC ... \NC ... \NR
\stopalign \stopformula

vs

\placeformula \startformula \startalign
  \NC ..\NC ... \NR
  \NC ..\NC ... \NR[+]
\stopalign \stopformula


The second construct should only number the second equation, and it does 
exactly that. The first does not number any equation, which is also the 
correct and expected behaviour.

Now suppose that I want to number all equations. I am pretty sure that 
this used to work (can't check at the moment, as I have upgraded context)

\placeformula[+] \startformula \startalign
  \NC ... \NC ... \NR
  \NC ... \NR ... \NR
\stopalign \stopformula

However, this is no longer working? How do I number all the equations in a 
multiline formula, without doing a \NR[+] at each line?

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


[NTG-context] Help : Unknown references

2006-03-21 Thread WN
Hi,

I am getting unknown references when I use
\startformula
\startalign[n=3]
 Some math ..
\stopalign
\stopformula
in conjunction with
\placeformula[eqn1]
\startformula
 math ..
\stopformula
See \in[eqn1]  --- unknown reference

It has something to do with the formulanumber not set, I know, but how 
do I fix
this in the above ??

Thanks for your help and time
WN


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


Re: [NTG-context] Help : Unknown references

2006-03-21 Thread Aditya Mahajan
On Tue, 21 Mar 2006, WN wrote:

 Hi,

 I am getting unknown references when I use
 \startformula
 \startalign[n=3]
  Some math ..
 \stopalign
 \stopformula
 in conjunction with
 \placeformula[eqn1]
 \startformula
  math ..
 \stopformula
 See \in[eqn1]  --- unknown reference

 It has something to do with the formulanumber not set, I know, but how 
 do I fix this in the above ??

Which context version are you using? The following compiles correctly on 
live.contextgarden.net

\starttext
\startformula \startalign[n=3]
  \NC a \NC b \NC d \NR
  \NC a \NC b \NC d \NR
\stopalign \stopformula

in conjunction with
\placeformula[eqn1]
  \startformula
a = b
   \stopformula
See \in[eqn1] \unknown

\stoptext

See if this works for you.

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


[NTG-context] Force an indent

2006-02-20 Thread David Arnold
All,

How can I force an indent on my last paragraph? My attempt below does  
not work. I don't really want to redefine any setups, I just want an  
indent this one time.

%output=pdf

\starttext

Again, we choose to multiply the fours, then the result by the square  
root of three. That is,

\placeformula[-]
\startformula
   4(4\sqrt3)
   =16\sqrt3.
\stopformula

\indent By induction, we can argue that that the associative and  
commutative properties will allows us to group and arrange the  
product of more than three numbers in any order that we please.

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


Re: [NTG-context] Force an indent

2006-02-20 Thread David Arnold
OK,

But this gives the same result. No indent.

%output=pdf

\setupwhitespace[medium]

\setupindenting[medium,yes]

\starttext

Again, we choose to multiply the fours, then the result by the square  
root of three. That is,

\placeformula[-]
\startformula
   4(4\sqrt3)
   =16\sqrt3.
\stopformula

\indent By induction, we can argue that that the associative and  
commutative properties will allows us to group and arrange the  
product of more than three numbers in any order that we please.

\stoptext

How can I get that paragraph after the placeformula to indent?


On Feb 20, 2006, at 2:56 AM, Taco Hoekwater wrote:



 David Arnold wrote:
 All,

 How can I force an indent on my last paragraph? My attempt below does
 not work. I don't really want to redefine any setups, I just want an
 indent this one time.

 \indent inserts indentation the size of \parindent, which is exactly
 zero points in this case.

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

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


Re: [NTG-context] Force an indent

2006-02-20 Thread Taco Hoekwater
David Arnold wrote:
 OK,
 
 But this gives the same result. No indent.

[ok]

 How can I get that paragraph after the placeformula to indent?

   \setupindenting[medium,yes]
   \setupformulas[indentnext=yes]
   %\setupfloats[indentnext=yes] % maybe desired as well?

I just discovered that only this

   \setupindenting[medium,always]

doesn't work either, and that is a bit counterintuitive.

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


Re: [NTG-context] Force an indent

2006-02-20 Thread Peter Rolf
David Arnold wrote:
 OK,
 
 But this gives the same result. No indent.
 
 %output=pdf
 
 \setupwhitespace[medium]
 
 \setupindenting[medium,yes]

\setupformulas[indentnext=auto]
(even without \indent)

Peter

 \starttext
 
 Again, we choose to multiply the fours, then the result by the square  
 root of three. That is,
 
 \placeformula[-]
 \startformula
4(4\sqrt3)
=16\sqrt3.
 \stopformula

 \indent By induction, we can argue that that the associative and  
 commutative properties will allows us to group and arrange the  
 product of more than three numbers in any order that we please.
 
 \stoptext
 
 How can I get that paragraph after the placeformula to indent?
 
 
 On Feb 20, 2006, at 2:56 AM, Taco Hoekwater wrote:
 

 David Arnold wrote:
 All,

 How can I force an indent on my last paragraph? My attempt below does
 not work. I don't really want to redefine any setups, I just want an
 indent this one time.
 \indent inserts indentation the size of \parindent, which is exactly
 zero points in this case.

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

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


Re: [NTG-context] Force an indent

2006-02-20 Thread David Arnold
Taco, Peter,

I guess I am not making myself clear.

I do not want to do this:

\setupformulas[indentnext=auto]

or this:

\setupformulas[indentnext=yes]

Because that has the effect that paragraphs following formulae are  
always indented. I don't want that. I want to be able to type the  
source like this ...

\setupwhitespace[medium]

\setupindenting[medium,yes]

\starttext

Again, we choose to multiply the fours, then the result by the square  
root of three. That is,

\placeformula[-]
\startformula
   4(4\sqrt3)
   =16\sqrt3.
\stopformula

By induction, we can argue that that the associative and commutative  
properties will allows us to group and arrange the product of more  
than three numbers in any order that we please.

\stoptext

... and not have the next paragraph after the formula. That is the  
default. That is what I want. However, on occasion, sometimes I do  
want to indent the next paragraph after a formula. My question is,  
how to override the default behavior on occasion. That is, every  
rare once in a while, how do I indent a paragraph after a formula.


On Feb 20, 2006, at 10:13 AM, Taco Hoekwater wrote:

 David Arnold wrote:
 OK,

 But this gives the same result. No indent.

 [ok]

 How can I get that paragraph after the placeformula to indent?

\setupindenting[medium,yes]
\setupformulas[indentnext=yes]
%\setupfloats[indentnext=yes] % maybe desired as well?

 I just discovered that only this

\setupindenting[medium,always]

 doesn't work either, and that is a bit counterintuitive.

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

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


Re: [NTG-context] Force an indent

2006-02-20 Thread Peter Rolf
David Arnold wrote:
 Taco, Peter,
 
 I guess I am not making myself clear.
 
 I do not want to do this:
 
 \setupformulas[indentnext=auto]
 
 or this:
 
 \setupformulas[indentnext=yes]

o.k.

\leavevmode\indent (or maybe better, but untested: \dontleavehmode\indent)

looks strange, but works.

 Because that has the effect that paragraphs following formulae are  
 always indented. I don't want that. I want to be able to type the  
 source like this ...
 
 \setupwhitespace[medium]
 
 \setupindenting[medium,yes]
 
 \starttext
 
 Again, we choose to multiply the fours, then the result by the square  
 root of three. That is,
 
 \placeformula[-]
 \startformula
4(4\sqrt3)
=16\sqrt3.
 \stopformula
 
 By induction, we can argue that that the associative and commutative  
 properties will allows us to group and arrange the product of more  
 than three numbers in any order that we please.
 
 \stoptext
 
 ... and not have the next paragraph after the formula. That is the  
 default. That is what I want. However, on occasion, sometimes I do  
 want to indent the next paragraph after a formula. My question is,  
 how to override the default behavior on occasion. That is, every  
 rare once in a while, how do I indent a paragraph after a formula.
 
 
 On Feb 20, 2006, at 10:13 AM, Taco Hoekwater wrote:
 
 David Arnold wrote:
 OK,

 But this gives the same result. No indent.
 [ok]

 How can I get that paragraph after the placeformula to indent?
\setupindenting[medium,yes]
\setupformulas[indentnext=yes]
%\setupfloats[indentnext=yes] % maybe desired as well?

 I just discovered that only this

\setupindenting[medium,always]

 doesn't work either, and that is a bit counterintuitive.

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

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


Re: [NTG-context] Force an indent

2006-02-20 Thread Joshua Ellis
 ... and not have the next paragraph after the formula. That is the  
 default. That is what I want. However, on occasion, sometimes I do  
 want to indent the next paragraph after a formula. My question is,  
 how to override the default behavior on occasion. That is, every  
 rare once in a while, how do I indent a paragraph after a formula.


Not sure if this is the best way, but \indentation at the beginning of 
the paragraph will force the indent.  Using your example:

\placeformula[-]
\startformula
4(4\sqrt3)
=16\sqrt3.
\stopformula

\indentation By induction, we can argue that that
the associative and commutative properties will
allows us to group and arrange the product of more
than three numbers in any order that we please.

-joshua

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


Re: [NTG-context] Force an indent

2006-02-20 Thread David Arnold
Aha!Easy. Thanks.On Feb 20, 2006, at 11:25 AM, Joshua Ellis wrote:   ... and not have the next paragraph after the formula. That is the    default. That is what I want. However, on occasion, "sometimes" I do    want to indent the next paragraph after a formula. My question is,    how to override the default behavior "on occasion." That is, every    "rare once in a while," how do I indent a paragraph after a formula.  Not sure if this is the best way, but \indentation at the beginning of  the paragraph will force the indent.  Using your example: \placeformula[-] \startformula     4(4\sqrt3)     =16\sqrt3. \stopformula \indentation By induction, we can argue that that the associative and commutative properties will allows us to group and arrange the product of more than three numbers in any order that we please. -joshua ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context   ___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Force an indent

2006-02-20 Thread Adam Lindsay
[someone else beat me to the punch.]

(\indentation instead of \indent)
That's not the most obvious choice of command name, but it works, eh?. 
To protect yourself, you could add more logical markup and say 
something like this in your environment:

\let\NewPar\indentation

and then mark all paragraphs to be indented with that \NewPar.

adam

 On Feb 20, 2006, at 10:13 AM, Taco Hoekwater wrote:
 
 David Arnold wrote:
 OK,

 But this gives the same result. No indent.
 [ok]

 How can I get that paragraph after the placeformula to indent?
\setupindenting[medium,yes]
\setupformulas[indentnext=yes]
%\setupfloats[indentnext=yes] % maybe desired as well?

 I just discovered that only this

\setupindenting[medium,always]

 doesn't work either, and that is a bit counterintuitive.

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


-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  Adam T. Lindsay, Computing Dept. [EMAIL PROTECTED]
  Lancaster University, InfoLab21+44(0)1524/510.514
  Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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


Re: [NTG-context] Force an indent

2006-02-20 Thread Adam Lindsay
[I realised this other part of my draft answer would be good for the 
archive:]

David Arnold wrote:

 I do not want to do this:
 
 \setupformulas[indentnext=auto]
 
...
 Because that has the effect that paragraphs following formulae are  
 always indented. I don't want that. I want to be able to type the  
 source like this ...

(not always, in the auto case)

 \setupwhitespace[medium]
 
 \setupindenting[medium,yes]
 
 \starttext
 
 Again, we choose to multiply the fours, then the result by the square  
 root of three. That is,
 
 \placeformula[-]
 \startformula
4(4\sqrt3)
=16\sqrt3.
 \stopformula
 
 By induction, we can argue that that the associative and commutative  
 properties will allows us to group and arrange the product of more  
 than three numbers in any order that we please.
 
 \stoptext

Although it doesn't really apply to you, because of the spaced-out 
nature of your source files, this will help someone out. If you have 
indentnext=auto set for formulae (or verbatim or itemize), then you have 
no indent if there's no blank line between the formula and the text. If 
there is a blank line, then there's a normal indent.

In the example, watch what happens after the two \stopformula s:

\setupindenting[medium,yes]
\setupformulas[indentnext=auto]
\starttext

\input ward
You will find that

\startformula
2+2=5
\stopformula % no blank line
for very large values of two.
\input dawkins
However, traditionalists maintain that

\startformula
2+2=4
\stopformula % extra blank line

Moving on, we find...
\input tufte

\stoptext

(pardon the extra test text. The bits that I wrote didn't make the 
example clear enough when typeset.)

 ... and not have the next paragraph after the formula. That is the  
 default. That is what I want. However, on occasion, sometimes I do  
 want to indent the next paragraph after a formula. My question is,  
 how to override the default behavior on occasion. That is, every  
 rare once in a while, how do I indent a paragraph after a formula.
 
 
 On Feb 20, 2006, at 10:13 AM, Taco Hoekwater wrote:
 
 David Arnold wrote:
 OK,

 But this gives the same result. No indent.
 [ok]

 How can I get that paragraph after the placeformula to indent?
\setupindenting[medium,yes]
\setupformulas[indentnext=yes]
%\setupfloats[indentnext=yes] % maybe desired as well?

 I just discovered that only this

\setupindenting[medium,always]

 doesn't work either, and that is a bit counterintuitive.

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


-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  Adam T. Lindsay, Computing Dept. [EMAIL PROTECTED]
  Lancaster University, InfoLab21+44(0)1524/510.514
  Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

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


[NTG-context] math tests - subformula ref's and symbols \oiint \oiiint like in Latex AMS

2006-02-17 Thread Wim Neimeijer
Title: math tests - subformula ref's and symbols \oiint \oiiint like in Latex AMS 






Hi, 

I am using Context for the second time now and I am investigating
the pro's and con's before migrating my Latex documents to Context.
So far I am really impressed with Context capabilities. 

Now I am testing some of the math I typeset with Latex to
determine whether or not to use Context.
In Latex I am using the ams math packages and knowing that there is
a amsl module for Context I did some test such as 

\def\wdiv{{\rm div} \:}
\def\rot{{\rm rot} \:}
\placeformula[eqn1]
\startformula
\eqalignno{
\wdiv \vec{E}  = \frac{\rho}{\epsilon_{0}} \formulanumber{.a} \cr
\rot \vec{B}  = \mu_{0} \:\vec{j} \subformulanumber{.b} \cr
\wdiv \vec{B}  = 0 \subformulanumber{.c} \cr
\rot \vec{E} + \frac{\partial \vec{B} }{\partial t}  = 0  \subformulanumber{.d} \cr}
\stopformula 

How can I refer to these subformulas in my running text ? 

As I am typesetting a lot of math in my physics doc's I use a lot of integration symbols amongs others.
In Latex I use \oint, \oiint and \oiint, even a quadruple int to indicate space - time integrals. Even I defined
a tex command for the surface integral.
I also found the Context \showmathcharacters which gave me most of the math symbols from the amsl module. 

However I did not found alternatives for \oiint, \oiiint unfortenately.
I discovered the \definemathsymbol in several context tex files, I was wondering if it is possible to
setup my own \oiint, \oiiint, \ont ... symbols ? If yes, my problem is I can't find any docu's on the usage of \definemathsymbol ?

Any help appreciated 

Kind regards 

W.Neimeijer 





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


Re: [NTG-context] Equation Numbering bug?

2006-02-13 Thread Hans Hagen
Taco Hoekwater wrote:
 Aditya Mahajan wrote:
   
 I do not understand why the second equation is numbered
 

 It is a bug. \placeformula turns on formula number processing
 (\settrue \handleformulanumber), but it never resets it.

 I guess this could be done right at the end of each formula,
 like so:

 \unprotect
 \def\dostopformula
{\doplaceformulanumber
 \getvalue{\e!stop\formulaparameter\c!alternative\v!formula}%
 \resetlastlinewidth
 \nonoindentation
 \dochecknextindentation{\??fm\currentformula}%
 \egroup
 \setfalse\handleformulanumber %TH, new
 \dorechecknextindentation}
 \protect

 Hans, I am not completely sure this is the right place. Please check!
   
looks ok to me; patched 

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.com
 | www.pragma-pod.nl
-

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


Re: [NTG-context] Equation Numbering bug?

2006-02-12 Thread Taco Hoekwater
Aditya Mahajan wrote:
 I do not understand why the second equation is numbered

It is a bug. \placeformula turns on formula number processing
(\settrue \handleformulanumber), but it never resets it.

I guess this could be done right at the end of each formula,
like so:

\unprotect
\def\dostopformula
   {\doplaceformulanumber
\getvalue{\e!stop\formulaparameter\c!alternative\v!formula}%
\resetlastlinewidth
\nonoindentation
\dochecknextindentation{\??fm\currentformula}%
\egroup
\setfalse\handleformulanumber %TH, new
\dorechecknextindentation}
\protect

Hans, I am not completely sure this is the right place. Please check!

Cheers, Taco

 \starttext
\placeformula \startformula \startalign[n=2]
  \NC  a \NC = b \NR
  \NC  c \NC = d \NR[+]
\stopalign \stopformula
Some text to separate equations
\startformula
  e = f
\stopformula
 \stoptext
 
 I can get rid of the numbering by placing a \placeformula[-] in the 
 begining. But, it should not be numbered by default.
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Equation Numbering bug?

2006-02-09 Thread Aditya Mahajan
I do not understand why the second equation is numbered

\starttext
   \placeformula \startformula \startalign[n=2]
 \NC  a \NC = b \NR
 \NC  c \NC = d \NR[+]
   \stopalign \stopformula
   Some text to separate equations
   \startformula
 e = f
   \stopformula
\stoptext

I can get rid of the numbering by placing a \placeformula[-] in the 
begining. But, it should not be numbered by default.

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


[NTG-context] eqalign

2006-02-04 Thread David Arnold
Taco, Hans, et al,

I'm hesitant to upgrade as I have several hundred eqalign groups in  
my work. Can you tell me if this now works in the new version?

%output=pdf
\starttext
\placeformula[-]
\startformula
\eqalign{
  f(x)=x^2-2x-3\cr
  f(x)=(x-3)(x+1)}
\stopformula
\stoptext


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


Re: [NTG-context] eqalign

2006-02-04 Thread Matthias Weber
This will work. I have also tons of \eqalign groups, some of them  
nested, and all
seems fine now.

Matthias

On Feb 4, 2006, at 11:08 PM, David Arnold wrote:

 Taco, Hans, et al,

 I'm hesitant to upgrade as I have several hundred eqalign groups in
 my work. Can you tell me if this now works in the new version?

 %output=pdf
 \starttext
 \placeformula[-]
 \startformula
 \eqalign{
   f(x)=x^2-2x-3\cr
   f(x)=(x-3)(x+1)}
 \stopformula
 \stoptext


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

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


[NTG-context] Scite and wrapping

2006-02-03 Thread David Arnold
Hi,

What tips can folks give me about wrapping in Scite?

A. Starting with a blank document.

B. Starting with a document that is not wrapped (lots of long lines).

In particular, is there a way to wrap a document while still  
preserving stuff like:

\placeformula[-]
\startformula
  \eqalign{
f(x)=x^2-2x-3\cr
f(x)=(x-3)(x+1)}
\stopformula



David Arnold
College of the Redwoods
Mathematics Department
Eureka, CA 95501
(707) 476-4222
http://online.redwoods.edu/instruct/darnold/


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


[NTG-context] Still problem with \eqalign :(

2006-02-01 Thread Matthias Weber
After downloading the release from yesterday,
simple \eqalign's seem to work, but I run into problems with


\starttext
\placeformula[-]
\startformula
\eqalign{
c:[-1,1] \to R^2
\cr
t\mapsto
\left\{
\eqalign{
-(t^2,0) \qquad\text{if $t\in[-1,0]$}
\cr
(0,t^2) \qquad\text{if $t\in[0,1]$}
}
\right.
}
\stopformula

\stoptext


Log file below.

Matthias


TeXExec 5.4.3 - ConTeXt / PRAGMA ADE 1997-2005

fixing engine variable : pdfetex
 executable : pdfetex
 format : cont-en
  inputfile : test
 output : pdftex
  interface : en
   current mode : none
TeX run : 1

This is pdfeTeX, Version 3.141592-1.30.4-2.2 (Web2C 7.5.5)
(/usr/local/teTeX/share/texmf.local/web2c/natural.tcx)
entering extended mode
(./test.tex

ConTeXt  ver: 2006.01.31 16:39  fmt: 2006.2.1  int: english  mes:  
english

language: language en is active
protectionstate 0
system  : cont-new loaded
(/usr/local/teTeX/share/texmf.local/tex/context/base/cont-new.tex
systems : beware: some patches loaded from cont-new.tex
color   : palette rollover is available
)
system  : cont-old loaded
(/usr/local/teTeX/share/texmf.local/tex/context/base/cont-old.tex
loading : Context Old Macros
)
system  : cont-fil loaded
(/usr/local/teTeX/share/texmf.local/tex/context/base/cont-fil.tex
loading : Context File Synonyms
)
system  : cont-sys.rme loaded
(/usr/local/teTeX/share/texmf.local/tex/context/user/cont-sys.rme
(/usr/local/teTeX/share/texmf.local/tex/context/base/type-exa.tex)
(/usr/local/teTeX/share/texmf.local/tex/context/base/type-syn.tex)
(/usr/local/teTeX/share/texmf.local/tex/context/base/type-enc.tex)
(/usr/local/teTeX/share/texmf.local/tex/context/base/type-siz.tex)
(/usr/local/teTeX/share/texmf.local/tex/context/base/type-map.tex)
(/usr/local/teTeX/share/texmf.local/tex/context/base/type-spe.tex)
(/usr/local/teTeX/share/texmf.local/tex/context/base/type-akb.tex))
bodyfont: 12pt rm is loaded
language: patterns en-ec:ec-1-2:3 uk-ec:ec-2-2:3 de- 
 texnansi:tex
nansi-3-2:3 de-ec:ec-4-2:3 fr-texnansi:texnansi-5-2:3 fr- 
 ec:ec-6-2:3
es-ec:ec-7-2:3 pt-texnansi:texnansi-8-2:3 pt-ec:ec-9-2:3 it- 
 texnansi
:texnansi-10-2:3 it-ec:ec-11-2:3 nl-texnansi:texnansi-12-2:3  
nl-ec:ec-
 13-2:3 cz-il2:il2-14-2:3 cz-ec:ec-15-2:3 sk-il2:il2-16- 
 2:3 sk-ec:ec
-17-2:3 pl-pl0:pl0-18-2:3 pl-ec:ec-19-2:3 pl-qx:qx-20-2:3  
loaded
specials: tex,postscript,rokicki loaded
system  : test.top loaded
(./test.top
specials: loading definition file tpd
(/usr/local/teTeX/share/texmf.local/tex/context/base/spec-tpd.tex
specials: loading definition file fdf
(/usr/local/teTeX/share/texmf.local/tex/context/base/spec-fdf.tex)
specials: fdf loaded
)
specials: fdf,tpd loaded
) (./test.tuo) (./test.tuo) (./test.tuo) (./test.tuo) (./test.tuo) (./ 
test.tuo)
(./test.tuo) (./test.tuo) (./test.tuo) (./test.tuo) (./test.tuo) (./ 
test.tuo)
(./test.tuo)
systems : begin file test at line 1
! Incomplete \ifnum; all text was ignored after line 15.
inserted text
 \fi
to be read again
\endtemplate
template {}}$\hfil \endtemplate

argument ...mathalignmentparameter \c!distance 
   \tabskip  
\zeropoint \to \s...

\ydorecurse ...el \let \recurselevel \!!plusone #2
   [EMAIL PROTECTED] \let 
[EMAIL PROTECTED]  
\recurselev...

\buildeqalign ...e \scratchtoks \the \!!toksb 
   \expanded  
{\scratchtoks {\...
...
l.15 }

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


Re: [NTG-context] Still problem with \eqalign :( / need taco's advice

2006-02-01 Thread Hans Hagen
Matthias Weber wrote:
 After downloading the release from yesterday,
 simple \eqalign's seem to work, but I run into problems with


 \starttext
 \placeformula[-]
 \startformula
 \eqalign{
 c:[-1,1] \to R^2
 \cr
 t\mapsto
 \left\{
 \eqalign{
 -(t^2,0) \qquad\text{if $t\in[-1,0]$}
 \cr
 (0,t^2) \qquad\text{if $t\in[0,1]$}
 }
 \right.
 }
 \stopformula
   

 ! Incomplete \ifnum; all text was ignored after line 15.
 inserted text
  \fi
 to be read again
   
so you have a nested eqalign; before i spend hours on this, maybe taco has an 
idea (lookahead, preamble, whatever problem?)

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.com
 | www.pragma-pod.nl
-

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


[NTG-context] Still problem with \eqalign

2006-01-31 Thread Matthias Weber
Using the iinstaller CoNtExt version of today which contains the  
newest (?)
core-mat.tex with the fixed \eqalign,
I still run into a problem with a standard \eqalign like

\starttext

\placeformula[-]
\startformula
\eqalign{
c:[0,2\pi] \to R^2
\cr
t \mapsto (a\cos(t), b\sin(t))
}
\stopformula


\stoptext


---


! Illegal unit of measure (pt inserted).
to be read again
{
\eqalign ...ildeqalign \null \,\vcenter {\openup {
   .25\bodyfontsize } 
\mathsur...
l.124 }

?



Matthias, desolate :)


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


[NTG-context] eqalign name clash

2006-01-28 Thread Hans van der Meer
I am afraid that the update of today (28-1-2006) also has generated a  
problem.
This used to work (just a plaintex \eqalign)

\starttext
\placeformula\startformula
\matrix{ab\cr cd\cr}
\eqalign{
a = b\cr
pq = t+1\cr
}
\stopformula
\stoptext

I see in core-mat.tex a macro \eqalign#1 (line 1514). It is new I  
think, but its name CLASHES with the standard TeX \eqalign math macro.
I do not think that wise and had to comment it out in my working  
copy. Everything being fine again after that.

yours sincerely,
dr. H. van der Meer



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


[NTG-context] Typesetting chemical reaction equations

2006-01-27 Thread Ville Voipio
I would need to typeset some rather simple reaction equations. I do not 
need the structural capabilities of PPCHTeX, just something simpler. The 
thing I am writing has something to do with physical chemistry, so I 
need mathematical equations, as well.

Of course, the natural way to do this:

\placeformula
\startformula
   \rm
   NH_3(g) + H^+(aq.) + Cl^-(aq.) \rightarrow NH_4^+(aq.) + Cl^-(aq.)
\stopformula

This gives rather pleasant-looking results. However, is this the right 
(i.e. kosher) way of doing things, or do I run into trouble at some 
later point with this? What are you chemists using?

And how do I switch off the equation numbering for the chemical 
reactions (I'd like to have the mathematical formulae still numbered)?

TIA,

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


Re: [NTG-context] Typesetting chemical reaction equations

2006-01-27 Thread Hans Hagen
Ville Voipio wrote:
 I would need to typeset some rather simple reaction equations. I do not 
 need the structural capabilities of PPCHTeX, just something simpler. The 
 thing I am writing has something to do with physical chemistry, so I 
 need mathematical equations, as well.

 Of course, the natural way to do this:

 \placeformula
 \startformula
\rm
NH_3(g) + H^+(aq.) + Cl^-(aq.) \rightarrow NH_4^+(aq.) + Cl^-(aq.)
 \stopformula

 This gives rather pleasant-looking results. However, is this the right 
 (i.e. kosher) way of doing things, or do I run into trouble at some 
 later point with this? What are you chemists using?

 And how do I switch off the equation numbering for the chemical 
 reactions (I'd like to have the mathematical formulae still numbered)?
   
\usemodule[chemic]

\placeformula[-]
\startformula
   \chemical{NH_3(g),+,H^+(aq.),+,Cl^-(aq.),-,NH_4^+(aq.),+,Cl^-(aq.)}
\stopformula


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

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


Re: [NTG-context] Typesetting chemical reaction equations

2006-01-27 Thread Ville Voipio
 And how do I switch off the equation numbering for the chemical 
 reactions (I'd like to have the mathematical formulae still numbered)?

Stupid me. Just by leaving the \placeformula out. (Maybe I should go and 
get something to eat, my brain seems to be in some sort of energy-saving 
mode.)

By the way, is there a simple way to have two separate numbering 
schemes? If I wanted to have chemical formulae numbered with 1,2,3,4... 
and maths with i, ii, iii, iv, ... , how should I do it? It must be 
documented with \placeformula, but is \placeformula documented anywhere 
apart from the code itself? (Yes, I am lazy.)

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


Re: [NTG-context] Typesetting chemical reaction equations

2006-01-27 Thread Ville Voipio
 \usemodule[chemic]
 
 \placeformula[-]
 \startformula
\chemical{NH_3(g),+,H^+(aq.),+,Cl^-(aq.),-,NH_4^+(aq.),+,Cl^-(aq.)}
 \stopformula

Dank u!

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


Re: [NTG-context] Typesetting chemical reaction equations

2006-01-27 Thread Hans Hagen
Ville Voipio wrote:
 And how do I switch off the equation numbering for the chemical 
 reactions (I'd like to have the mathematical formulae still numbered)?
 

 Stupid me. Just by leaving the \placeformula out. (Maybe I should go and 
 get something to eat, my brain seems to be in some sort of energy-saving 
 mode.)

 By the way, is there a simple way to have two separate numbering 
 schemes? If I wanted to have chemical formulae numbered with 1,2,3,4... 
 and maths with i, ii, iii, iv, ... , how should I do it? It must be 
 documented with \placeformula, but is \placeformula documented anywhere 
 apart from the code itself? (Yes, I am lazy.)
   
well, i can make a \defineformulaplacement; remind me 

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.com
 | www.pragma-pod.nl
-

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


Re: [NTG-context] Typesetting chemical reaction equations

2006-01-27 Thread Hans Hagen
Ville Voipio wrote:
 \usemodule[chemic]

 \placeformula[-]
 \startformula
\chemical{NH_3(g),+,H^+(aq.),+,Cl^-(aq.),-,NH_4^+(aq.),+,Cl^-(aq.)}
 \stopformula
 

 Dank u!
   
Graag gedaan 

btw, this is documented in the ppchtex manual

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

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


[NTG-context] setupindenting and formula

2006-01-27 Thread Renaud AUBIN





Hi all,

I use \setupindenting[medium,yes] in my document.

When I use:

\placeformula[GiPivel]
\startformula
\frac{\overrightarrow{G_iP_i}}{\Delta T} = \frac{d_i.\vec{y_i} +
 \delta_i.\vec{t_i}}{\Delta T} = -\dot{\theta_i}.\vec{z_i} \wedge
l_i.\vec{x_i}+ V_i.\vec{x_i} = -\dot{\theta_i} l_i.\vec{y_i}+
V_i.\vec{x_i}
\stopformula

Test sentence to check indenting.


The test sentence is not indented...

Consequently, I have tried:

\indent
Test sentence to
check indenting.


Unfortunately, the test
sentence isn't indented...

To indent or not to indent, that is the question !!! ;-)

Renaud





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


Re: [NTG-context] LaTeX array equivalence with multiline \lbrace

2006-01-26 Thread Hans Hagen
Renaud AUBIN wrote:

I've read the post [NTG-context] Math Cases and I'm interested to have 
the possibility to do this kind of numbering:

 { b , if whatever (1a)
  a ={
 { c,  otherwise   (1b)

  

If I understand you correctly, then something like this

\definealign[cases][left={\left\{}, right={\right.}, n=2, 
align={left,left}]

will give us \startcases, \stopcases which works like \cases. Such a 
feature will be very useful.


Is it possible to define left|right in such a way that
\definealign[important][left={\framed\bgroup},right={\egroup}]
results in a frame around the equations (and does not include the equation 
numbers), that is the frame is as broad as the width of the largest 
equation that follows. This mechanism can be used to highlight equations.

Also, in another post, I had asked if it is possible to have cases that 
are numbered, that is, can I get

{ b , if whatever (1a)
 a ={
{ c,  otherwise   (1b)

This is not important, but will be nice to have.


something like this? 

\unprotect 

\definesystemvariable{ce}
\def\v!mathcases {mathcases}
\def\c!numberdistance{numberdistance}

\def\setupmathcases
  {\dodoubleempty\dosetupmathcases}

\def\dosetupmathcases[#1][#2]%
  {\ifsecondargument
 \getparameters[\??ce#1][#2]%
   \else
 \getparameters[\??ce][#1]%
   \fi}

\let\currentmathcases\empty

\def\mathcasesparameter#1%
  
{\executeifdefined{\??ce\currentmathcases#1}{\executeifdefined{\??ce#1}\empty}}

\setupmathcases
  [\c!distance=1em,
   \c!numberdistance=2.5em]

\def\definemathcases
  {\dodoubleempty\dodefinemathcases}

\def\dodefinemathcases[#1]% [#2]%
  {\setvalue{\e!start#1}{\dodoubleempty\dostartmathcases[#1]}%
   \setvalue{\e!stop #1}{\dostopmathcases}%
   \setupmathcases[#1]}% [#2]

\definemathcases[cases]
\definemathcases[\v!mathcases]

\def\dodocasesNC
  {\gdef\docasesNC{\endmath}}

\let\docasesNR\doalignNR

\def\dostartmathcases[#1][#2]%
  {\begingroup
   \edef\currentmathcases{#1}%
   \doifassignmentelse{#2}{\setupmathcases[#1][#2]}\donothing
   \left\{%
   \,%
   \vcenter\bgroup
   \pushmacro\docasesNC
   \let\endmath\relax
   \def\NC{\docasesNC}%
   \def\MC{\docasesNC\ifmmode\else$\def\endmath{$}\fi}%
   \global\let\docasesNC\dodocasesNC
   
\def\NR{\endmath\global\let\docasesNC\dodocasesNC\doxxdoubleempty\docasesNR}%
   \normalbaselines
   \mathsurround\zeropoint
   \everycr\emptytoks
   \tabskip\zeropoint
   \global\eqaligncolumn\plusone
   \halign\bgroup
\span$##$\hfil
   \hskip\mathcasesparameter\c!distance\relax\popmacro\docasesNC##\hfil
   \hskip\mathcasesparameter\c!numberdistance\relax\span\textineqalign{##}%
 \crcr} % todo: number

\def\dostopmathcases
  {\crcr
   \egroup
   \popmacro\docasesNC
   \egroup
   \right.
   \endgroup}

\protect

\showframe

\placeformula \startformula \startcases
\NC 2 \NC $ y  0 $ \NR
\NC 7 \NC $ x = 7 $ \NR[+]
\NC 4 \NC otherwise \NR
\stopcases \stopformula

\placeformula \startformula x
\startcases
\NC 2 \NC $ y  0 $ \NR[+]
\NC 7 \NC $ x = 7 $ \NR
\NC 4 \NC otherwise \NR
\stopcases
\stopformula

\placeformula \startformula \startcases
\NC 2 \NC $ y  0 $ \NR
\NC 7 \NC $ x = 7 $ \NR
\NC 4 \NC otherwise \NR
\stopcases \stopformula

\placeformula \startformula x
\startcases
\NC 2 \NC $ y  0 $ \NR
\NC 7 \NC $ x = 7 $ \NR
\NC 4 \NC otherwise \NR
\stopcases
\stopformula


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

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


Re: [NTG-context] LaTeX array equivalence with multiline \lbrace

2006-01-26 Thread Aditya Mahajan
--- On Jan 26, Hans Hagen wrote ---

 Also, in another post, I had asked if it is possible to have cases that
 are numbered, that is, can I get

{ b , if whatever (1a)
 a ={
{ c,  otherwise   (1b)

 This is not important, but will be nice to have.


 something like this?

 [ code snipped ]

 \placeformula \startformula \startcases
 \NC 2 \NC $ y  0 $ \NR
 \NC 7 \NC $ x = 7 $ \NR[+]
 \NC 4 \NC otherwise \NR
 \stopcases \stopformula


Not exactly. In this, I get two formula numbers, one for the case 
`x=7' and the other for the entire equation. I can remove 
\placeformula and almost get the desired behaviour. There should be an 
option to flushright the equation number corresponding to each case, 
i.e., I should be able to get

+-+
| |
| ,-  |
| |   15,  if something   (1) |
| x = {   |
| |   0,  otherwise   (2) |
| `-  |
+-+


Where the frame is the page boundaries. I hope I am making sense here.

Further, I can not get correct subnumbering here. Look at the output 
of

\startformula \startcases
\NC a \NC if something \NR[eq:a][a]
\NC b \NC otherwise\NR[eq:b][b]
\stopcases \stopformula

Other than these minor glitches, this is perfect.



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] Subtle problem with startformula

2006-01-23 Thread Hans Hagen

David Arnold wrote:


All,

If you're not aware of this one, consider:

\placeformula[-]
\startformula
  [-2,2)=\{x:\, -2\le x  2\}.
\stopformula

Won't compile, but try:

\placeformula[-]
\startformula\relax
  [-2,2)=\{x:\, -2\le x  2\}.
\stopformula


this is indeed a side effect of optional arguments 

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.com
| www.pragma-pod.nl
-

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


[NTG-context] Subtle problem with startformula

2006-01-21 Thread David Arnold

All,

If you're not aware of this one, consider:

\placeformula[-]
\startformula
  [-2,2)=\{x:\, -2\le x  2\}.
\stopformula

Won't compile, but try:

\placeformula[-]
\startformula\relax
  [-2,2)=\{x:\, -2\le x  2\}.
\stopformula
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Align a compound inequality

2006-01-20 Thread David Arnold

All,

I have:

\placeformula[-]
\startformula
  \startalign[m=2]
3-2x-1  3-2x1\\
 -2x-4   -2x-2\\
   x2  x1
  \stopalign
\stopformula

And it works. However, I want to sqeeze the word or between the  
inequalities on the first row so that it reads:


3 - 2x  -1  or  3 - 2x  1

How can I do this?

I am not sure what m and n are meant to do with this code. Hans said  
n=n_of_columns and m=n_of_pairs, but I am not sure what these mean as  
relates to my problem above.


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


Re: [NTG-context] math

2006-01-20 Thread David Arnold
\currentmathalign#1}{\executeifdefined{\?? 
eq#1}\empty}}


\setupmathalign
  [\c!n=2,
   \c!m=1,
   \c!distance=1em]

\def\numberedeqalign
  {\doifelse\@@fmlocation\v!left\alignleqalignno\aligneqalignno}

\def\doxxdoubleempty#1#2%
  {\ifx#2[\expandafter\dodoxxdoubleempty\else\expandafter 
\noxxdoubleempty\fi#1#2}


\def\dodoxxdoubleempty#1[#2]#3%
  {\ifx#3[\else\expandafter\nonoxxdoubleempty\fi#1[#2]#3}

\def\noxxdoubleempty  #1{#1[][]}
\def\nonoxxdoubleempty#1[#2]{#1[#2][]}

\newcount\eqaligncolumn

\def\firstineqalign{\global\eqaligncolumn\plusone}
\def\nextineqalign {\global\advance\eqaligncolumn\plusone}
\def\leftofeqalign {\getvalue{\??eq:\v!left :\number\eqaligncolumn}}
\def\rightofeqalign{\getvalue{\??eq:\v!right:\number\eqaligncolumn}}

\def\doseteqaligncolumn#1%
  {\letvalue{\??eq:\v!left :\number\eqaligncolumn}\empty
   \letvalue{\??eq:\v!right:\number\eqaligncolumn}\empty
   \doif{#1}\v!left  {\letvalue{\??eq:\v!right:\number 
\eqaligncolumn}\hfill}%
   \doif{#1}\v!right {\letvalue{\??eq:\v!left :\number 
\eqaligncolumn}\hfill}%
   \doif{#1}\v!middle{\letvalue{\??eq:\v!right:\number 
\eqaligncolumn}\hfill
  \letvalue{\??eq:\v!left :\number 
\eqaligncolumn}\hfill}}


\def\dodoalignNC
  {\gdef\doalignNC##1{##1}}

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

\def\dostartmathalign[#1][#2]%
  {\pushmacro\doalignNC
   \edef\currentmathalign{#1}%
   \doifassignmentelse{#2}{\setupmathalign[#1][#2]}\donothing
   \def\NC{\doalignNC}%
   \global\let\doalignNC\dodoalignNC
   \def\EQ{=}%
   \def\NR{\global\let\doalignNC\dodoalignNC\doxxdoubleempty 
\doalignNR}%

   % amstex compatibility mode: (ugly)
   \def\notag{\def\\{\crcr}}%
   \doifelse{#2}{*}{\def\\{\crcr}}{\def\\{\doalignNR[+][]\crcr}}%
   % end of compatibility mode
   \eqaligncolumn\zerocount
   \processcommacommand[\mathalignparameter\c!align]{\advance 
\eqaligncolumn\plusone\doseteqaligncolumn}%

   % the real action
   \global\eqaligncolumn\plusone
   \numberedeqalign}

\def\dostopmathalign
  {\finishalignno
   \popmacro\doalignNC}

\def\definemathalign
  {\dodoubleempty\dodefinemathalign}

\def\dodefinemathalign[#1]% [#2]%
  {\setvalue{\e!start#1}{\dodoubleempty\dostartmathalign[#1]}%
   \setvalue{\e!stop #1}{\dostopmathalign}%
   \setupmathalign[#1]}% [#2]

\definemathalign[align] % default case

% \def\startsplit
%   {\startalign[*]} % no number by default
%
% \def\stopsplit
%   {\doalignNR[+][]\crcr % for a number on last line
%\stopalign}

%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:demo-a-1]
%D \NC\EQ g \NR[for:demo-a-2][a]
%D \NC\EQ h \NR[for:demo-a-3][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 \NC  a \NC \eq  b \NR[+]
%D \NC  c \NC \neq d \NR
%D \NC\NC \neq f \NR[for:demo-b-1]
%D \NC\NC \geq g \NR[for:demo-b-2][a]
%D \NC\NC \leq h \NR[for:demo-b-3][b]
%D \NC\NC \neq i \NR
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign[*]
%D a = b \\
%D c = d \\
%D   = e \\
%D   = f \\
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign
%D x = y \\
%D a = b \\
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign[m=3]
%D x = y  x = y  z = t \\
%D a = b  p = q  w = s \\
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign[m=3,distance=0pt]
%D x = y = x = y = z = t \\
%D a = b = p = q = w = s \\
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign[n=5,distance=0pt]
%D x = yy = xx = yy = zz \\
%D a = b  = p  = q  = w  \\
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign[n=3,align= 
{left,middle,right}]

%D \NC   l \NC = \NC r \NR
%D \NCleft

[NTG-context] Referencing an align environment

2006-01-20 Thread David Arnold

All,

I tried:

\placeformula[eq:twosolve]
\startformula
  \startalign[m=3]
3-2x-1 \qor 3-2x1\\
 -2x-4   -2x-2\\
   x2  x1
  \stopalign
\stopformula

As we see in (\in[eq;twosolve]), ...

But that didn't work.

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


Re: [NTG-context] Align a compound inequality

2006-01-20 Thread Aditya Mahajan

--- On Jan 20, David Arnold wrote ---


All,

I have:

\placeformula[-]
\startformula
\startalign[m=2]
  3-2x-1  3-2x1\\
   -2x-4   -2x-2\\
 x2  x1
\stopalign
\stopformula

And it works. However, I want to sqeeze the word or between the 
inequalities on the first row so that it reads:


3 - 2x  -1  or  3 - 2x  1

How can I do this?


This is how I would do this,

\startformula \startalign[n=5,align={right,left,middle,right,left}]
 3 - 2x   -1  \quad \text{or} \quad  3-2x   1 \\
 -2x   -4  \text{or}  -2x  -2 \\
\stopalign \stopformula


--
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] Align a compound inequality

2006-01-20 Thread David Arnold

Aditya,

Thanks, and I am getting this to work, which is similar to the way  
the align macros from the AMS work:


\placeformula[eq:twosolve]
\startformula
  \startalign[m=3]
3-2x-1 \qor 3-2x1\\
 -2x-4   -2x-2\\
   x2  x1
  \stopalign
\stopformula


On Jan 20, 2006, at 10:07 PM, Aditya Mahajan wrote:


--- On Jan 20, David Arnold wrote ---


All,

I have:

\placeformula[-]
\startformula
\startalign[m=2]
  3-2x-1  3-2x1\\
   -2x-4   -2x-2\\
 x2  x1
\stopalign
\stopformula

And it works. However, I want to sqeeze the word or between the  
inequalities on the first row so that it reads:


3 - 2x  -1  or  3 - 2x  1

How can I do this?


This is how I would do this,

\startformula \startalign[n=5,align={right,left,middle,right,left}]
 3 - 2x   -1  \quad \text{or} \quad  3-2x   1 \\
 -2x   -4  \text{or}  -2x  -2 \\
\stopalign \stopformula


--
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


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


Re: [NTG-context] Referencing an align environment

2006-01-20 Thread Aditya Mahajan

--- On Jan 20, David Arnold wrote ---


\placeformula[eq:twosolve]
\startformula
 \startalign[m=3]
   3-2x-1 \qor 3-2x1\\
-2x-4   -2x-2\\
  x2  x1
 \stopalign
\stopformula

As we see in (\in[eq;twosolve]), ...

But that didn't work.


There are three equations, which one do you want to refer using 
eq:twosolve? You need to refer each equation explicitly. Something 
like

\placeformula \startformula \startalign[m=3]
 \NC 3 -2x \NC -1 \NC\NC \qor \NC 3-2x \NC 1 \NR[eq:twosolve]
 \NC -2x \NC -4 \NC\NC\NC -2x \NC -2 \NR
\stopalign \stopformula

Also note that if you use ams style .. \\ you need to put \\ on the 
last one also.


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] Referencing an align environment

2006-01-20 Thread David Arnold

Aditya,

I want to reference the whole block, not any one equation.

Thanks.

On Jan 20, 2006, at 10:32 PM, Aditya Mahajan wrote:


--- On Jan 20, David Arnold wrote ---


\placeformula[eq:twosolve]
\startformula
 \startalign[m=3]
   3-2x-1 \qor 3-2x1\\
-2x-4   -2x-2\\
  x2  x1
 \stopalign
\stopformula

As we see in (\in[eq;twosolve]), ...

But that didn't work.


There are three equations, which one do you want to refer using  
eq:twosolve? You need to refer each equation explicitly. Something  
like

\placeformula \startformula \startalign[m=3]
 \NC 3 -2x \NC -1 \NC\NC \qor \NC 3-2x \NC 1 \NR[eq:twosolve]
 \NC -2x \NC -4 \NC\NC\NC -2x \NC -2 \NR
\stopalign \stopformula

Also note that if you use ams style .. \\ you need to put \\ on  
the last one also.


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


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


Re: [NTG-context] Align a compound inequality

2006-01-20 Thread Aditya Mahajan

--- On Jan 20, David Arnold wrote ---


Aditya,

Thanks, and I am getting this to work, which is similar to the way the align 
macros from the AMS work:


Keep in mind Hans comment in math-ext
   % amstex compatibility mode: (ugly)
I kinda agree. Look at the example in the source for using \NC \NC \NR 
instead of  .. \\. That gives you more flexibility in using labels 
and numbering for for specific equations.





\placeformula[eq:twosolve]
\startformula
\startalign[m=3]
  3-2x-1 \qor 3-2x1\\
   -2x-4   -2x-2\\
 x2  x1
\stopalign
\stopformula


On Jan 20, 2006, at 10:07 PM, Aditya Mahajan wrote:


--- On Jan 20, David Arnold wrote ---


All,

I have:

\placeformula[-]
\startformula
\startalign[m=2]
 3-2x-1  3-2x1\\
  -2x-4   -2x-2\\
x2  x1
\stopalign
\stopformula

And it works. However, I want to sqeeze the word or between the 
inequalities on the first row so that it reads:


3 - 2x  -1  or  3 - 2x  1

How can I do this?


This is how I would do this,

\startformula \startalign[n=5,align={right,left,middle,right,left}]
3 - 2x   -1  \quad \text{or} \quad  3-2x   1 \\
-2x   -4  \text{or}  -2x  -2 \\
\stopalign \stopformula


--
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


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




--
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] Referencing an align environment

2006-01-20 Thread Aditya Mahajan

--- On Jan 20, David Arnold wrote ---


I want to reference the whole block, not any one equation.


I do not understand how would you want the output to look like?

 a = b  (1)
 c = d  (2)
 e = f  (3)

As seen in (1),(2) and (3).

Maybe ask Hans for a feature request :-)

Aditya



On Jan 20, 2006, at 10:32 PM, Aditya Mahajan wrote:


--- On Jan 20, David Arnold wrote ---


\placeformula[eq:twosolve]
\startformula
\startalign[m=3]
  3-2x-1 \qor 3-2x1\\
   -2x-4   -2x-2\\
 x2  x1
\stopalign
\stopformula

As we see in (\in[eq;twosolve]), ...

But that didn't work.


There are three equations, which one do you want to refer using 
eq:twosolve? You need to refer each equation explicitly. Something like

\placeformula \startformula \startalign[m=3]
\NC 3 -2x \NC -1 \NC\NC \qor \NC 3-2x \NC 1 \NR[eq:twosolve]
\NC -2x \NC -4 \NC\NC\NC -2x \NC -2 \NR
\stopalign \stopformula

Also note that if you use ams style .. \\ you need to put \\ on the last 
one also.


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


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




--
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


[NTG-context] formula in itemlist

2006-01-19 Thread Hans van der Meer
I want to place a math formula in the item of an itemlist, but I keep  
getting overfull hboxes.

A minimal  example follows:

\starttext
\startitemize
\item dit is een
\item dit is een formule
\placeformula[-]
\startformula
n= 0% this is line 7
\stopformula
\stopitemize
\stoptext

in the log it says:

Overfull \hbox (17.62474pt too wide) in paragraph at lines 7--7
[][]

\hbox(10.41603+4.05064)x0.0
.\glue(\leftskip) 17.62474
.\hbox(0.0+0.0)x0.0
.\hbox(10.41603+4.05064)x0.0
..\rule(10.41603+4.05064)x0.0
..\glue 0.0 plus 1.0fil minus 1.0fil
.\penalty 1
.\glue(\parfillskip) 0.0 plus 1.0fil
.etc.

Removing the \placeformula makes no difference.

Although a fallback to $$ n = 0 $$ makes the overfull hbox go away,  
it does not seem the ConTeXt way of doing.
Is this something in formula about not changing a hbox-width inside  
the itemize?


yours sincerely,
dr. H. van der Meer



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


Re: [NTG-context] formula in itemlist

2006-01-19 Thread Hans Hagen

Hans van der Meer wrote:

I want to place a math formula in the item of an itemlist, but I keep  
getting overfull hboxes.

A minimal  example follows:

\starttext
\startitemize
\item dit is een
\item dit is een formule
\placeformula[-]
\startformula
n= 0% this is line 7
\stopformula
\stopitemize
\stoptext

in the log it says:

Overfull \hbox (17.62474pt too wide) in paragraph at lines 7--7
[][]

\hbox(10.41603+4.05064)x0.0
.\glue(\leftskip) 17.62474
.\hbox(0.0+0.0)x0.0
.\hbox(10.41603+4.05064)x0.0
..\rule(10.41603+4.05064)x0.0
..\glue 0.0 plus 1.0fil minus 1.0fil
.\penalty 1
.\glue(\parfillskip) 0.0 plus 1.0fil
.etc.

Removing the \placeformula makes no difference.

Although a fallback to $$ n = 0 $$ makes the overfull hbox go away,  
it does not seem the ConTeXt way of doing.
Is this something in formula about not changing a hbox-width inside  
the itemize?


not so much tested:

\def\setdisplaydimensions
 {\displayindent\leftdisplayskip
  \advance\displayindent\leftdisplaymargin
  \displaywidth\hsize
  \ifdim\hangindent\zeropoint
\advance\displayindent\hangindent
  \else
\advance\displaywidth\hangindent
  \fi
  \advance\displaywidth-\displayindent
  \advance\displaywidth-\rightdisplayskip
  \advance\displaywidth-\rightdisplaymargin
  \hsize\displaywidth}

i'll also add an option to center at the page level and not locally

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.com
| www.pragma-pod.nl
-

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


Re: [NTG-context] math

2006-01-18 Thread Aditya Mahajan

--- On Jan 17, Hans Hagen wrote ---


Hi,

Attached is a new version of math-ext

- multiple columns
- alignment per column

See examples in source (mixed |cr and NC|NR is no longer supported).


Thanks a lot. This takes care of 95% of my math needs, and I have 
finally started using context for a project. I did a bit of testing of 
the code and things work as expected. Once it is included in the main 
distribution, I will write an entry on the wiki.


I am not sure of what is distance supposed to do when we specify the 
columns as n=something. Consider the following example for the source. 
I changed distance=0pt to distance=5cm and see no change.


\startbuffer
\placeformula \startformula \startalign[n=5,distance=5cm]
x = yy = xx = yy = zz \\
a = b  = p  = q  = w  \\
\stopalign \stopformula
\stopbuffer

\typebuffer \getbuffer


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] math

2006-01-18 Thread Hans Hagen

Aditya Mahajan wrote:


--- On Jan 17, Hans Hagen wrote ---


Hi,

Attached is a new version of math-ext

- multiple columns
- alignment per column

See examples in source (mixed |cr and NC|NR is no longer supported).



Thanks a lot. This takes care of 95% of my math needs, and I have 
finally started using context for a project. I did a bit of testing of 
the code and things work as expected. Once it is included in the main 
distribution, I will write an entry on the wiki.


I am not sure of what is distance supposed to do when we specify the 
columns as n=something. Consider the following example for the source. 
I changed distance=0pt to distance=5cm and see no change.


\startbuffer
\placeformula \startformula \startalign[n=5,distance=5cm]
x = yy = xx = yy = zz \\
a = b  = p  = q  = w  \\
\stopalign \stopformula
\stopbuffer

\typebuffer \getbuffer


it's only used when m is set

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


[NTG-context] math

2006-01-17 Thread Hans Hagen
#3[\else\expandafter\nonoxxdoubleempty\fi#1[#2]#3}

\def\noxxdoubleempty  #1{#1[][]}
\def\nonoxxdoubleempty#1[#2]{#1[#2][]}

\newcount\eqaligncolumn

\def\firstineqalign{\global\eqaligncolumn\plusone}
\def\nextineqalign {\global\advance\eqaligncolumn\plusone}
\def\leftofeqalign {\getvalue{\??eq:\v!left :\number\eqaligncolumn}}
\def\rightofeqalign{\getvalue{\??eq:\v!right:\number\eqaligncolumn}}

\def\doseteqaligncolumn#1%
  {\letvalue{\??eq:\v!left :\number\eqaligncolumn}\empty
   \letvalue{\??eq:\v!right:\number\eqaligncolumn}\empty
   \doif{#1}\v!left  {\letvalue{\??eq:\v!right:\number\eqaligncolumn}\hfill}%
   \doif{#1}\v!right {\letvalue{\??eq:\v!left :\number\eqaligncolumn}\hfill}%
   \doif{#1}\v!middle{\letvalue{\??eq:\v!right:\number\eqaligncolumn}\hfill
  \letvalue{\??eq:\v!left :\number\eqaligncolumn}\hfill}}

\def\dodoalignNC
  {\gdef\doalignNC##1{##1}}

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

\def\dostartmathalign[#1][#2]%
  {\pushmacro\doalignNC
   \edef\currentmathalign{#1}%
   \doifassignmentelse{#2}{\setupmathalign[#1][#2]}\donothing
   \def\NC{\doalignNC}%
   \global\let\doalignNC\dodoalignNC
   \def\EQ{=}%
   \def\NR{\global\let\doalignNC\dodoalignNC\doxxdoubleempty\doalignNR}%
   % amstex compatibility mode: (ugly)
   \def\notag{\def\\{\crcr}}%
   \doifelse{#2}{*}{\def\\{\crcr}}{\def\\{\doalignNR[+][]\crcr}}%
   % end of compatibility mode
   \eqaligncolumn\zerocount
   \processcommacommand[\mathalignparameter\c!align]{\advance\eqaligncolumn\plusone\doseteqaligncolumn}%
   % the real action
   \global\eqaligncolumn\plusone
   \numberedeqalign}

\def\dostopmathalign
  {\finishalignno
   \popmacro\doalignNC}

\def\definemathalign
  {\dodoubleempty\dodefinemathalign}

\def\dodefinemathalign[#1]% [#2]%
  {\setvalue{\e!start#1}{\dodoubleempty\dostartmathalign[#1]}%
   \setvalue{\e!stop #1}{\dostopmathalign}%
   \setupmathalign[#1]}% [#2]

\definemathalign[align] % default case

% \def\startsplit
%   {\startalign[*]} % no number by default
%
% \def\stopsplit
%   {\doalignNR[+][]\crcr % for a number on last line
%\stopalign}

%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:demo-a-1]
%D \NC\EQ g \NR[for:demo-a-2][a]
%D \NC\EQ h \NR[for:demo-a-3][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 \NC  a \NC \eq  b \NR[+]
%D \NC  c \NC \neq d \NR
%D \NC\NC \neq f \NR[for:demo-b-1]
%D \NC\NC \geq g \NR[for:demo-b-2][a]
%D \NC\NC \leq h \NR[for:demo-b-3][b]
%D \NC\NC \neq i \NR
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign[*]
%D a = b \\
%D c = d \\
%D   = e \\
%D   = f \\
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign
%D x = y \\
%D a = b \\
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign[m=3]
%D x = y  x = y  z = t \\
%D a = b  p = q  w = s \\
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign[m=3,distance=0pt]
%D x = y = x = y = z = t \\
%D a = b = p = q = w = s \\
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign[n=5,distance=0pt]
%D x = yy = xx = yy = zz \\
%D a = b  = p  = q  = w  \\
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign[n=3,align={left,middle,right}]
%D \NC   l \NC = \NC r \NR
%D \NCleft \NC = \NC right \NR
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign[n=3,align={right,middle,left}]
%D \NC   l \NC = \NC r \NR
%D \NCleft \NC = \NC right \NR
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula

Re: [NTG-context] Alignments side by side

2006-01-16 Thread Willi Egger

Hi David,

you can play with placing floats in a combination:
\setupoutput[pdftex]
\setupformulae[location=left,margin=no]
\startbuffer[1]
\framed[frame=on,width=fit]
{\startformula
\eqalign{
 f(x)=x2-2x-3\cr
 f(x)=x^02x+1-1-3\cr
 f(x)=(x-1)2-4}
\stopformula}
\stopbuffer

\startbuffer[2]
\framed[frame=on,width=fit]
{\startformula
\eqalign{
 f(x)=x2-2x-3\cr
 f(x)=x^02x+1-1-3\cr
 f(x)=(x-1)2-4}
\stopformula}
\stopbuffer

\starttext
\placefigure[-]{none}
{\startcombination[2*1]
   {\externalfigure[1][width=.45\textwidth,type=buffer]}{}
   {\externalfigure[2][width=.45\textwidth,type=buffer]}{}
\stopcombination}
\stoptext

Willi

David Arnold wrote:


All,

I am wondering how I can put two alignment environments side-by-side?

For test purposes, it's OK to use this twice.

\placeformula[-]
\startformula
\eqalign{
  f(x)=x^2-2x-3\cr
  f(x)=x^02x+1-1-3\cr
  f(x)=(x-1)^2-4}
\stopformula

I'd like to get two of these side-by-side, or something that will  
typeset a similar result side-by-side.


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


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


Re: [NTG-context] math align

2006-01-16 Thread Hans Hagen
 compatibility mode: (ugly)
   \def\notag{\def\\{\crcr}}%
   \doifelse{#2}{*}{\def\\{\crcr}}{\def\\{\doalignNR[+][]\crcr}}%
   % end of compatibility mode
   \numberedeqalign}

\let\dostopmathalign\finishalignno

\def\definemathalign
  {\dodoubleempty\dodefinemathalign}

\def\dodefinemathalign[#1]% [#2]%
  {\setvalue{\e!start#1}{\dodoubleempty\dostartmathalign[#1]}%
   \setvalue{\e!stop #1}{\dostopmathalign}%
   \setupmathalign[#1]}% [#2]

\definemathalign[align] % default case

% \def\startsplit
%   {\startalign[*]} % no number by default
%
% \def\stopsplit
%   {\doalignNR[+][]\crcr % for a number on last line
%\stopalign}

%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:demo-a-1]
%D \NC\EQ g \NR[for:demo-a-2][a]
%D \NC\EQ h \NR[for:demo-a-3][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:demo-b-1]
%D \NC\NC \geq g \NR[for:demo-b-2][a]
%D \NC\NC \leq h \NR[for:demo-b-3][b]
%D \NC\NC \neq i \NR
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign[*]
%D a = b \\
%D c = d \\
%D   = e \\
%D   = f \\
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign
%D x = y \\
%D a = b \\
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign[m=3]
%D x = y  x = y  z = t \\
%D a = b  p = q  w = s \\
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign[m=3,distance=0pt]
%D x = y = x = y = z = t \\
%D a = b = p = q = w = s \\
%D \stopalign \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer
%D
%D \startbuffer
%D \placeformula \startformula \startalign[n=5,distance=0pt]
%D x = yy = xx = yy = zz \\
%D a = b  = p  = q  = w  \\
%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] math align

2006-01-16 Thread David Arnold

Hans, Willi, et al,

I was thinking there are pros and cons to each solution, Hans' and  
Willi's. So I tried:


Here are some simple examples of adding fractions already having  
common denominators.


%output=pdf

\input math-ext

\starttext

\placeformula[-]
\startformula
  \startalign[m=2,distance=5em]
\frac5{21}-\frac3{21}=\frac{5-3}{21} 
\frac{2}{x+2}-\frac{x-3}{x+2}=\frac{2-(x-3)}{x+2}\\
=\frac2{21}  =\frac{2-x+3}{x+2}\\
=\frac{5-x}{x+2}
  \stopalign
\stopformula

\startbuffer[1]
\framed[frame=on,width=fit]
   {\startformula
 \eqalign{
   \frac{5}{21}-\frac{3}{21}
   =\frac{5-3}{21}\cr
   =\frac{2}{21}}
   \stopformula}
\stopbuffer

\startbuffer[2]
  \framed[frame=on,width=fit]
  {\startformula
\eqalign{
  \frac2{x+2}-\frac{x-3}{x+2}
  =\frac{2-(x-3)}{x+2}\cr
  =\frac{2-x+3}{x+2}\cr
  =\frac{5-x}{x+2}}
  \stopformula}
\stopbuffer

\startbuffer
  \startcombination[2*1]
{\externalfigure[1][width=0.45\textwidth,type=buffer]}{}
{\externalfigure[2][width=0.45\textwidth,type=buffer]}{}
  \stopcombination
\stopbuffer

\placefigure
[][-]
{none}
{\getbuffer}

\stoptext

As you can see, Hans' solution works perfectly, but note the very  
ugly source code for that section. Willi's source is cleaner, much  
easier to read (especially at a later date when I will have to  
revisit for revisions), but it doesn't work (the output is scaled of  
course).


Any suggestions as to how I can fix Willi's approach so it doesn't  
scale?

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


Re: [NTG-context] math align

2006-01-16 Thread Hans Hagen

David Arnold wrote:


Hans, Willi, et al,

I was thinking there are pros and cons to each solution, Hans' and  
Willi's. So I tried:


Here are some simple examples of adding fractions already having  
common denominators.


%output=pdf

\input math-ext

\starttext

\placeformula[-]
\startformula
  \startalign[m=2,distance=5em]
\frac5{21}-\frac3{21}=\frac{5-3}{21} 
\frac{2}{x+2}-\frac{x-3}{x+2}=\frac{2-(x-3)}{x+2}\\
=\frac2{21}  =\frac{2-x+3}{x+2}\\
=\frac{5-x}{x+2}
  \stopalign
\stopformula

\startbuffer[1]
\framed[frame=on,width=fit]
   {\startformula
 \eqalign{
   \frac{5}{21}-\frac{3}{21}
   =\frac{5-3}{21}\cr
   =\frac{2}{21}}
   \stopformula}
\stopbuffer

\startbuffer[2]
  \framed[frame=on,width=fit]
  {\startformula
\eqalign{
  \frac2{x+2}-\frac{x-3}{x+2}
  =\frac{2-(x-3)}{x+2}\cr
  =\frac{2-x+3}{x+2}\cr
  =\frac{5-x}{x+2}}
  \stopformula}
\stopbuffer

\startbuffer
  \startcombination[2*1]
{\externalfigure[1][width=0.45\textwidth,type=buffer]}{}
{\externalfigure[2][width=0.45\textwidth,type=buffer]}{}
  \stopcombination
\stopbuffer

\placefigure
[][-]
{none}
{\getbuffer}

\stoptext

As you can see, Hans' solution works perfectly, but note the very  
ugly source code for that section. Willi's source is cleaner, much  
easier to read (especially at a later date when I will have to  
revisit for revisions), but it doesn't work (the output is scaled of  
course).


Any suggestions as to how I can fix Willi's approach so it doesn't  
scale?



wikiable:

\definecombination[twoformulas][location=top,align=middle]

\startalignment[middle] \dontleavehmode \startcombination[twoformulas][2*1]
   {\getbuffer[1]} {}
   {\getbuffer[2]} {}
\stopcombination \stopalignment

\def\StartTwo{\startalignment[middle] \dontleavehmode 
\startcombination[twoformulas][2*1]}

\def\StopTwo {\stopcombination \stopalignment}]

\StartTwo
 {\getbuffer[1]} {}
 {\getbuffer[2]} {}
\StopTwo

\StartTwo
 {\getbuffer[1]} {correct}
 {\getbuffer[2]} {wrong}
\StopTwo

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


Re: [NTG-context] math align

2006-01-16 Thread David Arnold

Hans, Taco, et al,

If I do something like this:

\placeformula[-]
\startformula
  \startalign[m=2,distance=7em]
\frac5{21}-\frac3{21}=\frac{5-3}{21} 
\frac{2}{x+2}-\frac{x-3}{x+2}=\frac{2-(x-3)}{x+2}\\
=\frac2{21}  =\frac{2-x+3}{x+2}\\
=\frac{5-x}{x+2}
  \stopalign
\stopformula

Note that distance=7em separates the equations nicely, at least for  
the layout within which this code is contained. It might not look as  
good if the layout changes.


I'm wondering if the current math-ext allows these to be evenly  
distributed across the page without adjusting the distance?

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


Re: [NTG-context] math align

2006-01-16 Thread Hans Hagen

David Arnold wrote:


Hans, Taco, et al,

If I do something like this:

\placeformula[-]
\startformula
  \startalign[m=2,distance=7em]
\frac5{21}-\frac3{21}=\frac{5-3}{21} 
\frac{2}{x+2}-\frac{x-3}{x+2}=\frac{2-(x-3)}{x+2}\\
=\frac2{21}  =\frac{2-x+3}{x+2}\\
=\frac{5-x}{x+2}
  \stopalign
\stopformula

Note that distance=7em separates the equations nicely, at least for  
the layout within which this code is contained. It might not look as  
good if the layout changes.


I'm wondering if the current math-ext allows these to be evenly  
distributed across the page without adjusting the distance?


 \startalign[m=2,distance=7em plus 1 fil]

is a start but i assume that you want it more centered

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


Re: [NTG-context] math align

2006-01-16 Thread Aditya Mahajan

--- On Jan 16, Hans Hagen wrote ---


Taco Hoekwater wrote:




David Arnold wrote:


And where should we put this module temporarily?



Put it in the local directory and do

  \input math-ext

at the top of your test files.


attached is a next version with 'definable' aligns

\definemathalign[myalign][...]

\startmyalign ...


The following works as expected.

\def\startsplit
  {\startalign[*]} % no number by default

\def\stopsplit
  {\doalignNR[+][]\crcr % for a number on last line
   \stopalign}

\placeformula \startformula \startsplit
 a = b \\
   = c
\stopsplit \stopformula

It seems that you are still thinking about [#2] in the definition of 
\definealign. Can it be such that,


\definealign[gather][n=1,align={middle}]
\definealign[lgather][n=1,align={left}]

\startformula \startgather
 a = b + c \\
 e = f
\stopgather \stopformula

results in center aligned equations
  a = b + c
e = f

and

\startformula \startlgather
 a = b + c \\
 e = f
\stoplgather \stopformula

results in left aligned equations

 a = b + c
 e = f

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


[NTG-context] math align

2006-01-15 Thread Hans Hagen

Hi,

Here a first attempts for a flexible alignment mechanism (i depend on 
taco for the fine points of math typesetting since he's typeset \infty 
more complex formulas than i have)


(n=n_of_columns, m=n_of_pairs, so both requested multiple column 
features are supported)


Hans
%D \module
%D   [   file=math-ext,
%Dversion=2006.01.14,
%D  title=\CONTEXT\ Math Macros,
%D   subtitle=Extra Macros,
%D author=Hans Hagen,
%D   date=\currentdate,
%D  copyright=\PRAGMA]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

% some simple math constructs (based on user requests)
%
% preliminary

\unprotect

% adapted stuff

% we need to make this plain code a bit more 'readable'

\def\openup
  {\afterassignment\dopenup\scratchdimen=}

\def\dopenup
  {\advance\lineskip \scratchdimen
   \advance\baselineskip \scratchdimen
   \advance\lineskiplimit\scratchdimen}

\def\jot{.25\bodyfontsize} % plain tex: 3 pt (todo: better name)

[EMAIL PROTECTED]

[EMAIL PROTECTED] % \presetdisplayspacing or so
  [EMAIL PROTECTED]
   \openup\jot
   \mathsurround\zeropoint
   \everycr{\noalign{%
  [EMAIL PROTECTED]
[EMAIL PROTECTED]
\ifdim\prevdepth-\thousandpoint
  \vskip-\lineskiplimit
  \vskip\normallineskiplimit
\fi
  \else
\penalty\interdisplaylinepenalty
  \fi}}}

% context (hooks)

[EMAIL PROTECTED]@y

[EMAIL PROTECTED]@y}

[EMAIL PROTECTED]

% plain tex value: \centering = 0pt plus 1000pt minus 1000pt
% plain tex valye: \jot = 3pt

% n1  needed, strange # interaction (maybe we need a toks in recurse ane no macro)

\def\buildeqalign
  {\scratchtoks\emptytoks
   \dorecurse\@@eqm
 {\ifnum\recurselevel\plusone\appendtoks\tabskip\@@eqdistance\tabskip\zeropoint\to\scratchtoks\fi
  \expanded{\scratchtoks{\the\scratchtoks\the\!!toksa}}%
  \dorecurse{\numexpr\@@eqn-\plusone\relax}
{\expanded{\scratchtoks{\the\scratchtoks\the\!!toksb%
   \expanded{\scratchtoks{\the\scratchtoks\the\!!toksc}}}

\def\forgetalign
  {\tabskip\zeropoint\everycr\emptytoks}

\def\eqalign#1% why no halign here, probably because of displaywidth
  {\!!toksa{\strut\hfil$\displaystyle{##}$}%
   \!!toksb{$\displaystyle{{}##}$\hfil}%
   \!!toksc\emptytoks
   \buildeqalign
   \null\,\vcenter
 {\openup\jot
  \mathsurround\zeropoint
  \expandafter \ialign \expandafter {\the\scratchtoks\crcr#1\crcr}%
   }\,}

\def\eqalignno#1%
  {\!!toksa{\hfil$\forgetalign\displaystyle{##}$\tabskip\zeropoint}%
   \!!toksb{$\forgetalign\displaystyle{{}##}$\tabskip\zeropoint}%
   \!!toksc{\hfil\tabskip\centering\llap{$\forgetalign##$}\tabskip\zeropoint}%
   \buildeqalign
   \presetdisplaymath
   \tabskip\centering
   \halign to \displaywidth \expandafter {\the\scratchtoks\crcr#1\crcr}}

\def\leqalignno#1%
  {\!!toksa{\hfil$\forgetalign\displaystyle{##}$\tabskip\zeropoint}%
   \!!toksb{$\forgetalign\displaystyle{{}##}$\tabskip\zeropoint}%
   \!!toksc{\hfil\tabskip\centering\kern-\displaywidth\rlap{$\forgetalign##$}\tabskip\displaywidth}%
   \buildeqalign
   \presetdisplaymath
   \tabskip\centering
   \halign to \displaywidth \expandafter {\the\scratchtoks\crcr#1\crcr}}

\definesystemvariable{eq}

\def\setupmathalign
  {\dodoubleargument\getparameters[\??eq]}

\setupmathalign
  [\c!n=2,
   \c!m=1,
   \c!distance=1em]

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

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

\def\startalign
  {\dosingleempty\dostartalign}

\long\def\dostartalign[#1]#2\stopalign
  {\doifassignmentelse{#1}{\setupmathalign[#1]}\donothing
   \def\NC{\crcr\def\NC1{1}}%
   \def\EQ{=}
   \def\NR{\dodoubleempty\doalignNR}%
   % amstex compatibility mode: (ugly)
   \def\notag{\def\\{\crcr}}%
   \doifelse{#1}{*}{\def\\{\crcr}}{\def\\{\doalignNR[+][]\crcr}}%
   % end of compatibility mode
   \numberedeqalign{#2}}

%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

Re: [NTG-context] math align

2006-01-15 Thread Aditya Mahajan

--- On Jan 15, Hans Hagen wrote ---


Hi,

Here a first attempts for a flexible alignment mechanism (i depend on taco 
for the fine points of math typesetting since he's typeset \infty more 
complex formulas than i have)


(n=n_of_columns, m=n_of_pairs, so both requested multiple column features are 
supported)


Thanks a lot. I tested it with the little context math documents that 
I have and it works as expected. There is a minor bug. I thought that 
 ... \\ and \NC .. \NC .. \NR were equivalent, with the latter giving 
more configurability with respect to equation numbering and all. 
However, with multiple columns, \NC ... \NC does not work as expected. 
Consider


\usemodule[math-ext]

\starttext

Three columns work correctly if I use \
\startbuffer
\startformula \startalign[n=3]
  a = b = c \\
  d = e = f
\stopalign \stopformula
\stopbuffer

\typebuffer \getbuffer

But they do not work if I use \type{\NC}

\startbuffer
\startformula \startalign[n=3]
  \NC a \NC= b \NC= c \NR
  \NC d \NC= e \NC= f \NR
\stopalign \stopformula
\stopbuffer

\typebuffer \getbuffer

\stoptext


This takes care of most of the alignment and equation numbering in 
Context. With this, one should also be able to define \startstop split 
such that


\placeformula \startformula \startsplit
 a = b \\
   = c
\stopsplit \stopformula

comes out as

 a = b
   = c   (1)

But, my attempts to define such a startstop did not work. Can you 
suggest something?


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] math align

2006-01-15 Thread David Arnold

Hans et al,

I tried saving this file as ~/tmp/math-ext.tex and compiling with:

texexec --module math-ext.tex

But I got:

[MP texexec-mpgraph.4000] [1.1] [2.1] .
(/usr/local/teTeX/share/texmf.local/tex/context/base/verb-tex.tex
loading : Context Support Macros / Pretty TEX Verbatim
) . . . . . . . . .
Overfull \hbox (98.21335pt too wide) in paragraph at lines 72--72
[][][] [][] [][] [][] [][] [][]\*10pf* {[][]\ifnum\recurselevel[] 
[][][]\pl
usone\appendtoks\tabskip\@@eqdistance[][][][]\tabskip\zeropoint\to 
\scratchtoks

\fi[]
. . . [3.1] .
Overfull \hbox (87.71338pt too wide) in paragraph at lines 112--112
[][][] [][] [][] [][]\*10pf* \!!toksc[][]{[][]\hfil\tabskip 
\centering[][][
][]\kern[][]-[][]\displaywidth\rlap[][]{[][]$[][]\forgetalign[][]##[] 
[]$[][]}[]

[]\tabskip\displaywidth[][]}[][]%[]
. . . . . . . texexec-texexec.tmp (./texexec-texexec.tmp [4.2])
texexec-texexec.tmp (./texexec-texexec.tmp
! Undefined control sequence.
recently read \startalign

l.1 \placeformula \startformula \startalign

?

Am I doing something wrong?


On Jan 15, 2006, at 2:37 PM, Hans Hagen wrote:


Hi,

Here a first attempts for a flexible alignment mechanism (i depend  
on taco for the fine points of math typesetting since he's typeset  
\infty more complex formulas than i have)


(n=n_of_columns, m=n_of_pairs, so both requested multiple column  
features are supported)


Hans
%D \module
%D   [   file=math-ext,
%Dversion=2006.01.14,
%D  title=\CONTEXT\ Math Macros,
%D   subtitle=Extra Macros,
%D author=Hans Hagen,
%D   date=\currentdate,
%D  copyright=\PRAGMA]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

% some simple math constructs (based on user requests)
%
% preliminary

\unprotect

% adapted stuff

% we need to make this plain code a bit more 'readable'

\def\openup
  {\afterassignment\dopenup\scratchdimen=}

\def\dopenup
  {\advance\lineskip \scratchdimen
   \advance\baselineskip \scratchdimen
   \advance\lineskiplimit\scratchdimen}

\def\jot{.25\bodyfontsize} % plain tex: 3 pt (todo: better name)

[EMAIL PROTECTED]

[EMAIL PROTECTED] % \presetdisplayspacing or so
  [EMAIL PROTECTED]
   \openup\jot
   \mathsurround\zeropoint
   \everycr{\noalign{%
  [EMAIL PROTECTED]
[EMAIL PROTECTED]
\ifdim\prevdepth-\thousandpoint
  \vskip-\lineskiplimit
  \vskip\normallineskiplimit
\fi
  \else
\penalty\interdisplaylinepenalty
  \fi}}}

% context (hooks)

[EMAIL PROTECTED]@y

[EMAIL PROTECTED]@y}

[EMAIL PROTECTED]

% plain tex value: \centering = 0pt plus 1000pt minus 1000pt
% plain tex valye: \jot = 3pt

% n1  needed, strange # interaction (maybe we need a toks in  
recurse ane no macro)


\def\buildeqalign
  {\scratchtoks\emptytoks
   \dorecurse\@@eqm
 {\ifnum\recurselevel\plusone\appendtoks\tabskip\@@eqdistance 
\tabskip\zeropoint\to\scratchtoks\fi

  \expanded{\scratchtoks{\the\scratchtoks\the\!!toksa}}%
  \dorecurse{\numexpr\@@eqn-\plusone\relax}
{\expanded{\scratchtoks{\the\scratchtoks\the\!!toksb%
   \expanded{\scratchtoks{\the\scratchtoks\the\!!toksc}}}

\def\forgetalign
  {\tabskip\zeropoint\everycr\emptytoks}

\def\eqalign#1% why no halign here, probably because of displaywidth
  {\!!toksa{\strut\hfil$\displaystyle{##}$}%
   \!!toksb{$\displaystyle{{}##}$\hfil}%
   \!!toksc\emptytoks
   \buildeqalign
   \null\,\vcenter
 {\openup\jot
  \mathsurround\zeropoint
  \expandafter \ialign \expandafter {\the\scratchtoks\crcr#1 
\crcr}%

   }\,}

\def\eqalignno#1%
  {\!!toksa{\hfil$\forgetalign\displaystyle{##}$\tabskip\zeropoint}%
   \!!toksb{$\forgetalign\displaystyle{{}##}$\tabskip\zeropoint}%
   \!!toksc{\hfil\tabskip\centering\llap{$\forgetalign##$}\tabskip 
\zeropoint}%

   \buildeqalign
   \presetdisplaymath
   \tabskip\centering
   \halign to \displaywidth \expandafter {\the\scratchtoks\crcr#1 
\crcr}}


\def\leqalignno#1%
  {\!!toksa{\hfil$\forgetalign\displaystyle{##}$\tabskip\zeropoint}%
   \!!toksb{$\forgetalign\displaystyle{{}##}$\tabskip\zeropoint}%
   \!!toksc{\hfil\tabskip\centering\kern-\displaywidth\rlap{$ 
\forgetalign##$}\tabskip\displaywidth}%

   \buildeqalign
   \presetdisplaymath
   \tabskip\centering
   \halign to \displaywidth \expandafter {\the\scratchtoks\crcr#1 
\crcr}}


\definesystemvariable{eq}

\def\setupmathalign
  {\dodoubleargument\getparameters[\??eq]}

\setupmathalign
  [\c!n=2,
   \c!m=1,
   \c!distance=1em]

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

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

\def\startalign
  {\dosingleempty\dostartalign}

\long\def\dostartalign[#1]#2\stopalign
  {\doifassignmentelse{#1}{\setupmathalign[#1]}\donothing
   \def\NC{\crcr\def\NC1{1}}%
   \def\EQ{=}
   \def\NR

Re: [NTG-context] math align

2006-01-15 Thread David Arnold

And where should we put this module temporarily?


On Jan 15, 2006, at 2:37 PM, Hans Hagen wrote:


Hi,

Here a first attempts for a flexible alignment mechanism (i depend  
on taco for the fine points of math typesetting since he's typeset  
\infty more complex formulas than i have)


(n=n_of_columns, m=n_of_pairs, so both requested multiple column  
features are supported)


Hans

%D \module
%D   [   file=math-ext,
%Dversion=2006.01.14,
%D  title=\CONTEXT\ Math Macros,
%D   subtitle=Extra Macros,
%D author=Hans Hagen,
%D   date=\currentdate,
%D  copyright=\PRAGMA]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

% some simple math constructs (based on user requests)
%
% preliminary

\unprotect

% adapted stuff

% we need to make this plain code a bit more 'readable'

\def\openup
  {\afterassignment\dopenup\scratchdimen=}

\def\dopenup
  {\advance\lineskip \scratchdimen
   \advance\baselineskip \scratchdimen
   \advance\lineskiplimit\scratchdimen}

\def\jot{.25\bodyfontsize} % plain tex: 3 pt (todo: better name)

[EMAIL PROTECTED]

[EMAIL PROTECTED] % \presetdisplayspacing or so
  [EMAIL PROTECTED]
   \openup\jot
   \mathsurround\zeropoint
   \everycr{\noalign{%
  [EMAIL PROTECTED]
[EMAIL PROTECTED]
\ifdim\prevdepth-\thousandpoint
  \vskip-\lineskiplimit
  \vskip\normallineskiplimit
\fi
  \else
\penalty\interdisplaylinepenalty
  \fi}}}

% context (hooks)

[EMAIL PROTECTED]@y

[EMAIL PROTECTED]@y}

[EMAIL PROTECTED]

% plain tex value: \centering = 0pt plus 1000pt minus 1000pt
% plain tex valye: \jot = 3pt

% n1  needed, strange # interaction (maybe we need a toks in  
recurse ane no macro)


\def\buildeqalign
  {\scratchtoks\emptytoks
   \dorecurse\@@eqm
 {\ifnum\recurselevel\plusone\appendtoks\tabskip\@@eqdistance 
\tabskip\zeropoint\to\scratchtoks\fi

  \expanded{\scratchtoks{\the\scratchtoks\the\!!toksa}}%
  \dorecurse{\numexpr\@@eqn-\plusone\relax}
{\expanded{\scratchtoks{\the\scratchtoks\the\!!toksb%
   \expanded{\scratchtoks{\the\scratchtoks\the\!!toksc}}}

\def\forgetalign
  {\tabskip\zeropoint\everycr\emptytoks}

\def\eqalign#1% why no halign here, probably because of displaywidth
  {\!!toksa{\strut\hfil$\displaystyle{##}$}%
   \!!toksb{$\displaystyle{{}##}$\hfil}%
   \!!toksc\emptytoks
   \buildeqalign
   \null\,\vcenter
 {\openup\jot
  \mathsurround\zeropoint
  \expandafter \ialign \expandafter {\the\scratchtoks\crcr#1 
\crcr}%

   }\,}

\def\eqalignno#1%
  {\!!toksa{\hfil$\forgetalign\displaystyle{##}$\tabskip\zeropoint}%
   \!!toksb{$\forgetalign\displaystyle{{}##}$\tabskip\zeropoint}%
   \!!toksc{\hfil\tabskip\centering\llap{$\forgetalign##$}\tabskip 
\zeropoint}%

   \buildeqalign
   \presetdisplaymath
   \tabskip\centering
   \halign to \displaywidth \expandafter {\the\scratchtoks\crcr#1 
\crcr}}


\def\leqalignno#1%
  {\!!toksa{\hfil$\forgetalign\displaystyle{##}$\tabskip\zeropoint}%
   \!!toksb{$\forgetalign\displaystyle{{}##}$\tabskip\zeropoint}%
   \!!toksc{\hfil\tabskip\centering\kern-\displaywidth\rlap{$ 
\forgetalign##$}\tabskip\displaywidth}%

   \buildeqalign
   \presetdisplaymath
   \tabskip\centering
   \halign to \displaywidth \expandafter {\the\scratchtoks\crcr#1 
\crcr}}


\definesystemvariable{eq}

\def\setupmathalign
  {\dodoubleargument\getparameters[\??eq]}

\setupmathalign
  [\c!n=2,
   \c!m=1,
   \c!distance=1em]

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

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

\def\startalign
  {\dosingleempty\dostartalign}

\long\def\dostartalign[#1]#2\stopalign
  {\doifassignmentelse{#1}{\setupmathalign[#1]}\donothing
   \def\NC{\crcr\def\NC1{1}}%
   \def\EQ{=}
   \def\NR{\dodoubleempty\doalignNR}%
   % amstex compatibility mode: (ugly)
   \def\notag{\def\\{\crcr}}%
   \doifelse{#1}{*}{\def\\{\crcr}}{\def\\{\doalignNR[+][]\crcr}}%
   % end of compatibility mode
   \numberedeqalign{#2}}

%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

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] Keep framed on the baseline

2006-01-14 Thread Johan Sandblom
Outside math I think the solution is  \inframed, but I don't know if
that works here.

Johan

2006/1/14, David Arnold [EMAIL PROTECTED]:
 All,

 I have:

 \placeformula[-]
 \startformula
\eqalign{
\text{Divisors of 12}: \framed{1},\ \framed{2},\ \framed{3},\ 4,\
 \framed{6},\ 12\cr
\text{Divisors of 18}: \framed{1},\ \framed{2},\ \framed{3},\
 \framed{6},\ 9,\ 18}
 \stopformula

 But I'd like to keep the numbers on the same baseline and let the
 frame dip below the baseline.
 ___
 ntg-context mailing list
 ntg-context@ntg.nl
 http://www.ntg.nl/mailman/listinfo/ntg-context



--
Johan Sandblom  N8, MRC, Karolinska sjh
t +46851776108  17176 Stockholm
m +46735521477  Sweden
What is wanted is not the will to believe, but the
will to find out, which is the exact opposite
- Bertrand Russell
___
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] Keep framed on the baseline

2006-01-14 Thread Mojca Miklavec
David Arnold wrote:
 All,

 I have:

 \placeformula[-]
 \startformula
\eqalign{
\text{Divisors of 12}: \framed{1},\ \framed{2},\ \framed{3},\ 4,\
 \framed{6},\ 12\cr
\text{Divisors of 18}: \framed{1},\ \framed{2},\ \framed{3},\
 \framed{6},\ 9,\ 18}
 \stopformula

 But I'd like to keep the numbers on the same baseline and let the
 frame dip below the baseline.

What about \mframed? (Probably already evident from the other mail.)

Mojca
___
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

[NTG-context] Keep framed on the baseline

2006-01-13 Thread David Arnold

All,

I have:

\placeformula[-]
\startformula
  \eqalign{
  \text{Divisors of 12}: \framed{1},\ \framed{2},\ \framed{3},\ 4,\  
\framed{6},\ 12\cr
  \text{Divisors of 18}: \framed{1},\ \framed{2},\ \framed{3},\  
\framed{6},\ 9,\ 18}

\stopformula

But I'd like to keep the numbers on the same baseline and let the  
frame dip below the baseline.

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


[NTG-context] Canceling common primes with strikeout

2006-01-13 Thread David Arnold

All,

Anyone have a nice technique to strike out the common primes using  
the color red?


\placeformula[-]
\startformula
  \frac{12}{18}=\frac{2\cdot2\cdot3}{2\cdot3\cdot3}=\frac23
\stopformula

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


[NTG-context] Alignments side by side

2006-01-13 Thread David Arnold

All,

I am wondering how I can put two alignment environments side-by-side?

For test purposes, it's OK to use this twice.

\placeformula[-]
\startformula
\eqalign{
  f(x)=x^2-2x-3\cr
  f(x)=x^02x+1-1-3\cr
  f(x)=(x-1)^2-4}
\stopformula

I'd like to get two of these side-by-side, or something that will  
typeset a similar result side-by-side.


Thanks.
___
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


[NTG-context] Re: Some $\mframed{math}$ questions

2005-12-03 Thread Aditya Mahajan

--- On Dec 2, Mojca Miklavec wrote ---


1. What's the best way to frame a formula like here:

\placeformula
\startformula
\mframed{x^2+y^2=z^2}
\stopformula

The problem is that:
- formula number is shifted downwards in comparison to the formula
without a number
- I don't know how to do the settings (frame color, frame offset)
globally. There's no \setupmframed[...] command. It's probably
possible to use a sort of
\setupframed[whatever_setting_influencing_only_mframed],
but I don't know how.


Sorry, no idea on how to do this.



2. What's the general strategy when doing evel stuff with formula
numbering? I would like to use \eqalign and then number formulas like
on the following example:

z^2=x^2+y^2(1)
  =(x'-x_0)^2+(y'-y_0)^2 % no number
  =R^2\cos^2(\phi)(2)



The following works.  I still find the amsmath way of doing this much 
easier, but equation numbering has not been ported to amsl module


\starttext
\placeformula
\startformula
\eqalignno{
z^2 =x^2+y^2  \formulanumber\cr
=(x'-x_0)^2+(y'-y_0)^2  \cr% no number
=R^2\cos^2(\phi) \formulanumber\cr
}
\stopformula

\stoptext




Can I somehow number the formulas (1), (2), (3.a), (3.b), (3.c), (4),
(5.1), (5.2)? I would like to manually provide where to start and stop
numbering with x.a or x.1, x.2.


Have a look at the wiki http://wiki.contextgarden.net/Math for the manual 
way to number each subformula. I think one can define a 
\start(stop)subformula[format = ??] to put a \place(sub)formula 
automatically. But I do not know how to define such an environment 
properly.




3. How can I put more than one equation in a row and number all of
them (as if they were placed in three columns)?


One way to cheat can be to start a three column mode

\starttext

\startcolumns[n=3,tolerance=verytolerant]
\placeformula
\startformula
 E = mc^2
\stopformula
\column
\placeformula
\startformula
 E = mc^2
\stopformula
\column
\placeformula
\startformula
 E = mc^2
\stopformula
\stopcolumns
\stoptext

Again, one could define a start-stop environment for this.


4. How can I move the formula number one row lower in case that the
formula is too long and if it would overlap with the formula number
otherwise?


Not sure what you mean here. Context (rather tex, I think) does this by 
default


\starttext

\placeformula
\startformula
a =  ddd ccc 
ee f ggg

\stopformula
\stoptext

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


[NTG-context] Some $\mframed{math}$ questions

2005-12-02 Thread Mojca Miklavec
Hello,

I would like to ask a couple of questions about frames and numbers in
math formulas.

1. What's the best way to frame a formula like here:

\placeformula
\startformula
\mframed{x^2+y^2=z^2}
\stopformula

The problem is that:
- formula number is shifted downwards in comparison to the formula
without a number
- I don't know how to do the settings (frame color, frame offset)
globally. There's no \setupmframed[...] command. It's probably
possible to use a sort of
\setupframed[whatever_setting_influencing_only_mframed],
but I don't know how.

2. What's the general strategy when doing evel stuff with formula
numbering? I would like to use \eqalign and then number formulas like
on the following example:

z^2=x^2+y^2(1)
   =(x'-x_0)^2+(y'-y_0)^2 % no number
   =R^2\cos^2(\phi)(2)

Can I somehow number the formulas (1), (2), (3.a), (3.b), (3.c), (4),
(5.1), (5.2)? I would like to manually provide where to start and stop
numbering with x.a or x.1, x.2.

3. How can I put more than one equation in a row and number all of
them (as if they were placed in three columns)?

4. How can I move the formula number one row lower in case that the
formula is too long and if it would overlap with the formula number
otherwise?

Thank you very much for any help,
Mojca
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


<    1   2   3   4   5   6   7   >