Re: [NTG-context] Math align not working
Hi Aditya, thank you very much, now I need to specify the alignment only for one "column" and it gets applied for all of them. However, there is still the problem with the standard setting of the alignment. For example, \starttext \startformula \startalign[m=2, align={right,left}] \NC ab \NC = cd \NC efgh \NC = ijkl \NR \NC efgh \NC = ijkl \NC ab \NC = cd \NR \stopalign \stopformula \stoptext works now. But the setting [align={right,left}] should be the standard when n is not set. So (also according to your documentation) the following code \starttext \startformula \startalign[m=2] \NC ab \NC = cd \NC efgh \NC = ijkl \NR \NC efgh \NC = ijkl \NC ab \NC = cd \NR \stopalign \stopformula \stoptext should work, but it doesn't. The first column is right-oriented, the third (i.e. the first in the right "column") not. Could you please fix that? Thanks you very much, Johann On Sat, 2021-01-02 at 02:15 -0500, Aditya Mahajan wrote: > On Fri, 1 Jan 2021, Hans Hagen wrote: > > > On 1/1/2021 8:21 AM, Aditya Mahajan wrote: > > > \startformula \startalign[m=2,distance=8em,n=5, > > > align={right,middle,middle,middle,left, right,middle,middle,middle,left}] > > > \NC 0 \NC < \NC 2x + 5y \NC < \NC 10 > > > \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR > > > \NC 3 \NC < \NC 2y + 3z \NC < \NC 15 > > > \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR > > > \stopalign \stopformula > > > > > > \stoptext > > > > > > Aditya: > > > > can you check this? > > > > \def\math_build_eqalign > > {\scratchtoks\emptytoks > > \d_math_eqalign_distance\mathalignmentparameter\c!distance\relax > > \scratchcounterone\mathalignmentparameter\c!m > > \scratchcountertwo\mathalignmentparameter\c!n > > \etoksapp\scratchtoks{\the\t_math_align_a}% > > \scratchcounter\plusone > > \dorecurse{\numexpr\scratchcounterone*\scratchcountertwo-\plusone\relax} > > {\ifnum\scratchcounter=\scratchcountertwo > > \scratchcounter\plusone > > \etoksapp\scratchtoks{\math_eqalign_distance}% > > \etoksapp\scratchtoks{\global\c_math_eqalign_column\zerocount}% > > \else > > \advance\scratchcounter\plusone > > \fi > > \etoksapp\scratchtoks{\the\t_math_align_b}}% > > \etoksapp\scratchtoks{\the\t_math_align_c}} > > > > > > I added: > > > > \etoksapp\scratchtoks{\global\c_math_eqalign_column\zerocount}% > > > > This works nicely. Thanks. > > I'll also go back to the mathalign document and try to update it for the > current LMTX to catch other regressions which might have happened. > > Aditya > __ > _ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > __ > _ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align not working
On Fri, 1 Jan 2021, Hans Hagen wrote: > On 1/1/2021 8:21 AM, Aditya Mahajan wrote: > > \startformula \startalign[m=2,distance=8em,n=5, > > align={right,middle,middle,middle,left, right,middle,middle,middle,left}] > > \NC 0 \NC < \NC 2x + 5y \NC < \NC 10 > > \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR > > \NC 3 \NC < \NC 2y + 3z \NC < \NC 15 > > \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR > > \stopalign \stopformula > > > > \stoptext > > > Aditya: > > can you check this? > > \def\math_build_eqalign > {\scratchtoks\emptytoks >\d_math_eqalign_distance\mathalignmentparameter\c!distance\relax >\scratchcounterone\mathalignmentparameter\c!m >\scratchcountertwo\mathalignmentparameter\c!n >\etoksapp\scratchtoks{\the\t_math_align_a}% >\scratchcounter\plusone >\dorecurse{\numexpr\scratchcounterone*\scratchcountertwo-\plusone\relax} > {\ifnum\scratchcounter=\scratchcountertwo > \scratchcounter\plusone > \etoksapp\scratchtoks{\math_eqalign_distance}% > \etoksapp\scratchtoks{\global\c_math_eqalign_column\zerocount}% > \else > \advance\scratchcounter\plusone > \fi > \etoksapp\scratchtoks{\the\t_math_align_b}}% >\etoksapp\scratchtoks{\the\t_math_align_c}} > > > I added: > > \etoksapp\scratchtoks{\global\c_math_eqalign_column\zerocount}% > This works nicely. Thanks. I'll also go back to the mathalign document and try to update it for the current LMTX to catch other regressions which might have happened. Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align not working
On 1/1/2021 8:21 AM, Aditya Mahajan wrote: \startformula \startalign[m=2,distance=8em,n=5, align={right,middle,middle,middle,left, right,middle,middle,middle,left}] \NC 0 \NC < \NC 2x + 5y \NC < \NC 10 \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR \NC 3 \NC < \NC 2y + 3z \NC < \NC 15 \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR \stopalign \stopformula \stoptext Aditya: can you check this? \def\math_build_eqalign {\scratchtoks\emptytoks \d_math_eqalign_distance\mathalignmentparameter\c!distance\relax \scratchcounterone\mathalignmentparameter\c!m \scratchcountertwo\mathalignmentparameter\c!n \etoksapp\scratchtoks{\the\t_math_align_a}% \scratchcounter\plusone \dorecurse{\numexpr\scratchcounterone*\scratchcountertwo-\plusone\relax} {\ifnum\scratchcounter=\scratchcountertwo \scratchcounter\plusone \etoksapp\scratchtoks{\math_eqalign_distance}% \etoksapp\scratchtoks{\global\c_math_eqalign_column\zerocount}% \else \advance\scratchcounter\plusone \fi \etoksapp\scratchtoks{\the\t_math_align_b}}% \etoksapp\scratchtoks{\the\t_math_align_c}} I added: \etoksapp\scratchtoks{\global\c_math_eqalign_column\zerocount}% Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align not working
On Wed, 30 Dec 2020, Johann Birnick wrote: > Okay, but I think it's a bug, because as you see in the linked pdf it worked > the > simple way some years ago... Yes, something has changed internally. Earlier, if you used: \startalign[align={right,left}, n=4] ... \stopalign then the alignment was right left right left, i.e., the alignment cycled. Now, the alignment is right left left left, i.e., unspecified alignments default to left. So, in your example, each column in the second "block" is left aligned. To change that, you can use: \starttext \startformula \startalign[m=2,distance=8em,n=5, align={right,middle,middle,middle,left, right,middle,middle,middle,left}] \NC 0 \NC < \NC 2x + 5y \NC < \NC 10 \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR \NC 3 \NC < \NC 2y + 3z \NC < \NC 15 \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR \stopalign \stopformula \stoptext But this is ugly. I haven't looked at the math alignment code in a while, but I'll check with Hans if the old behavior can be reintroduced. Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align not working
The developers might tune in; perhaps it was changed. > On 30 Dec 2020, at 15:01, Johann Birnick wrote: > > Okay, but I think it's a bug, because as you see in the linked pdf it worked > the > simple way some years ago... ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align not working
Okay, but I think it's a bug, because as you see in the linked pdf it worked the simple way some years ago... On Wed, 2020-12-30 at 14:38 +0100, Hans Åberg wrote: > One has to indicate the align pattern for all columns, otherwise it defaults > to left, it seems: > > \starttext > > \startformula \startalign[m=2,distance=8em,n=5, > align={right,middle,middle,middle,left,right,middle,middle,middle,left}] > \NC 0 \NC < \NC 2x + 5y \NC < \NC 10 > \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR > \NC 3 \NC < \NC 2y + 3z \NC < \NC 15 > \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR > \stopalign \stopformula > > \stoptext > > > > On 29 Dec 2020, at 14:36, Johann Birnick wrote: > > > > Hi there, > > > > I noticed that Math align is not working properly. In particular I mean the > > alignment. For example, the following code > > > > > > \starttext > > > > > > \startformula \startalign[m=2,distance=8em,n=5, > > align={right,middle,middle,middle,left}] > > \NC 0 \NC < \NC 2x + 5y \NC < \NC 10 > > \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR > > \NC 3 \NC < \NC 2y + 3z \NC < \NC 15 > > \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR > > \stopalign \stopformula > > > > \stoptext > > > > > > is copied from https://dl.contextgarden.net/myway/mathalign.pdf but doesn't > > produce the intended result. > > > > What's wrong? > > > > Best regards, > > Johann > > > > > > ___ > > If your question is of interest to others as well, please add an entry to > > the Wiki! > > > > maillist : ntg-context@ntg.nl / > > http://www.ntg.nl/mailman/listinfo/ntg-context > > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > > archive : https://bitbucket.org/phg/context-mirror/commits/ > > wiki : http://contextgarden.net > > > > ___ > > __ > _ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > __ > _ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align not working
One has to indicate the align pattern for all columns, otherwise it defaults to left, it seems: \starttext \startformula \startalign[m=2,distance=8em,n=5, align={right,middle,middle,middle,left,right,middle,middle,middle,left}] \NC 0 \NC < \NC 2x + 5y \NC < \NC 10 \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR \NC 3 \NC < \NC 2y + 3z \NC < \NC 15 \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR \stopalign \stopformula \stoptext > On 29 Dec 2020, at 14:36, Johann Birnick wrote: > > Hi there, > > I noticed that Math align is not working properly. In particular I mean the > alignment. For example, the following code > > > \starttext > > > \startformula \startalign[m=2,distance=8em,n=5, > align={right,middle,middle,middle,left}] > \NC 0 \NC < \NC 2x + 5y \NC < \NC 10 > \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR > \NC 3 \NC < \NC 2y + 3z \NC < \NC 15 > \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR > \stopalign \stopformula > > \stoptext > > > is copied from https://dl.contextgarden.net/myway/mathalign.pdf but doesn't > produce the intended result. > > What's wrong? > > Best regards, > Johann > > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align not working
Hi Alain, I don't know what you mean by "you have two position in the second and one in the first" ? The 4 is not aligned correctly. Please see https://dl.contextgarden.net/myway/mathalign.pdf where the example comes from. The output looks different. Best regards, Johann On Wed, 2020-12-30 at 11:26 +0100, Alain Delmotte wrote: > Hi Johann, > The 4 is right aligned, but for this column you have two position in the > second and one in the first. > You could try ~4 and it will align with 10. > Best regards, > Alain > Le 29/12/2020 à 22:27, Johann Birnick a écrit : > Hi Otared, > > I'm using the same version. The problem is the "right"-alignment. See the 4 on > the right side. It should be right-aligned. I attached my pdf. > > Best regards, > Johann > > > On Tue, 2020-12-29 at 21:37 +0100, Otared Kavian wrote: > > > Hi Johann, > > > > The example you sent works fine here with LMTX version 2020.12.28 01:41. > > Which version of ConTeXt are you using ? > > > > Best regards: Otared > > > > > > > On 29 Dec 2020, at 14:36, Johann Birnick > > > wrote: > > > > > > Hi there, > > > > > > I noticed that Math align is not working properly. In particular I mean > > > the > > > alignment. For example, the following code > > > > > > > > > \starttext > > > > > > > > > > > > \startformula \startalign[m=2,distance=8em,n=5, > > > align={right,middle,middle,middle,left}] > > > \NC 0 \NC < \NC 2x + 5y \NC < \NC 10 > > > \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR > > > \NC 3 \NC < \NC 2y + 3z \NC < \NC 15 > > > \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR > > > \stopalign \stopformula > > > > > > \stoptext > > > > > > > > > is copied from https://dl.contextgarden.net/myway/mathalign.pdf but > > > doesn't > > > produce the intended result. > > > > > > What's wrong? > > > > > > Best regards, > > > Johann > > > > > > __ > > > __ > > > ___ > > > If your question is of interest to others as well, please add an entry to > > > the Wiki! > > > > > > maillist : ntg-context@ntg.nl / > > > http://www.ntg.nl/mailman/listinfo/ntg-context > > > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > > > archive : https://bitbucket.org/phg/context-mirror/commits/ > > > wiki : http://contextgarden.net > > > __ > > > __ > > > ___ > > > > __ > > _ > > If your question is of interest to others as well, please add an entry to > > the > > Wiki! > > > > maillist : ntg-context@ntg.nl / > > http://www.ntg.nl/mailman/listinfo/ntg-context > > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > > archive : https://bitbucket.org/phg/context-mirror/commits/ > > wiki : http://contextgarden.net > > > > __ > > _ > > > > > > > > ___ > > If your question is of interest to others as well, please add an entry to > > the Wiki! > > > > maillist : ntg-context@ntg.nl / > > http://www.ntg.nl/mailman/listinfo/ntg-context > > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > > archive : https://bitbucket.org/phg/context-mirror/commits/ > > wiki : http://contextgarden.net > > > > ___ > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align not working
Hi Johann, The 4 is right aligned, but for this column you have two position in the second and one in the first. You could try ~4 and it will align with 10. Best regards, Alain Le 29/12/2020 à 22:27, Johann Birnick a écrit : Hi Otared, I'm using the same version. The problem is the "right"-alignment. See the 4 on the right side. It should be right-aligned. I attached my pdf. Best regards, Johann On Tue, 2020-12-29 at 21:37 +0100, Otared Kavian wrote: Hi Johann, The example you sent works fine here with LMTX version 2020.12.28 01:41. Which version of ConTeXt are you using ? Best regards: Otared On 29 Dec 2020, at 14:36, Johann Birnick wrote: Hi there, I noticed that Math align is not working properly. In particular I mean the alignment. For example, the following code \starttext \startformula \startalign[m=2,distance=8em,n=5, align={right,middle,middle,middle,left}] \NC 0 \NC < \NC 2x + 5y \NC < \NC 10 \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR \NC 3 \NC < \NC 2y + 3z \NC < \NC 15 \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR \stopalign \stopformula \stoptext is copied from https://dl.contextgarden.net/myway/mathalign.pdf but doesn't produce the intended result. What's wrong? Best regards, Johann ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___ __ _ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net __ _ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align not working
Hi Otared, I'm using the same version. The problem is the "right"-alignment. See the 4 on the right side. It should be right-aligned. I attached my pdf. Best regards, Johann On Tue, 2020-12-29 at 21:37 +0100, Otared Kavian wrote: > Hi Johann, > > The example you sent works fine here with LMTX version 2020.12.28 01:41. > Which version of ConTeXt are you using ? > > Best regards: Otared > > > On 29 Dec 2020, at 14:36, Johann Birnick wrote: > > > > Hi there, > > > > I noticed that Math align is not working properly. In particular I mean the > > alignment. For example, the following code > > > > > > \starttext > > > > > > \startformula \startalign[m=2,distance=8em,n=5, > > align={right,middle,middle,middle,left}] > > \NC 0 \NC < \NC 2x + 5y \NC < \NC 10 > > \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR > > \NC 3 \NC < \NC 2y + 3z \NC < \NC 15 > > \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR > > \stopalign \stopformula > > > > \stoptext > > > > > > is copied from https://dl.contextgarden.net/myway/mathalign.pdf but doesn't > > produce the intended result. > > > > What's wrong? > > > > Best regards, > > Johann > > > > > > ___ > > If your question is of interest to others as well, please add an entry to > > the Wiki! > > > > maillist : ntg-context@ntg.nl / > > http://www.ntg.nl/mailman/listinfo/ntg-context > > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > > archive : https://bitbucket.org/phg/context-mirror/commits/ > > wiki : http://contextgarden.net > > > > ___ > > __ > _ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > __ > _ test.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align not working
Hi Johann, The example you sent works fine here with LMTX version 2020.12.28 01:41. Which version of ConTeXt are you using ? Best regards: Otared > On 29 Dec 2020, at 14:36, Johann Birnick wrote: > > Hi there, > > I noticed that Math align is not working properly. In particular I mean the > alignment. For example, the following code > > > \starttext > > > \startformula \startalign[m=2,distance=8em,n=5, > align={right,middle,middle,middle,left}] > \NC 0 \NC < \NC 2x + 5y \NC < \NC 10 > \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR > \NC 3 \NC < \NC 2y + 3z \NC < \NC 15 > \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR > \stopalign \stopformula > > \stoptext > > > is copied from https://dl.contextgarden.net/myway/mathalign.pdf but doesn't > produce the intended result. > > What's wrong? > > Best regards, > Johann > > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] Math align not working
Hi there, I noticed that Math align is not working properly. In particular I mean the alignment. For example, the following code \starttext \startformula \startalign[m=2,distance=8em,n=5, align={right,middle,middle,middle,left}] \NC 0 \NC < \NC 2x + 5y \NC < \NC 10 \NC 4 \NC < \NC 3x + y \NC < \NC 9 \NR \NC 3 \NC < \NC 2y + 3z \NC < \NC 15 \NC 10\NC < \NC 8y + 5z \NC < \NC 20 \NR \stopalign \stopformula \stoptext is copied from https://dl.contextgarden.net/myway/mathalign.pdf but doesn't produce the intended result. What's wrong? Best regards, Johann ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] math align broken
Dear Hans, I reinstall a new beta and test the previous file. (LuaMetaTeX: version 2.03.4, ConTeXt version: 2019.12.16 18:54, format: 2019.12.17) The problem is gone! The space in the aligned display math mode is normal. Thank you so much. Best regards, Dalyoung ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] math align broken
Dear Hans, Here is a small example which shows a strange spacing in the aligned display math mode. The same code is OK in both inline mode and just display mode, but it is not good in aligned mode. I hope that it helps your fix . Thank you. Best regards, Dalyoung % running luametatex version 2.03.3, ConTeXt ver: 2019.12.12, format: 2019.12.14 % \starttext \startitemize \head inline formula: $1001 \times 23 \equiv 1 \quad \pmod {3837}$ \head display mode \startformula 1001 \times 23 \equiv 1 \quad \pmod {3837} \stopformula \head aligned display mode \startformula\startalign[m=2] \NC 2^7 \equiv \qquad \NC \pmod {341}, \NC 14^7 \equiv \qquad \NC \pmod {341}, \NR \NC 11^7 \equiv \qquad \NC \pmod {341}, \NC 3^7 \equiv \qquad \NC \pmod {341}, \NR \stopalign\stopformula \startformula\startalign[n=3] \NC 1001 \times 23 \NC \equiv 1 \quad \NC\pmod {3837} \NR \NC \qquad \times 23 \NC \equiv \qquad \NC\pmod {3837} \NR \stopalign\stopformula \stopitemize \stoptext___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] math align broken
On Mon, Dec 16, 2019 at 3:08 PM Hans Hagen wrote: > On 12/16/2019 2:17 AM, Jeong Dal wrote: > > Dear Mikael, > > > > I also confirm your problem. > > I am using > > "ConTeXt ver: 2019.12.06 21:40 MKIV beta fmt: 2019.12.9 int: > english/english” > > > > However, if you change “\Bigl(“ to “\left(“, then the space between left > parenthesis and text become narrower. > > > > I hope that it will be fixed soon. > > in next beta (something with spacing in math) > > Hans > > Thanks for the quick fix, Hans! I just updated and compiled my lecture notes and can confirm that it looks fine again! /Mikael ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] math align broken
On 12/16/2019 2:17 AM, Jeong Dal wrote: Dear Mikael, I also confirm your problem. I am using "ConTeXt ver: 2019.12.06 21:40 MKIV beta fmt: 2019.12.9 int: english/english” However, if you change “\Bigl(“ to “\left(“, then the space between left parenthesis and text become narrower. I hope that it will be fixed soon. in next beta (something with spacing in math) Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] math align broken
Dear Mikael, I also confirm your problem. I am using "ConTeXt ver: 2019.12.06 21:40 MKIV beta fmt: 2019.12.9 int: english/english” However, if you change “\Bigl(“ to “\left(“, then the space between left parenthesis and text become narrower. I hope that it will be fixed soon. Best regards, Dalyoung ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] math align broken
Hi Mikael, II tested your example and can confirm the issue, using lmtx version: 2019.12.15 17:34 on MacOS. Best regards: OK > On 15 Dec 2019, at 16:54, Mikael P. Sundqvist wrote: > > Hi, > > I hope this report is not a duplicate of another one. I updated lmtx today > (from http://lmtx.pragma-ade.nl/install-lmtx/context-linux-64.zip, a fresh > install in the folder), and found some strange things with math: > > The file > > %%% EXAMPLE > \starttext > \startformula > \startalign > \NC \int e^{2x}\sin 3x\,dx\NC=\int\Im e^{(2+3i)x}\,dx\NR > \NC\NC =\Im\int e^{(2+3i)x}\,dx\NR > \NC\NC = \Im\Bigl(\frac{1}{2+3i}e^{(2+3i)}\Bigr)\NR > \stopalign > \stopformula > From this we see that $\lim_{n\to+\infty}f(n)=0$. > \stoptext > %%% > > gives the attached ex1.pdf. As we can see the spacing inside \startalign > \stopalign is wrong. Also, the "lim" in the example after the displayed > formula has disappeared. > > Any clues? > > /Mikael > > (I tried in any case to remove cache and rebuild, but since it was a fresh > install, I could not see why it could help here. Thought I mention it > anyways.) > > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://context.aanhet.net > archive : https://bitbucket.org/phg/context-mirror/commits/ > wiki : http://contextgarden.net > ___ ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
[NTG-context] math align broken
Hi, I hope this report is not a duplicate of another one. I updated lmtx today (from http://lmtx.pragma-ade.nl/install-lmtx/context-linux-64.zip, a fresh install in the folder), and found some strange things with math: The file %%% EXAMPLE \starttext \startformula \startalign \NC \int e^{2x}\sin 3x\,dx\NC=\int\Im e^{(2+3i)x}\,dx\NR \NC\NC =\Im\int e^{(2+3i)x}\,dx\NR \NC\NC = \Im\Bigl(\frac{1}{2+3i}e^{(2+3i)}\Bigr)\NR \stopalign \stopformula >From this we see that $\lim_{n\to+\infty}f(n)=0$. \stoptext %%% gives the attached ex1.pdf. As we can see the spacing inside \startalign \stopalign is wrong. Also, the "lim" in the example after the displayed formula has disappeared. Any clues? /Mikael (I tried in any case to remove cache and rebuild, but since it was a fresh install, I could not see why it could help here. Thought I mention it anyways.) ex1.pdf Description: Adobe PDF document ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align in mkiv
Dear Paul, Thanks for your attention: as you may have seen, Hans found the fix and after that math align works fine. As you noticed, the issue was related to what you reported some time ago. Best regards: OK On 7 déc. 2011, at 09:03, Paul Menzel wrote: > Dear Otared, > > > Am Mittwoch, den 07.12.2011, 05:11 +0100 schrieb Otared Kavian: > >> Thank you having tested the file I sent. > > did the example work for you with MKIV in the past? > >> As I suspected, your testing confirms that the change or the bug has been >> introduced in a recent version of ConTeXt mkiv, some time between October >> and late November. >> The version I am running is >> ConTeXt ver: 2011.11.29 23:11 MKIV fmt: 2011.12.2 int: >> english/english > > I can also reproduce that behavior using > >ConTeXt ver: 2011.11.25 21:29 MKIV fmt: 2011.11.25 int: > english/english > >> I think at some time in November Hans did some changes in math alignment >> after someone reported a bug, and Aditya said he wouldn't have time to (or >> could not) fix it. > > There were two issues and the corresponding messages in the archive > [1][2]. So if these are related it should work for you using the version > from November 24th. > > > Thanks, > > Paul > > > [1] http://www.ntg.nl/pipermail/ntg-context/2011/063428.html > [2] http://www.ntg.nl/pipermail/ntg-context/2011/063451.html > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___ %% Otared Kavian Département de Mathématiques Université de Versailles Saint-Quentin Bâtiment Fermat 45 avenue des Etats Unis 78035 Versailles cedex Téléphone: +33 1 39 25 46 42 Secrétariat: +33 1 39 25 46 44 Secrétariat: +33 1 39 25 46 46 e-mail: otared.kav...@math.uvsq.fr ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align in mkiv
On 6-12-2011 22:52, Otared Kavian wrote: \definemathmatrix[alignedcases] [align={right,left,left}, distance=3pt, left={\left\{\;}, right={\right.}, style=\displaystyle] \starttext \startformula \startalignedcases \NC -\partial_t \Delta \psi + \Delta^2 \psi - \Delta \psi \NC = 0 \NC \quad \mbox{in }\, (0,\infty)\times \Omega \NR \NC \psi (0,x) \NC= \psi_0(x) \NC \quad \mbox{in }\, \Omega \NR \NC \psi (t,\sigma ) \NC= 0 \NC \quad \mbox{on }\, (0,\infty)\times \partial\Omega \NR \NC {\partial \psi \over \partial {\bf n}}(t,\sigma ) \NC = 0 \NC \quad \mbox{on }\, (0,\infty)\times \partial\Omega. \stopalignedcases \stopformula \stoptext in math-ali.mkvi line 700 change \dosetmatrixcolumn into \doseteqaligncolumn Hans - Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl - ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align in mkiv
Dear Otared, Am Mittwoch, den 07.12.2011, 05:11 +0100 schrieb Otared Kavian: > Thank you having tested the file I sent. did the example work for you with MKIV in the past? > As I suspected, your testing confirms that the change or the bug has been > introduced in a recent version of ConTeXt mkiv, some time between October and > late November. > The version I am running is > ConTeXt ver: 2011.11.29 23:11 MKIV fmt: 2011.12.2 int: > english/english I can also reproduce that behavior using ConTeXt ver: 2011.11.25 21:29 MKIV fmt: 2011.11.25 int: english/english > I think at some time in November Hans did some changes in math alignment > after someone reported a bug, and Aditya said he wouldn't have time to (or > could not) fix it. There were two issues and the corresponding messages in the archive [1][2]. So if these are related it should work for you using the version from November 24th. Thanks, Paul [1] http://www.ntg.nl/pipermail/ntg-context/2011/063428.html [2] http://www.ntg.nl/pipermail/ntg-context/2011/063451.html align-mkiv.pdf Description: Adobe PDF document %%% align-mkiv.tex % defining an alignment structure \definemathmatrix[alignedcases] [align={right,left,left}, distance=3pt, left={\left\{\;}, right={\right.}, style=\displaystyle] \starttext \startformula \startalignedcases \NC -\partial_t \Delta \psi + \Delta^2 \psi - \Delta \psi \NC = 0 \NC \quad \mbox{in }\, (0,\infty)\times \Omega \NR \NC \psi (0,x) \NC= \psi_0(x) \NC \quad \mbox{in }\, \Omega \NR \NC \psi (t,\sigma ) \NC= 0 \NC \quad \mbox{on }\, (0,\infty)\times \partial\Omega \NR \NC {\partial \psi \over \partial {\bf n}}(t,\sigma ) \NC = 0 \NC \quad \mbox{on }\, (0,\infty)\times \partial\Omega. \stopalignedcases \stopformula \CONTEXT\ \contextmark\ \contextversion \stoptext signature.asc Description: This is a digitally signed message part ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align in mkiv
Dear Dalyoung, Thank you having tested the file I sent. As I suspected, your testing confirms that the change or the bug has been introduced in a recent version of ConTeXt mkiv, some time between October and late November. The version I am running is ConTeXt ver: 2011.11.29 23:11 MKIV fmt: 2011.12.2 int: english/english I think at some time in November Hans did some changes in math alignment after someone reported a bug, and Aditya said he wouldn't have time to (or could not) fix it. Best regards: OK On 7 déc. 2011, at 02:39, Jeong Dalyoung wrote: > Dear Otared, > > I run your code and got the output which is as same as in your file > align-mkii.pdf > I don't know why you got align-mkiv.pdf. > > In my log file, > > ConTeXt ver: 2011.10.08 11:42 MKIV fmt: 2011.10.12 int: english/english > ... > mkiv lua stats > luatex banner - this is luatex, version > beta-0.70.1-2011051908 (rev 4277) > > Something in your system is different from mine. > > I am sorry that I couldn't give you a solution. > > Best regards, > > Dalyoung > >> Best regards: OK >> PS: Here is the source file: >> %%% align-mkiv.tex >> % defining an alignment structure >> \definemathmatrix[alignedcases] >> [align={right,left,left}, >> distance=3pt, >> left={\left\{\;}, >> right={\right.}, >> style=\displaystyle] >> >> \starttext >> >> \startformula >> \startalignedcases >> \NC -\partial_t \Delta \psi + \Delta^2 \psi - \Delta \psi \NC = 0 \NC >> \quad \mbox{in }\, (0,\infty)\times \Omega \NR >> \NC \psi (0,x) \NC= \psi_0(x) \NC \quad \mbox{in }\, \Omega \NR >> \NC \psi (t,\sigma ) \NC= 0 \NC \quad \mbox{on }\, (0,\infty)\times >> \partial\Omega \NR >> \NC {\partial \psi \over \partial {\bf n}}(t,\sigma ) \NC = 0 \NC \quad >> \mbox{on }\, (0,\infty)\times \partial\Omega. >> \stopalignedcases >> \stopformula >> >> \stoptext >> %%% end align-mkiv.tex > > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : http://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___ %% Otared Kavian Département de Mathématiques Université de Versailles Saint-Quentin Bâtiment Fermat 45 avenue des Etats Unis 78035 Versailles cedex Téléphone: +33 1 39 25 46 42 Secrétariat: +33 1 39 25 46 44 Secrétariat: +33 1 39 25 46 46 e-mail: otared.kav...@math.uvsq.fr ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align in mk
Dear Otared, I run your code and got the output which is as same as in your file align-mkii.pdf I don't know why you got align-mkiv.pdf. In my log file, ConTeXt ver: 2011.10.08 11:42 MKIV fmt: 2011.10.12 int: english/english ... mkiv lua stats > luatex banner - this is luatex, version beta-0.70.1-2011051908 (rev 4277) Something in your system is different from mine. I am sorry that I couldn't give you a solution. Best regards, Dalyoung > Best regards: OK > PS: Here is the source file: > %%% align-mkiv.tex > % defining an alignment structure > \definemathmatrix[alignedcases] > [align={right,left,left}, > distance=3pt, > left={\left\{\;}, > right={\right.}, > style=\displaystyle] > > \starttext > > \startformula > \startalignedcases > \NC -\partial_t \Delta \psi + \Delta^2 \psi - \Delta \psi \NC = 0 \NC \quad > \mbox{in }\, (0,\infty)\times \Omega \NR > \NC \psi (0,x) \NC= \psi_0(x) \NC \quad \mbox{in }\, \Omega \NR > \NC \psi (t,\sigma ) \NC= 0 \NC \quad \mbox{on }\, (0,\infty)\times > \partial\Omega \NR > \NC {\partial \psi \over \partial {\bf n}}(t,\sigma ) \NC = 0 \NC \quad > \mbox{on }\, (0,\infty)\times \partial\Omega. > \stopalignedcases > \stopformula > > \stoptext > %%% end align-mkiv.tex ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Math align in mkiv
Hi Aditya, Hi Hans, It seems that recently the align environment in mkiv has changed and I get several strange results now. The (not so minimal…) example below results in the folowing two PDFs: http://dl.dropbox.com/u/4316076/align-mkii.pdf http://dl.dropbox.com/u/4316076/align-mkiv.pdf As far as I can say the right behaviour is the one in mkii. Is there a way to get the same result in mkiv by changing some parameters? (I have movede litlle by little to maths in mkiv and I would like to fix somehow the apparently incorrect behaviour of mkiv…). Best regards: OK PS: Here is the source file: %%% align-mkiv.tex % defining an alignment structure \definemathmatrix[alignedcases] [align={right,left,left}, distance=3pt, left={\left\{\;}, right={\right.}, style=\displaystyle] \starttext \startformula \startalignedcases \NC -\partial_t \Delta \psi + \Delta^2 \psi - \Delta \psi \NC = 0 \NC \quad \mbox{in }\, (0,\infty)\times \Omega \NR \NC \psi (0,x) \NC= \psi_0(x) \NC \quad \mbox{in }\, \Omega \NR \NC \psi (t,\sigma ) \NC= 0 \NC \quad \mbox{on }\, (0,\infty)\times \partial\Omega \NR \NC {\partial \psi \over \partial {\bf n}}(t,\sigma ) \NC = 0 \NC \quad \mbox{on }\, (0,\infty)\times \partial\Omega. \stopalignedcases \stopformula \stoptext %%% end align-mkiv.tex ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] math-align / subformulas not working
Hi, I just tried an example from math-ali.mkiv: \starttext \placeformula \startformula \startalign \NC a \NC \eq b \NR[+] \NC c \NC \neq d \NR \NC \NC \neq f \NR[+] \NC \NC \geq g \NR[+][a] \NC \NC \leq h \NR[+][b] \NC \NC \eq i \NR \stopalign \stopformula \stoptext But the subformula ...[+][a] and ...[+][b] are not shown as expected... they are shown as normal formula numbers - but they should be subformula numbers. Is there a new way to create subformulas? P. ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align with \startcases
On 19 janv. 09, at 19:49, Aditya Mahajan wrote: On Mon, 19 Jan 2009, Otared Kavian wrote: […] Should I add this to the wiki? Please do. Aditya Done: http://wiki.contextgarden.net/\startcases Best regards: OK ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align with \startcases
On Mon, 19 Jan 2009, Otared Kavian wrote: On 19 janv. 09, at 15:38, Aditya Mahajan wrote: On Mon, 19 Jan 2009, Otared Kavian wrote: [...] So my question is: whether one can use \startcases ...\stopcases instead of \startmatrix ... \stopmatrix in order to obtain the result of the plain TeX example? No, but there is not much difference between cases and matrix. Consider: \definemathmatrix[alignedcase] [align={right,left,right},distance=3pt,left={\left\{}, right={\right.},style=\displaystyle] \starttext \startformula \startalignedcase \NC -\Delta u + g(u) \NC{} = f \NC \quad\mbox{in } \Omega\NR \NC {\partial u \over \partial {\bf n} } \NC{} = h(u) \NC \quad\mbox{on } \partial\Omega \NR \stopalignedcase \stopformula Aditya___ Thanks Aditya: actually an alternative definition in order to get what I mentioned in my question is the following: \starttext \definemathmatrix[alignedcase] [align={right,left,left}, % < instead of align={right,left,right} distance=3pt, left={\left\{}, right={\right.}, style=\displaystyle] \startformula \startalignedcase \NC -\Delta u + g(u) \NC{} = f \NC \quad\mbox{in } \Omega\NR \NC {\partial u \over \partial {\bf n} } \NC{} = h(u) \NC \quad\mbox{on } \partial\Omega \NR \stopalignedcase \stopformula \stoptext Should I add this to the wiki? Please do. Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align with \startcases
On 19 janv. 09, at 15:38, Aditya Mahajan wrote: On Mon, 19 Jan 2009, Otared Kavian wrote: [...] So my question is: whether one can use \startcases ...\stopcases instead of \startmatrix ... \stopmatrix in order to obtain the result of the plain TeX example? No, but there is not much difference between cases and matrix. Consider: \definemathmatrix[alignedcase] [align={right,left,right},distance=3pt,left={\left\{}, right={\right.},style=\displaystyle] \starttext \startformula \startalignedcase \NC -\Delta u + g(u) \NC{} = f \NC \quad\mbox{in } \Omega\NR \NC {\partial u \over \partial {\bf n} } \NC{} = h(u) \NC \quad \mbox{on } \partial\Omega \NR \stopalignedcase \stopformula Aditya___ Thanks Aditya: actually an alternative definition in order to get what I mentioned in my question is the following: \starttext \definemathmatrix[alignedcase] [align={right,left,left}, % < instead of align={right,left,right} distance=3pt, left={\left\{}, right={\right.}, style=\displaystyle] \startformula \startalignedcase \NC -\Delta u + g(u) \NC{} = f \NC \quad\mbox{in } \Omega\NR \NC {\partial u \over \partial {\bf n} } \NC{} = h(u) \NC \quad \mbox{on } \partial\Omega \NR \stopalignedcase \stopformula \stoptext Should I add this to the wiki? Many thanks: OK ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align with \startcases
On Mon, 19 Jan 2009, Otared Kavian wrote: Hi everyone, This question is primarily intended for Aditya… but I guess other fellows on the list can also help me solve the following alignment problem: Is it possible to have an alignment like the rsult of the following with \startcases...\stopcases? \starttext \startformula \startmatrix[align={right,left,right},distance=3pt,left={\left\{}, right={\right.}] \NC -\Delta u + g(u) \NC{} = f \NC \quad\mbox{in } \Omega\NR \NC \displaystyle {\partial u \over \partial {\bf n} } \NC{} = h(u) \NC \quad\mbox{on } \partial\Omega \NR \stopmatrix \stopformula \stoptext Actually I used to have such alignments with the following structure (in good old plain TeX...): \starttext \startformula \cases{ \eqalign{ -\Delta u + g(u) &= f \cr \displaystyle {\partial u \over \partial {\bf n} } &= h(u) \cr } \quad \eqalign{ &\hbox{in } \Omega \cr &\vphantom{{\partial u \over \partial {\bf n} }} \hbox{on } \partial\Omega \cr } } \stopformula \stoptext (which gives approximately the same result as the first example above, but clearly the math-alignment structure set up by Aditya and Hans is much more elegant. (Although I prefer the vertical distance between the lines obtained with my plain TeX structure: by the way is it possible to fine tune such things in ConTeXt). So my question is: whether one can use \startcases ...\stopcases instead of \startmatrix ... \stopmatrix in order to obtain the result of the plain TeX example? No, but there is not much difference between cases and matrix. Consider: \definemathmatrix[alignedcase] [align={right,left,right},distance=3pt,left={\left\{}, right={\right.},style=\displaystyle] \starttext \startformula \startalignedcase \NC -\Delta u + g(u) \NC{} = f \NC \quad\mbox{in } \Omega\NR \NC {\partial u \over \partial {\bf n} } \NC{} = h(u) \NC \quad\mbox{on } \partial\Omega \NR \stopalignedcase \stopformula Aditya___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Math align with \startcases
Hi everyone, This question is primarily intended for Aditya… but I guess other fellows on the list can also help me solve the following alignment problem: Is it possible to have an alignment like the rsult of the following with \startcases...\stopcases? \starttext \startformula \startmatrix[align={right,left,right},distance=3pt,left={\left\{}, right={\right.}] \NC -\Delta u + g(u) \NC{} = f \NC \quad\mbox{in } \Omega\NR \NC \displaystyle {\partial u \over \partial {\bf n} } \NC{} = h(u) \NC \quad\mbox{on } \partial\Omega \NR \stopmatrix \stopformula \stoptext Actually I used to have such alignments with the following structure (in good old plain TeX...): \starttext \startformula \cases{ \eqalign{ -\Delta u + g(u) &= f \cr \displaystyle {\partial u \over \partial {\bf n} } &= h(u) \cr } \quad \eqalign{ &\hbox{in } \Omega \cr &\vphantom{{\partial u \over \partial {\bf n} }} \hbox{on } \partial \Omega \cr } } \stopformula \stoptext (which gives approximately the same result as the first example above, but clearly the math-alignment structure set up by Aditya and Hans is much more elegant. (Although I prefer the vertical distance between the lines obtained with my plain TeX structure: by the way is it possible to fine tune such things in ConTeXt). So my question is: whether one can use \startcases ...\stopcases instead of \startmatrix ... \stopmatrix in order to obtain the result of the plain TeX example? Thanks in advance: OK ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align question
On Sun, 26 Aug 2007, WN wrote: > Aditya, > > This confuses me, I thought when using 3 columns I have to set n=3 otherwise > I get errors about extra tab found etc. > However doing as you suggested, seems to work. This is due to the m key. m=2 tells context that there are two blocks of equations. n=2 says that each block has two columns. So, in all there should be n*m = 4 \NC in the equation (I had only put three, which led to the wrong equation number alignment). > Then another question, the formula numbering is not aligned with the other > formula's in my text > like in the code below. How can I force the sub formula numbering to be right > aligned ? See above: This was due to mistake in my code. This works. (Though it will be nice if such mistakes do not cause these kinds of errors) \def\ms{\,} \starttext \placeformula[calcb-chapter4-eqn2] \startformula f(x) = \sum_{n = - \infty}^{+\infty} c_{n} e^{\displaystyle i n \frac{\pi}{L} x} \quad \text{,} \quad c_{n} = \frac{1}{2L} \int\limits_{-L}^{L} f(x) \ms e^{- \displaystyle in\frac{\pi}{L} x } dx \stopformula Formula number is not right aligned with the previous formula \placesubformula \startformula \startalign[n=2,m=2,distance=2em] %\startalign[n=3] \NC f(x) \NC = \frac{1}{2\pi} \int\limits_{-\infty}^{+\infty} g(y) \ms e^{i y x} \ms dy \NC\NC (x \in \reals) \NR[calcb-chapter4-eqn5:i][i] \NC g(y) \NC = \int\limits_{-\infty}^{+\infty} f(x) \ms e^{-i y x} d x \NC\NC ( y \in \reals) \NR[calcb-chapter4-eqn5:ii][ii] \NC \int\limits_{-\infty}^{+\infty} |f(x)|^{2} dx \NC = \frac{1}{2\pi} \int\limits_{-\infty}^{+\infty} \Big| g(y) \Big|^{2} \ms d y \NC\NC \quad \NR[calcb-chapter4-eqn5:iii][iii] \stopalign \stopformula \stoptext Do you know about subformulas? For example, \setupsubformulas[conversion=romannumerals] \def\ms{\,} \starttext \startsubformulas[calcb-chapter-4-eqn5] \placeformula \startformula \startalign[n=2,m=2,distance=2em] \NC f(x) \EQ \frac{1}{2\pi} \int\limits_{-\infty}^{+\infty} g(y) \ms e^{i y x} \ms dy \NC\NC (x \in \reals) \NR[calcb-chapter4-eqn5:i] \NC g(y) \EQ \int\limits_{-\infty}^{+\infty} f(x) \ms e^{-i y x} d x \NC\NC ( y \in \reals) \NR[calcb-chapter4-eqn5:ii] \NC \int\limits_{-\infty}^{+\infty} |f(x)|^{2} dx \EQ \frac{1}{2\pi} \int\limits_{-\infty}^{+\infty} \Big| g(y) \Big|^{2} \ms d y \NC\NC \NR[calcb-chapter4-eqn5:iii] \stopalign \stopformula \stopsubformulas You can also refer to the whole equation~\in[calcb-chapter-4-eqn5], or an individual number~\in[calcb-chapter4-eqn5:iii]. \stoptext BTW, why no \ms before dx, and a \ms before dy? Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align question
Aditya, This confuses me, I thought when using 3 columns I have to set n=3 otherwise I get errors about extra tab found etc. However doing as you suggested, seems to work. Then another question, the formula numbering is not aligned with the other formula's in my text like in the code below. How can I force the sub formula numbering to be right aligned ? Thanks Wim \def\ms{\,} \starttext \placeformula[calcb-chapter4-eqn2] \startformula f(x) = \sum_{n = - \infty}^{+\infty} c_{n} e^{\displaystyle i n \frac{\pi}{L} x} \quad \text{,} \quad c_{n} = \frac{1}{2L} \int\limits_{-L}^{L} f(x) \ms e^{- \displaystyle in\frac{\pi}{L} x } dx \stopformula Formula number is not right aligned with the previous formula \placesubformula \startformula \startalign[n=2,m=2,distance=2em] %\startalign[n=3] \NC f(x) \NC = \frac{1}{2\pi} \int\limits_{-\infty}^{+\infty} g(y) \ms e^{i y x} \ms dy \NC (x \in \reals) \NR[calcb-chapter4-eqn5:i][i] \NC g(y) \NC = \int\limits_{-\infty}^{+\infty} f(x) \ms e^{-i y x} d x \NC ( y \in \reals) \NR[calcb-chapter4-eqn5:ii][ii] \NC \int\limits_{-\infty}^{+\infty} |f(x)|^{2} dx \NC = \frac{1}{2\pi} \int\limits_{-\infty}^{+\infty} \Big| g(y) \Big|^{2} \ms d y \NC \quad \NR[calcb-chapter4-eqn5:iii][iii] \stopalign \stopformula \stoptext > How about > >\startalign[n=2,m=2,distance=2em] > > > Aditya > ___ > If your question is of interest to others as well, please add an entry to the > Wiki! > > maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context > webpage : http://www.pragma-ade.nl / http://tex.aanhet.net > archive : https://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___ > > ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Math align question
On Sat, 25 Aug 2007, WN wrote: > Hi, > > Is there a way to increase the distance between the columns in > startalign/stopalign ? > I read the Myway on math align and there are examples where one can set > the distance but > only for pairs of equations. > > In the following code I have 3 columns but they are too close together > and I want to spread them out. How about \startalign[n=2,m=2,distance=2em] Aditya ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Math align question
Hi, Is there a way to increase the distance between the columns in startalign/stopalign ? I read the Myway on math align and there are examples where one can set the distance but only for pairs of equations. In the following code I have 3 columns but they are too close together and I want to spread them out. I tried to use the distance parameter but this setting is ignored. I also experimented with the startmatrix/stopmatrix but I need the sub formula numbering. Any help appreciated Wim \def\ms{\,} \starttext \placesubformula \startformula \startalign[n=3] \NC f(x) \NC = \frac{1}{2\pi} \int\limits_{-\infty}^{+\infty} g(y) \ms e^{i y x} \ms dy \NC (x \in \reals) \NR[calcb-chapter4-eqn5:i][i] \NC g(y) \NC = \int\limits_{-\infty}^{+\infty} f(x) \ms e^{-i y x} d x \NC ( y \in \reals) \NR[calcb-chapter4-eqn5:ii][ii] \NC \int\limits_{-\infty}^{+\infty} |f(x)|^{2} dx \NC = \frac{1}{2\pi} \int\limits_{-\infty}^{+\infty} \Big| g(y) \Big|^{2} \ms d y \NC \quad \NR[calcb-chapter4-eqn5:iii][iii] \stopalign \stopformula \stoptext ___ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] math align
<--- 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
Re: [NTG-context] math align
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
Hans, This is pretty good! But yes, I know that I can get some separation with: \definecombination[twoformulas][location=top,align=middle,distance=1cm] But, as you noted in another post, is there a way to use the full spread of the page where each of these maths are centered in their respective half of the page? 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 ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] math align
<--- On Jan 16, Hans Hagen wrote ---> Aditya Mahajan wrote: Maybe some way of doing this for all columns in a align, say \startformula \startalign[align={2,right}] %This is ugly syntax, can't % think of something good right away \NC a \NC= -1 \NR \NC b \NC= 1 \NR \stopalign \stopformula since we hav esimple alignments here, we could make something: \startformula \startalign[n=4,align={left,right,middle,right}] \NC a \NC= -1 \NR \NC b \NC= 1 \NR \stopalign \stopformula Does that make sense? I think that it's enough to do this for al columns (not per cell) Something like this will be perfect. Per column is enough, I can not even think of a case when per cell could be useful. 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
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
Aditya Mahajan wrote: Maybe some way of doing this for all columns in a align, say \startformula \startalign[align={2,right}] %This is ugly syntax, can't % think of something good right away \NC a \NC= -1 \NR \NC b \NC= 1 \NR \stopalign \stopformula since we hav esimple alignments here, we could make something: \startformula \startalign[n=4,align={left,right,middle,right}] \NC a \NC= -1 \NR \NC b \NC= 1 \NR \stopalign \stopformula Does that make sense? I think that it's enough to do this for al columns (not per cell) Hans ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] math align
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
David Arnold wrote: Yikes, Cont-new.tex is huge. Where do I put this line? Between \unprotect ... \protect? Or at the very end? On Jan 16, 2006, at 10:16 AM, Hans Hagen wrote: at the top, before \unprotect (not that critical btw) Hans ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] math align
On Mon, 16 Jan 2006, Hans Hagen wrote: Mojca Miklavec wrote: I might have missed it by not reading careful enough: is it possible to left/right/middle align certain columns inside \startalign? some day (try to convince me/taco, Please, please, please :-) bribe us, Not possible, I am a poor student :-) write detailed specs, For certain applications, one needs to left/right align the columns. It will be nice if \startformula \startalign \NC a \NC[align=right]= -1 \NR \NC b \NC[align=right]= 1 \NR \stopalign \stopformula comes out as a = -1 b = 1 Maybe some way of doing this for all columns in a align, say \startformula \startalign[align={2,right}] %This is ugly syntax, can't % think of something good right away \NC a \NC= -1 \NR \NC b \NC= 1 \NR \stopalign \stopformula send us so many mails that we give in, etc) This will be the next step :-) Hans, thanks a ton for all this functionality. Aditya ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] math align
David Arnold wrote: In this situation, will I have to put it into the "base" context tree? Yes, you would, but we are only testing now. I assume (based on the name) that Hans has a new core file in mind instead of a module. Taco ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] math align
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
Yikes,Cont-new.tex is huge. Where do I put this line? Between \unprotect ... \protect? Or at the very end?On Jan 16, 2006, at 10:16 AM, Hans Hagen wrote: \ifx\startalign\undefined \input math-ext.tex \fi ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] math align
David Arnold wrote: Taco, Hans, et al, That worked by putting it in the same directory as my little test file. However, with this directory structure: ../book.tex ../bookenv.tex ../math-ext.tex ../chapter6/chapter6.tex ../chapter6/section5.tex Bookenv.tex is our environment file. I tried: \input math-ext and \usemoduel[math-ext] it's not a module, it will end up in the core so, for the moment: = put the file in context/base = run mktexls = add to cont-new.tex: \ifx\startalign\undefined \input math-ext.tex \fi That should work ok Hans ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] math align
Taco, Hans, et al, That worked by putting it in the same directory as my little test file. However, with this directory structure: ../book.tex ../bookenv.tex ../math-ext.tex ../chapter6/chapter6.tex ../chapter6/section5.tex Bookenv.tex is our environment file. I tried: \input math-ext and \usemoduel[math-ext] in bookenv.tex, but when compiling section5.tex, both resulted in math-ext not found. In this situation, will I have to put it into the "base" context tree? On Jan 16, 2006, at 1:02 AM, 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. 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] math align
Mojca Miklavec wrote: I might have missed it by not reading careful enough: is it possible to left/right/middle align certain columns inside \startalign? some day (try to convince me/taco, bribe us, write detailed specs, send us so many mails that we give in, etc) Hans ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] math align
I might have missed it by not reading careful enough: is it possible to left/right/middle align certain columns inside \startalign? Thanks a lot for these definitions, Hans! Mojca ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] math align
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 ... Hans %D \module %D [ file=math-ext, %Dversion=2006.01.14, %D title=\CONTEXT\ Math Macros, %D subtitle=Extra Macros, %D author={Hans Hagen \& Taco Hoekwater}, %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. %M \ifx\startalign\undefined \input math-ext.tex \fi % 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 % n>1 needed, strange # interaction (maybe we need a toks in recurse ane no macro) \def\buildeqalign {\scratchtoks\emptytoks \dorecurse{\mathalignparameter\c!m} {\ifnum\recurselevel>\plusone \appendtoks \tabskip\mathalignparameter\c!distance&\tabskip\zeropoint \to\scratchtoks \fi \expanded{\scratchtoks{\the\scratchtoks\the\!!toksa}}% \dorecurse{\numexpr\mathalignparameter\c!n-\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\prepareeqalignno {\!!toksa{\hfil$\forgetalign\displaystyle{##}$\tabskip\zeropoint}% \!!toksb{&$\forgetalign\displaystyle{{}##}$\tabskip\zeropoint}% \!!toksc{\hfil\tabskip\centering &\llap{$\forgetalign##$}\tabskip\zeropoint}% \buildeqalign \presetdisplaymath \tabskip\centering} \def\prepareleqalignno {\!!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} \def\eqalignno#1% {\prepareeqalignno \halign to \displaywidth \expandafter {\the\scratchtoks\crcr#1\crcr}} \def\leqalignno#1% {\prepareleqaligno \halign to \displaywidth \expandafter {\the\scratchtoks\crcr#1\crcr}} \def\aligneqalignno {\prepareeqalignno \halign to \displaywidth \expandafter \bgroup\the\scratchtoks\crcr} \def\alignleqalignno {\prepareleqalignno \halign to \displaywidth \expandafter \bgroup\the\scratchtoks\crcr} \def\finishalignno {\crcr\egroup} \definesystemvariable{eq} \def\setupmathalign {\dodoubleempty\dosetupmathalign} \def\dosetupmathalign[#1][#2]% {\ifsecondargument \getparameters[\??eq#1][#2]% \else \getparameters[\??eq][#1]% \fi} \let\currentmathalign\empty \def\mathalignparameter#1% {\executeifdefined{\??eq\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][]} \def\doalignNR[#1][#2]% {\doifsomething{#1} {\doifelse{#1}{+} {\doformulanumber[][#2][]{}} {\doformulanumber[#1][#2][]{}}}\cr} \def\dostartmathalign[#1][#2]% {\edef\currentmathalign{#1}% \doifassignmentelse{#2}{\setupmathalign[#1][#2]}\donothing \def\NC{\def\NC1{&1}}% \def\EQ{&=}% \def\NR{&\doxxdoubleempty\doalignNR}% % amste
Re: [NTG-context] math align
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. Cheers, Taco ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] math align
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 % n>1 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 \
Re: [NTG-context] math align
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 [4.2]) (./texexec-texexec.tmp ! Undefined control sequence. \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 % n>1 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}% % amst
Re: [NTG-context] math align
<--- 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
[NTG-context] math align
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 % n>1 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 \stopf