Re: [NTG-context] Numbering subformulas

2015-08-06 Thread Wolfgang Schuster

Procházka Lukáš Ing. - Pontex s. r. o. 
6. August 2015 17:41
Hello Otared,

thanks for the hint. However, I'm still not able to tune the numbering 
setup fully.


Now I have (with resulting numbers | desired number):


\setuphead[part,chapter][placehead=yes,page=no]

\setupformulas
  [prefix=yes,
   %prefix=no,
   %prefixsegments=chapter:section,
   prefixsegments=part,
   way=bysection,

way=bypart,

Wolfgang
___
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] Numbering subformulas

2015-08-06 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello Otared,

thanks for the hint. However, I'm still not able to tune the numbering setup 
fully.

Now I have (with resulting numbers | desired number):


\setuphead[part,chapter][placehead=yes,page=no]

\setupformulas
  [prefix=yes,
   %prefix=no,
   %prefixsegments=chapter:section,
   prefixsegments=part,
   way=bysection,
   %way=bytext,
   %location=right,
  ]

\def\fakeformula{a^2 + b^2 = c^2}

\starttext
  \part{P1}
\chapter{Cha1}
  \section{A}
\placeformula\startformula\fakeformula\stopformula % 1.1 | 1.1 be "part 1, 
formula #1 in the part"

  \section{B}
\placeformula\startformula\fakeformula\stopformula % 1.1 | 1.2 be "part 1, 
formula #2 in the part"

\subsection{Ba}
  \placeformula\startformula\fakeformula\stopformula % 1.2 | 1.3 be "part 1, 
formula #3 in the part"

\chapter{Cha2}
  \section{A}
\placeformula\startformula\fakeformula\stopformula % 1.1 | 1.4 be "part 1, 
formula #4 in the part"

  \part{P2}
\chapter{Cha1}
  \section{A}
\placeformula\startformula\fakeformula\stopformula % 2.1 | 2.1 be "part 2, 
formula #1 in the part"
\stoptext


So the problem here is that EVERY SECTION resets the formula counter, whilst I would need 
only \part to reset the counter, something like "[way=bypart]".

I played somehow with \setupformulas keys but without the wanted output...

Is there a way?

Best regards,

Lukas


On Thu, 06 Aug 2015 16:38:35 +0200, Otared Kavian  wrote:


Hi Lukás,

You configure the way the equations are numbered by sayng (for example)

\setupformulas[prefix=yes, prefixsegments=chapter:section, 
way=bysection, location=right]


--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

SubForm4.mkiv
Description: Binary data


SubForm4.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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Numbering subformulas

2015-08-06 Thread Otared Kavian
Hi Lukás,

You configure the way the equations are numbered by sayng (for example)

\setupformulas[prefix=yes, prefixsegments=chapter:section, 
way=bysection, location=right]

If you say « prefix= no » then you don’t need the other specifications, but I 
am giving a more example above in case you want to adapt it to your needs.

Best regards: OK


> On 06 Aug 2015, at 16:03, Procházka Lukáš Ing. - Pontex s. r. o. 
>  wrote:
> 
> Hello,
> 
> one more question related to the numbering style. The code bellow:
> 
> 
> \def\fakeformula{a^2 + b^2 = c^2}
> 
> \starttext
>  \chapter{Cha1}
>\section{A}
>  \placeformula\startformula\fakeformula\stopformula
> 
>\section{B}
>  \placeformula\startformula\fakeformula\stopformula
> 
>  \subsection{Ba}
>\placeformula\startformula\fakeformula\stopformula
> \stoptext
> 
> 
> gives numbers in form of "(1.1)", "(1.2)" and "(1.3)".
> 
> Is there a way to get simple continuous numbering within the same \chapter 
> (or, similarly, \part in the case of a larger document) - so to produce 
> "(1)", "(2)" and "(3)" in this case?
> 
> Best regards,
> 
> Lukas
> 
> 
> -- 
> Ing. Lukáš Procházka | mailto:l...@pontex.cz
> Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
> Bezová 1658
> 147 14 Praha 4
> 
> Tel: +420 241 096 751
> Fax: +420 244 461 
> 038___
> 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
> ___

___
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] Numbering subformulas

2015-08-06 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

one more question related to the numbering style. The code bellow:


\def\fakeformula{a^2 + b^2 = c^2}

\starttext
  \chapter{Cha1}
\section{A}
  \placeformula\startformula\fakeformula\stopformula

\section{B}
  \placeformula\startformula\fakeformula\stopformula

  \subsection{Ba}
\placeformula\startformula\fakeformula\stopformula
\stoptext


gives numbers in form of "(1.1)", "(1.2)" and "(1.3)".

Is there a way to get simple continuous numbering within the same \chapter (or, similarly, \part in the case 
of a larger document) - so to produce "(1)", "(2)" and "(3)" in this case?

Best regards,

Lukas


--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

SubForm4.mkiv
Description: Binary data


SubForm4.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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Numbering subformulas

2015-08-06 Thread Otared Kavian
Hi Wolfgang,

Thanks for having solved the problem with subformulas numbering.
I would just make a comment on your answers to Lukás, regarding the use of 
\startsubformulas[mylabel]

Indeed using this structure instead of 
\startsubformulas[+]
allows one to refer to all the sub-formulas by invoking (\in[mylabel]), but if 
one wishes to refer to any individual sub-formula one has to give a label 
inside the structure \start—\stop—subformulas, at the level of \placeformula 
for that sub-formula.
Below  is your example, with these remarks.

Thanks for your attention and help: OK
 begin example
\usemodule[visual]

\starttext
Using the definition of the scalar product we infer that:
\placeformula[eq:1]
\startformula
\fakeformula
\stopformula
And here are some other relations valid in a Hilbert space:
%\startsubformulas[+]   % These two options for \subformulas
%\startsubformulas[mylabel] % enable subnumbers for the formulas

\startsubformulas
\placeformula[eq:2-a]
\startformula
\fakeformula
\stopformula

\placeformula[eq:2-b]
\startformula
\fakeformula
\stopformula

\stopsubformulas
It is clear that the equality (\in[eq:2-b]) is a consequence of (\in[eq:1]) and 
(\in[eq:2-a]).

% To test how to change the number separator
\defineseparatorset[none][][]
\setupformulas[numberseparatorset=none]

\startsubformulas[eq:3]
\placeformula
\startformula
\fakeformula
\stopformula

\placeformula
\startformula
\fakeformula
\stopformula

\stopsubformulas
Prove relations (\in[eq:3]) using (\in[eq:1]).
\stoptext
 end example


> On 06 Aug 2015, at 12:07, Wolfgang Schuster  
> wrote:
> 
>> Procházka Lukáš Ing. - Pontex s. r. o.    6. 
>> August 2015 11:32
>> Hello Wolfgang, 
>> 
>> thank you for the patch (not in today's beta); I also attach the modified 
>> strc-mat.mkiv and a test file. 
>> 
>> Two questions: 
>> 
>> 1. 
>> 
>> What exactly are 
>> 
>>   %\startsubformulas[+]   % These two options for \subformulas 
>>   %\startsubformulas[mylabel] % enable subnumbers for the formulas 
>> 
>> intended for? 
>> 
>> The simple "\startsubformulas[eq:b]" meets my needs (subformulas are 
>> sub-numbered) and I can't see any difference to "\startsubformulas[+]". 
> When you write \startsubformulas[-] the numbers for the formulas aren’t 
> displayed in the output but the counter is still increased. I guess 
> \startsubformulas[+] is just there for completeness sake because there are 
> other functions with “-” and “+” options as well.
> 
> One difference between \startsubformulas[+] and \startsubformulas[label] is 
> that the second method creates a label which can be used to refer to the 
> number of the formula.
>> 2. 
>> 
>> Is there a way to setup numbering subformulas to "(1a)" form instead of 
>> "(1.a)", i.e. set the separator to ""? 
> You have to change the separator list with the numberseparator key for 
> \setupformulas.
> 
> \defineseparatorset[none][][]
> \setupformulas[numberseparatorset=none]
> 
> Wolfgang
> ___
> 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
> ___

___
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] Numbering subformulas

2015-08-06 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

great, thanks for explanation!

Best regards,

Lukas


On Thu, 06 Aug 2015 12:07:18 +0200, Wolfgang Schuster 
 wrote:


One difference between \startsubformulas[+] and \startsubformulas[label]
is that the second method creates a label which can be used to refer to
the number of the formula.



You have to change the separator list with the numberseparator key for
\setupformulas.

\defineseparatorset[none][][]
\setupformulas[numberseparatorset=none]

Wolfgang




--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

___
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] Numbering subformulas

2015-08-06 Thread Wolfgang Schuster

Procházka Lukáš Ing. - Pontex s. r. o. 
6. August 2015 11:32
Hello Wolfgang,

thank you for the patch (not in today's beta); I also attach the 
modified strc-mat.mkiv and a test file.


Two questions:

1.

What exactly are

  %\startsubformulas[+]   % These two options for \subformulas
  %\startsubformulas[mylabel] % enable subnumbers for the formulas

intended for?

The simple "\startsubformulas[eq:b]" meets my needs (subformulas are 
sub-numbered) and I can't see any difference to "\startsubformulas[+]".
When you write \startsubformulas[-] the numbers for the formulas aren't 
displayed in the output but the counter is still increased. I guess 
\startsubformulas[+] is just there for completeness sake because there 
are other functions with "-" and "+" options as well.


One difference between \startsubformulas[+] and \startsubformulas[label] 
is that the second method creates a label which can be used to refer to 
the number of the formula.

2.

Is there a way to setup numbering subformulas to "(1a)" form instead 
of "(1.a)", i.e. set the separator to ""?
You have to change the separator list with the numberseparator key for 
\setupformulas.


\defineseparatorset[none][][]
\setupformulas[numberseparatorset=none]

Wolfgang
___
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] Numbering subformulas

2015-08-06 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello Wolfgang,

thank you for the patch (not in today's beta); I also attach the modified 
strc-mat.mkiv and a test file.

Two questions:

1.

What exactly are

  %\startsubformulas[+]   % These two options for \subformulas
  %\startsubformulas[mylabel] % enable subnumbers for the formulas

intended for?

The simple "\startsubformulas[eq:b]" meets my needs (subformulas are sub-numbered) and I 
can't see any difference to "\startsubformulas[+]".

2.

Is there a way to setup numbering subformulas to "(1a)" form instead of "(1.a)", i.e. set 
the separator to ""?

Best regards,

Lukas


On Thu, 06 Aug 2015 01:25:10 +0200, Wolfgang Schuster 
 wrote:


Aditya Mahajan 
4. August 2015 02:08
On Mon, 3 Aug 2015, Procházka Lukáš Ing. - Pontex s. r. o. wrote:


I am not sure when the subformula numbering broke, but I can confirm
that it is not working with the latest beta.

You have to make three changes in strc-mat.mkiv to fix subformula numbering.

The first change is necessary to show the even when there isn’t a
argument for \startsubformulas.

The second change is necessary to prevent context from reseting the mode
for subnumbers
at the end of each formula.

The changes in \stopsubfomulas is necessary because of the test in
\everyresetformulas.


\def\strc_formulas_number_indeed
   {\ifconditional\c_strc_formulas_handle_number
  \hbox\bgroup
% main counter
\ifconditional\c_strc_formulas_inside_formulas_sub
  % nothing
\else
  \ifcase\c_strc_formulas_number_mode
\ifcase\c_strc_formulas_place_number_mode
  \strc_formulas_handle_numbering
\or
  \strc_formulas_handle_numbering
\or
  % nothing
\or
  \strc_formulas_handle_numbering
\fi
  \or
\strc_formulas_handle_numbering
  \or
% nothing
  \or
\strc_formulas_handle_numbering
  \fi
\fi
% subcounter
\ifconditional\c_strc_formulas_inside_formulas_sub
  \ifcase\c_strc_formulas_sub_number_mode
-  % nothing
+  \strc_formulas_handle_sub_numbering
  \or
\strc_formulas_handle_sub_numbering
  \or
% nothing
  \or
\strc_formulas_handle_sub_numbering
  \fi
\fi
   \strc_formulas_reference_trace
  \egroup
\fi}

\appendtoks
 \c_strc_formulas_place_number_mode \zerocount
 \c_strc_formulas_number_mode   \zerocount
-   \c_strc_formulas_sub_number_mode   \zerocount
+   \ifconditional\c_strc_formulas_inside_formulas_sub \else
+   \c_strc_formulas_sub_number_mode\zerocount
+   \fi
 \c_strc_formulas_nested_number_mode\zerocount
\to \everyresetformulas

\unexpanded\def\stopsubformulas
   {\nonoindentation
\useindentnextparameter\subformulaparameter
-  \the\everyresetformulas % to be checked
\global\setfalse\c_strc_formulas_inside_formulas_sub
+  \the\everyresetformulas % to be checked
\dorechecknextindentation} % here ?


 begin example
\usemodule[visual]

\starttext

\placeformula
\startformula
\fakeformula
\stopformula

%\startsubformulas[+]   % These two options for \subformulas
%\startsubformulas[mylabel] % enable subnumbers for the formulas
\startsubformulas

 \placeformula
 \startformula
 \fakeformula
 \stopformula

 \placeformula
 \startformula
 \fakeformula
 \stopformula

\stopsubformulas

\stoptext
 end example


Wolfgang




--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

strc-mat.mkiv
Description: Binary data


SubForm3.mkiv
Description: Binary data


SubForm3.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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Numbering subformulas

2015-08-05 Thread Wolfgang Schuster

Aditya Mahajan 
4. August 2015 02:08
On Mon, 3 Aug 2015, Procházka Lukáš Ing. - Pontex s. r. o. wrote:


I am not sure when the subformula numbering broke, but I can confirm 
that it is not working with the latest beta.

You have to make three changes in strc-mat.mkiv to fix subformula numbering.

The first change is necessary to show the even when there isn’t a 
argument for \startsubformulas.


The second change is necessary to prevent context from reseting the mode 
for subnumbers

at the end of each formula.

The changes in \stopsubfomulas is necessary because of the test in 
\everyresetformulas.



\def\strc_formulas_number_indeed
  {\ifconditional\c_strc_formulas_handle_number
 \hbox\bgroup
   % main counter
   \ifconditional\c_strc_formulas_inside_formulas_sub
 % nothing
   \else
 \ifcase\c_strc_formulas_number_mode
   \ifcase\c_strc_formulas_place_number_mode
 \strc_formulas_handle_numbering
   \or
 \strc_formulas_handle_numbering
   \or
 % nothing
   \or
 \strc_formulas_handle_numbering
   \fi
 \or
   \strc_formulas_handle_numbering
 \or
   % nothing
 \or
   \strc_formulas_handle_numbering
 \fi
   \fi
   % subcounter
   \ifconditional\c_strc_formulas_inside_formulas_sub
 \ifcase\c_strc_formulas_sub_number_mode
-  % nothing
+  \strc_formulas_handle_sub_numbering
 \or
   \strc_formulas_handle_sub_numbering
 \or
   % nothing
 \or
   \strc_formulas_handle_sub_numbering
 \fi
   \fi
  \strc_formulas_reference_trace
 \egroup
   \fi}

\appendtoks
\c_strc_formulas_place_number_mode \zerocount
\c_strc_formulas_number_mode   \zerocount
-   \c_strc_formulas_sub_number_mode   \zerocount
+   \ifconditional\c_strc_formulas_inside_formulas_sub \else
+   \c_strc_formulas_sub_number_mode\zerocount
+   \fi
\c_strc_formulas_nested_number_mode\zerocount
\to \everyresetformulas

\unexpanded\def\stopsubformulas
  {\nonoindentation
   \useindentnextparameter\subformulaparameter
-  \the\everyresetformulas % to be checked
   \global\setfalse\c_strc_formulas_inside_formulas_sub
+  \the\everyresetformulas % to be checked
   \dorechecknextindentation} % here ?


 begin example
\usemodule[visual]

\starttext

\placeformula
\startformula
\fakeformula
\stopformula

%\startsubformulas[+]   % These two options for \subformulas
%\startsubformulas[mylabel] % enable subnumbers for the formulas
\startsubformulas

\placeformula
\startformula
\fakeformula
\stopformula

\placeformula
\startformula
\fakeformula
\stopformula

\stopsubformulas

\stoptext
 end example


Wolfgang
___
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] Numbering subformulas

2015-08-03 Thread Aditya Mahajan

On Mon, 3 Aug 2015, Procházka Lukáš Ing. - Pontex s. r. o. wrote:

So, finally, what is the PROPER way (if it really exists) in ConTeXt how to 
typeset subformulas?


I am not sure when the subformula numbering broke, but I can confirm that 
it is not working with the latest beta.


@Hans, what will be the MkIV approach to define subformulas (or rather, 
nested counters).


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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Numbering subformulas

2015-08-03 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

some more observation:

It seems (sub)numbering (sub)formulas can be achieved enclosing expressions 
into \start/\stop-align.

I wrote a code based on a test suite file:

...\test\doc\context\tests\mkiv\math\formulas-001.tex


\starttext
  \startsubformulas[eq:sub1]
  \placeformula
  \startformula
  \startalign
  \NC a_1 x + b_1 y \NC = c_1 \NR[eq:11]
  \NC a_2 x + b_2 y \NC = c_2 \NR[eq:12]
  \stopalign
  \stopformula
  \stopsubformulas

  \in{eq:11}[eq:11]
  \in{eq:12}[eq:12]

  \placeformula
  \startformula
  \startsubformulas[eq:sub2]
  \startalign
  \NC a_1 x + b_1 y \NC = c_1 \NR[eq:21]
  \NC a_2 x + b_2 y \NC = c_2 \NR[eq:22]
  \stopalign
  \stopsubformulas
  \stopformula

  \input knuth

  \placeformula
  \startformula
  \startsubformulas[eq:sub2]
  \startalign
  \NC a_1 x + b_1 y \NC = c_1 \NR[eq:31]
  \NC a_2 x + b_2 y \NC = c_2 \NR[eq:32]
  \stopalign
  \stopsubformulas
  \stopformula

  \in{eq:31}[eq:31]
  \in{eq:32}[eq:32]
\stoptext


Problems are:

1. I am not able to make numbering of eq:31 and eq:32 continue on eq:22, so to 
have equations numbered:

1a, 1b; 2a, 2b; 2c, 2d

instead of:

1a, 1b; 2a, 2b; 3a, 3b

(Some text - here: knuth - between 2b and 3a/2c is required.)

(I played with commenting some combinations of lines but with no success.)

So - is there a way how to continue numbering subformulas (after some inserted 
text) - something like itemizing has \startitemize[continue]?

2. How to affect the numbering style to be "1a" instead "1.a"?

3. @Hans: The test suite file:

...\test\doc\context\tests\mkiv\math\subformulas-001.tex

compiles, but gives "no-reference" "??".

(
The example on wiki:


http://wiki.contextgarden.net/Math/Display#Automatic_Sub-Formula_Numbering

seems to be very ancient as it GIVES the desired result.
)

Lukas


On Mon, 03 Aug 2015 12:20:44 +0200, Procházka Lukáš Ing. - Pontex s. r. o. 
 wrote:


Hello,

it seems this is a frequent thesis - in the mailing archive, stackoverflow...

Anyway, I'm not able to find a valid way (MWE) how to number subformulas (with option to 
create a reference name, like 'eq:1a' and 'eq:1b', and to be able to refer to them, like 
"\ineq[eq:1a] and \ineq[eq:1b]"), so to get something like:

"
Some text
a + b = c   (1a)
and later
d + e = f   (1b)
so nothing surprising in [1a] and [1b].
"

Moreover, on http://wiki.contextgarden.net/Math there is a red "Warning!":

"
If you consider using ConTeXt for a paper with a proper formula numbering 
please wait until it is implemented in mkiv. At the moment only a very limited 
formula numbering is possilbe:
  number formula(s) with a plain number
  number formula(s) with a subnumber

Not possible is at the moment:
  Table of formulas
  Named subformulas
  Mixure of formulas and subformulas in one block
  Reference on a (sub-)formula without having it listed in the Table of formulas

For more details and actual state see mailing list and Summary of formula 
numbering problem.
"

I don't know which date this warning comes from, if it is outdated or still 
valid...

So, finally, what is the PROPER way (if it really exists) in ConTeXt how to 
typeset subformulas?

(I'm typesetting a large article on physics which contains many math 
(sub-)formulas, so knowledge of a working tool for Ctx would be nice...)

Best regards,

Lukas





--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

subformulas-001.log
Description: Binary data


subformulas-001.pdf
Description: Adobe PDF document


SubForm2.mkiv
Description: Binary data
___
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] Numbering subformulas

2015-08-03 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

it seems this is a frequent thesis - in the mailing archive, stackoverflow...

Anyway, I'm not able to find a valid way (MWE) how to number subformulas (with option to 
create a reference name, like 'eq:1a' and 'eq:1b', and to be able to refer to them, like 
"\ineq[eq:1a] and \ineq[eq:1b]"), so to get something like:

"
Some text
a + b = c   (1a)
and later
d + e = f   (1b)
so nothing surprising in [1a] and [1b].
"

Moreover, on http://wiki.contextgarden.net/Math there is a red "Warning!":

"
If you consider using ConTeXt for a paper with a proper formula numbering 
please wait until it is implemented in mkiv. At the moment only a very limited 
formula numbering is possilbe:
 number formula(s) with a plain number
 number formula(s) with a subnumber

Not possible is at the moment:
 Table of formulas
 Named subformulas
 Mixure of formulas and subformulas in one block
 Reference on a (sub-)formula without having it listed in the Table of formulas

For more details and actual state see mailing list and Summary of formula 
numbering problem.
"

I don't know which date this warning comes from, if it is outdated or still 
valid...

So, finally, what is the PROPER way (if it really exists) in ConTeXt how to 
typeset subformulas?

(I'm typesetting a large article on physics which contains many math 
(sub-)formulas, so knowledge of a working tool for Ctx would be nice...)

Best regards,

Lukas


--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

___
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] Numbering subformulas broken?

2015-08-01 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

the following example (based on 
http://wiki.contextgarden.net/Math/Display#Automatic_Sub-Formula_Numbering ):


\starttext
  \startsubformulas[eq:1]
\placeformula[eq:1a]
  \startformula
c^2 = a^2 + b^2
  \stopformula

\placeformula[eq:1b]
  \startformula
c^2 = a^2 + b^2
  \stopformula

\placeformula[eq:1c]
  \startformula
c^2 = a^2 + b^2
  \stopformula
  \stopsubformulas

  Formula (\in[eq:1]) states the Pythagora's Theorem twice,
once in (\in[eq:1a]) and again in (\in[eq:1b]) and \in[eq:1c].
\stoptext


has two faults:

- subformulas 1b and 1c are not numbered (obviously, references to them show 
"??"),
- vertical distance between 1c and 1b is somehow bigger that that between 1b 
and 1c.

How to fix it?

(Compiled with: ConTeXt  ver: 2015.07.28 19:12 MKIV beta  fmt: 2015.7.30  int: 
english/english.)

Best regards,

Lukas


--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

SubForm.mkiv
Description: Binary data


SubForm.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://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Numbering subformulas

2012-10-15 Thread Hans Hagen

On 15-10-2012 16:58, Wolfgang Schuster wrote:


Am 15.10.2012 um 13:45 schrieb Otared Kavian :


Hi Andreas, Wolfgang and Aditya,

Thanks for your attention and suggesting a fix.
However, after I applied the change mentioned by Andreas for the definition of
 \strc_formulas_handle_sub_numbering
in cont-new.mkiv and made the formats anew, the subformulas are not numbered as 
expected.
Probably we have to wait for a fix from Hans in an upcoming beta.

@Wolfgang: can the typo you mention in font-new.mkiv be easily fixed?


Yes and Hans wil fix it in the next beta but this doesn’t fix the problem with 
the wrong numbering
because the problem for this lies somewhere else.


let's first catch up on other reported issues (I can't find the bugged 
example anyway).


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] Numbering subformulas

2012-10-15 Thread Wolfgang Schuster

Am 15.10.2012 um 13:45 schrieb Otared Kavian :

> Hi Andreas, Wolfgang and Aditya,
> 
> Thanks for your attention and suggesting a fix.
> However, after I applied the change mentioned by Andreas for the definition 
> of 
>\strc_formulas_handle_sub_numbering 
> in cont-new.mkiv and made the formats anew, the subformulas are not numbered 
> as expected. 
> Probably we have to wait for a fix from Hans in an upcoming beta.
> 
> @Wolfgang: can the typo you mention in font-new.mkiv be easily fixed?

Yes and Hans wil fix it in the next beta but this doesn’t fix the problem with 
the wrong numbering
because the problem for this lies somewhere else.

Wolfgang
___
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] Numbering subformulas

2012-10-15 Thread Hans Hagen

On 15-10-2012 13:45, Otared Kavian wrote:

Hi Andreas, Wolfgang and Aditya,

Thanks for your attention and suggesting a fix.
However, after I applied the change mentioned by Andreas for the definition of
 \strc_formulas_handle_sub_numbering
in cont-new.mkiv and made the formats anew, the subformulas are not numbered as 
expected.
Probably we have to wait for a fix from Hans in an upcoming beta.

@Wolfgang: can the typo you mention in font-new.mkiv be easily fixed?


it's in cont-new.mkiv and that one is loaded runtime so it can be fixed 
without remaking the format


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] Numbering subformulas

2012-10-15 Thread Otared Kavian
Hi Andreas, Wolfgang and Aditya,

Thanks for your attention and suggesting a fix.
However, after I applied the change mentioned by Andreas for the definition of 
 \strc_formulas_handle_sub_numbering 
in cont-new.mkiv and made the formats anew, the subformulas are not numbered as 
expected. 
Probably we have to wait for a fix from Hans in an upcoming beta.
 
@Wolfgang: can the typo you mention in font-new.mkiv be easily fixed?

Best regards: OK

On 15 oct. 2012, at 12:44, Andreas Mang  wrote:

> Dear all,
> Dear Wolfgang,
> 
>> This is already in the core (str-mat.mkiv) but I found a typo in another 
>> macro in font-new.mkiv
> 
> Thanks. That's indeed interesting. 
> 
> I still get an error. I have deleted everything and have updated to the most 
> recent beta: 
> 
> 2012.10.06 15:31 MKIV  fmt: 2012.10.15
> 
> If I replace the function 
> 
> \strc_formulas_handle_sub_numbering
> 
> as described before, erveryting works nicely. Probably your fix has not yet 
> been uploaded, yet. I just wanted to let you know. Maybe this clarifies 
> something or indicates additional problems.
> 
> Cheers,
> Andreas
> ___
> 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
> ___

___
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] Numbering subformulas

2012-10-15 Thread Andreas Mang
Dear all,
Dear Wolfgang,

> This is already in the core (str-mat.mkiv) but I found a typo in another 
> macro in font-new.mkiv

Thanks. That's indeed interesting. 

I still get an error. I have deleted everything and have updated to the most 
recent beta: 

2012.10.06 15:31 MKIV  fmt: 2012.10.15

If I replace the function 

\strc_formulas_handle_sub_numbering

as described before, erveryting works nicely. Probably your fix has not yet 
been uploaded, yet. I just wanted to let you know. Maybe this clarifies 
something or indicates additional problems.

Cheers,
Andreas
___
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] Numbering subformulas

2012-10-14 Thread Wolfgang Schuster

Am 14.10.2012 um 22:25 schrieb Andreas Mang :

> Hi there,
> 
> I suppose the following fixes your problem though I can not tell for sure, 
> since you did not provide the error message: 
> 
> Replace the stuff connected to 
> 
> \strc_formulas_handle_sub_numbering
> 
> in
> 
> cont-new.mkiv 
> 
> with
> 
> \def\strc_formulas_handle_sub_numbering
>  {\let\strc_formulas_handle_sub_numbering\relax % else error
>   \doiftextelse\currentsubformulasuffix
> {\strc_counters_setown_sub\v!formula\plustwo\currentsubformulasuffix}
> {\strc_counters_increment_sub\v!formula\plustwo}%
>   \placecurrentformulanumber}
> 
> This works for me. I do this every time I update context. Please consult 
> 
> [NTG-context] subformulas: error in latest beta
> 
> in the mailing list. This is where I reported this bug earlier. Hans himself 
> provided the fix.

This is already in the core (str-mat.mkiv) but I found a typo in another macro 
in font-new.mkiv

Wolfgang
___
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] Numbering subformulas

2012-10-14 Thread Andreas Mang
Hi there,

I suppose the following fixes your problem though I can not tell for sure, 
since you did not provide the error message: 

Replace the stuff connected to 

\strc_formulas_handle_sub_numbering

in

cont-new.mkiv 

with

\def\strc_formulas_handle_sub_numbering
  {\let\strc_formulas_handle_sub_numbering\relax % else error
   \doiftextelse\currentsubformulasuffix
 {\strc_counters_setown_sub\v!formula\plustwo\currentsubformulasuffix}
 {\strc_counters_increment_sub\v!formula\plustwo}%
   \placecurrentformulanumber}

This works for me. I do this every time I update context. Please consult 

[NTG-context] subformulas: error in latest beta

in the mailing list. This is where I reported this bug earlier. Hans himself 
provided the fix.

Hope this helps.

Cheers,
Andreas  

 
Am Oct 14, 2012 um 9:07 PM schrieb Aditya Mahajan:

> On Sun, 14 Oct 2012, Otared Kavian wrote:
> 
>> Hi Aditya,
>> 
>> It seems that numbering subformulas as described in your « My Way » 
>> magazine entitled « Using \startalign » does not work with mkiv. The 
>> following minimal example taken from page 6 of the above mentioned 
>> manual, does not result in what is described there:
>> 
>> \starttext
>> \placesubformula
>> \startformula \startalign
>> \NC a_1 x + b_1 y \NC = c_1 \NR[eq:c][c]
>> \NC a_2 x + b_2 y \NC = c_2 \NR[eq:d][d]
>> \stopalign \stopformula
>> (\in[eq:c]) and (\in[eq:d]) form a linear system of equations.
>> \stoptext
>> 
>> Is this a known bug?
> 
> I can confirm the bug. Using \startsubformulas does not work either.
> 
> I don't completely understand the new implementation of ConTeXt numbers, 
> so I cannot suggest an immediate fix for this.
> 
> 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  : http://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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___


Re: [NTG-context] Numbering subformulas

2012-10-14 Thread Aditya Mahajan

On Sun, 14 Oct 2012, Otared Kavian wrote:


Hi Aditya,

It seems that numbering subformulas as described in your « My Way » 
magazine entitled « Using \startalign » does not work with mkiv. The 
following minimal example taken from page 6 of the above mentioned 
manual, does not result in what is described there:


\starttext
\placesubformula
\startformula \startalign
 \NC a_1 x + b_1 y \NC = c_1 \NR[eq:c][c]
 \NC a_2 x + b_2 y \NC = c_2 \NR[eq:d][d]
\stopalign \stopformula
(\in[eq:c]) and (\in[eq:d]) form a linear system of equations.
\stoptext

Is this a known bug?


I can confirm the bug. Using \startsubformulas does not work either.

I don't completely understand the new implementation of ConTeXt numbers, 
so I cannot suggest an immediate fix for this.


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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

[NTG-context] Numbering subformulas

2012-10-14 Thread Otared Kavian
Hi Aditya,

It seems that numbering subformulas as described in your « My Way » magazine 
entitled « Using \startalign » does not work with mkiv.
The following minimal example taken from page 6 of the above mentioned manual, 
does not result in what is described there:

\starttext
\placesubformula
\startformula \startalign
  \NC a_1 x + b_1 y \NC = c_1 \NR[eq:c][c]
  \NC a_2 x + b_2 y \NC = c_2 \NR[eq:d][d]
\stopalign \stopformula
(\in[eq:c]) and (\in[eq:d]) form a linear system of equations.
\stoptext

Is this a known bug?

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  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___