ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Numbering subformulas
@ 2015-08-03 10:20 Procházka Lukáš Ing. - Pontex s. r. o.
  2015-08-03 15:47 ` Procházka Lukáš Ing. - Pontex s. r. o.
  2015-08-04  0:08 ` Aditya Mahajan
  0 siblings, 2 replies; 21+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2015-08-03 10:20 UTC (permalink / raw)
  To: ConTeXt

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:LPr@pontex.cz
Pontex s. r. o.      | mailto:pontex@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
___________________________________________________________________________________

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

* Re: Numbering subformulas
  2015-08-03 10:20 Numbering subformulas Procházka Lukáš Ing. - Pontex s. r. o.
@ 2015-08-03 15:47 ` Procházka Lukáš Ing. - Pontex s. r. o.
  2015-08-04  0:08 ` Aditya Mahajan
  1 sibling, 0 replies; 21+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2015-08-03 15:47 UTC (permalink / raw)
  To: ConTeXt

[-- Attachment #1: Type: text/plain, Size: 3987 bytes --]

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. <LPr@pontex.cz> 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:LPr@pontex.cz
Pontex s. r. o.      | mailto:pontex@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

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

[-- Attachment #2: subformulas-001.log --]
[-- Type: application/octet-stream, Size: 6120 bytes --]

system          > callbacks > not registering frozen 'find_format_file'

open source     > 1 > 1 > c:/Ctx-Beta/tex/texmf-context/tex/context/base/cont-yes.mkiv

ConTeXt  ver: 2015.07.28 19:12 MKIV beta  fmt: 2015.7.30  int: english/english

system          > 'cont-new.mkiv' loaded
open source     > 2 > 2 > c:/Ctx-Beta/tex/texmf-context/tex/context/base/cont-new.mkiv
close source    > 2 > 2 > c:/Ctx-Beta/tex/texmf-context/tex/context/base/cont-new.mkiv

system          > files > jobname 'subformulas-001', input 'C:/Lukas/ConTeXt/Test/!Ctx/test/doc/context/tests/mkiv/math/subformulas-001', result 'subformulas-001'
fonts           > latin modern fonts are not preloaded
languages       > language 'en' is active
open source     > 2 > 3 > C:/Lukas/ConTeXt/Test/!Ctx/test/doc/context/tests/mkiv/math/subformulas-001.tex
fonts           > preloading latin modern fonts (second stage)
fonts           > 'fallback modern-designsize rm 12pt' is loaded
references      > unknown reference '[][eq:second]'
backend         > xmp > using file 'c:/Ctx-Beta/tex/texmf-context/tex/context/base/lpdf-pdx.xml'
pages           > flushing realpage 1, userpage 1
close source    > 2 > 3 > C:/Lukas/ConTeXt/Test/!Ctx/test/doc/context/tests/mkiv/math/subformulas-001.tex
close source    > 1 > 3 > c:/Ctx-Beta/tex/texmf-context/tex/context/base/cont-yes.mkiv

system          > structure > start used structure

used structure  > text: subformulas-001

system          > structure > stop used structure


system          > files > start used files

used file       >    1: filename=cont-yes.mkiv filetype=tex foundname=c:/Ctx-Beta/tex/texmf-context/tex/context/base/cont-yes.mkiv usedmethod=otherwise
used file       >    2: filename=publ-imp-default.lua filetype=scripts foundname=c:/Ctx-Beta/tex/texmf-context/tex/context/base/publ-imp-default.lua usedmethod=otherwise
used file       >    3: filename=cont-new.mkiv filetype=tex foundname=c:/Ctx-Beta/tex/texmf-context/tex/context/base/cont-new.mkiv usedmethod=otherwise
used file       >    4: filename=lang-us.lua filetype=scripts foundname=c:/Ctx-Beta/tex/texmf-context/tex/context/patterns/lang-us.lua usedmethod=otherwise
used file       >    5: filename=C:/Lukas/ConTeXt/Test/!Ctx/test/doc/context/tests/mkiv/math/subformulas-001.tex foundname=C:/Lukas/ConTeXt/Test/!Ctx/test/doc/context/tests/mkiv/math/subformulas-001.tex usedmethod=direct
used file       >    6: filename=lm.lfg filetype=tex foundname=c:/Ctx-Beta/tex/texmf-context/tex/context/fonts/lm.lfg usedmethod=otherwise
used file       >    7: filename=lmroman12-regular filetype=otf format=otf foundname=c:/Ctx-Beta/tex/texmf/fonts/opentype/public/lm/lmroman12-regular.otf usedmethod=otherwise
used file       >    8: filename=latinmodern-math.otf filetype=opentypefonts foundname=c:/Ctx-Beta/tex/texmf/fonts/opentype/public/lm-math/latinmodern-math.otf usedmethod=otherwise
used file       >    9: filename=lmmono12-regular filetype=otf format=otf foundname=c:/Ctx-Beta/tex/texmf/fonts/opentype/public/lm/lmmono12-regular.otf usedmethod=otherwise
used file       >   10: filename=lpdf-pdx.xml filetype=tex foundname=c:/Ctx-Beta/tex/texmf-context/tex/context/base/lpdf-pdx.xml usedmethod=otherwise

system          > files > stop used files


system          > options > start commandline options

used option     > currentrun="3"
used option     > fulljobname="C:/Lukas/ConTeXt/Test/!Ctx/test/doc/context/tests/mkiv/math/subformulas-001.tex"
used option     > halt-on-error="true"
used option     > input="C:/Lukas/ConTeXt/Test/!Ctx/test/doc/context/tests/mkiv/math/subformulas-001.tex"
used option     > kindofrun="2"
used option     > maxnofruns="9"
used option     > no-parse-first-line="true"
used option     > nonstopmode="true"

system          > options > stop commandline options

system          > options > start commandline files

used file       >    1: C:/Lukas/ConTeXt/Test/!Ctx/test/doc/context/tests/mkiv/math/subformulas-001.tex

system          > options > stop commandline files


references      > start problematic references

references      > unknown >    1: [][eq:second]

references      > stop problematic references


mkiv lua stats  > used config file: selfautoparent:/texmf/web2c/texmfcnf.lua
mkiv lua stats  > used cache path: c:/Ctx-Beta/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e
mkiv lua stats  > resource resolver: loadtime 0.016 seconds, 0 scans with scantime 0.000 seconds, 0 shared scans, 10 found files, scanned paths: <none>
mkiv lua stats  > stored bytecode data: 379 modules (0.360 sec), 78 tables (0.015 sec), 457 chunks (0.375 sec)
mkiv lua stats  > traced context: maxstack: 1144, freed: 0, unreachable: 1144
mkiv lua stats  > cleaned up reserved nodes: 44 nodes, 439 lists of 438
mkiv lua stats  > node memory usage: 2 glue, 2 penalty, 9 attribute, 35 glue_spec, 3 attribute_list, 2 temp
mkiv lua stats  > node list callback tasks: 6 unique task lists, 6 instances (re)created, 54 calls
mkiv lua stats  > used backend: pdf (backend for directly generating pdf output)
mkiv lua stats  > loaded patterns: en::2, load time: 0.000
mkiv lua stats  > jobdata time: 0.000 seconds saving, 0.000 seconds loading
mkiv lua stats  > callbacks: 195 direct, 260 indirect, 455 total
mkiv lua stats  > randomizer: resumed with value 0.15256202887051
mkiv lua stats  > result saved in file: subformulas-001.pdf, compresslevel 3, objectcompresslevel 3
mkiv lua stats  > loaded fonts: 3 files: latinmodern-math.otf, lmmono12-regular.otf, lmroman12-regular.otf
mkiv lua stats  > fonts load time: 0.328 seconds 
mkiv lua stats  > cross referencing: 3 identified, 1 unknown
mkiv lua stats  > used platform: mswin, type: windows, binary subtree: texmf-mswin
mkiv lua stats  > luatex banner: this is luatex, version beta-0.80.1 (tex live 2015/w32tex) (rev 5274)
mkiv lua stats  > control sequences: 43239 of 65536 + 100000
mkiv lua stats  > lua properties: engine: lua, used memory: 45 MB (ctx: 45 MB), hash type: lua, hash chars: min(32,40), symbol mask: utf (τεχ)
mkiv lua stats  > runtime: 0.906 seconds, 1 processed pages, 1 shipped pages, 1.104 pages/second


[-- Attachment #3: subformulas-001.pdf --]
[-- Type: application/pdf, Size: 11865 bytes --]

[-- Attachment #4: SubForm2.mkiv --]
[-- Type: application/octet-stream, Size: 4954 bytes --]

\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



  \placeformula
    \startsubformulas[whocares:3]
      %\startformulas
        \startformula
          \startalign
            \NC 1 \NC = \text{nop} \NR[+]
            \NC 2 \NC = \text{yes plus} \NR[+]
          \stopalign
        \stopformula
      %\stopformulas
    \stopsubformulas

      \input knuth

  \placeformula
    \startsubformulas
      \startformulas
        \startformula
          \startalign
            \NC 3 \NC = \text{yes whocares:4} \NR[whocares:4]
            \NC 4 \NC = \text{nop} \NR[-]
          \stopalign
        \stopformula
      \stopformulas
    \stopsubformulas
\stoptext


\starttext
  \startsubformulas[eq:3]
    \placeformula
      \startformula
        \startalign
          \NC a \NC = a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a \NR[eq:11]
        \stopalign
      \stopformula

    \placeformula
      \startformula
        \startalign
          \NC b \NC = b + b + b + b + b + b + b + b + b \NR[eq:12]
        \stopalign
      \stopformula
  \stopsubformulas
\stoptext



  \startsubformulas[eq:1]
    \placeformula
      \startformula
        \startalign
          \NC a = b \NR[eq:11]
          \NC c = d \NR[eq:12]
        \stopalign
      \stopformula
  \stopsubformulas

  \if+-
    \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]
            \NC c_2           \NC = a_2 x + b_2 y \NR[eq:13]
          \stopalign
        \stopformula

      \placeformula
        \startformula
          \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]
            \NC c_2           \NC = a_2 x + b_2 y \NR[eq:23]
          \stopalign
        \stopformula
    \stopsubformulas
  \fi

  \startsubformulas[eq:3]
    \placeformula
      \startformula
        \startalign
          \NC a \NC = a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a + a \NR
        \stopalign
      \stopformula
  \stopsubformulas
\stoptext

\in{whocares:1}[whocares:1]
\in{whocares:2}[whocares:2]

\placeformula
    \startsubformulas[whocares:3]% 1a 1b 1c 1d
        \startformulas
            \startformula \startalign
                \NC 1 \NC = \text{nop} \NR
                \NC 2 \NC = \text{yes plus} \NR[+]
            \stopalign \stopformula
            \startformula \startalign
                \NC 3 \NC = \text{yes whocares:4} \NR[whocares:4]
                \NC 4 \NC = \text{nop} \NR[-]
            \stopalign \stopformula
       \stopformulas
    \stopsubformulas

\in{whocares:3}[whocares:3]
\in{whocares:4}[whocares:4]

\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]
                \NC a_2 x + b_2 y \NC = c_2 \NR[eq:13]
            \stopalign
        \stopformula
\stopsubformulas

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

\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]
                \NC a_2 x + b_2 y \NC = c_2 \NR[eq:23]
            \stopalign
        \stopsubformulas
    \stopformula

\in{eq:21}[eq:21]
\in{eq:22}[eq:22]
\in{eq:23}[eq:23]

\placeformula
    \startformula
        \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]
            \NC a_2 x + b_2 y \NC = c_2 \NR[eq:33]
        \stopalign
    \stopformula

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

\stoptext

[-- Attachment #5: Type: text/plain, Size: 485 bytes --]

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

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

* Re: Numbering subformulas
  2015-08-03 10:20 Numbering subformulas Procházka Lukáš Ing. - Pontex s. r. o.
  2015-08-03 15:47 ` Procházka Lukáš Ing. - Pontex s. r. o.
@ 2015-08-04  0:08 ` Aditya Mahajan
  2015-08-05 23:25   ` Wolfgang Schuster
  1 sibling, 1 reply; 21+ messages in thread
From: Aditya Mahajan @ 2015-08-04  0:08 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 398 bytes --]

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

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

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

* Re: Numbering subformulas
  2015-08-04  0:08 ` Aditya Mahajan
@ 2015-08-05 23:25   ` Wolfgang Schuster
  2015-08-06  9:32     ` Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 1 reply; 21+ messages in thread
From: Wolfgang Schuster @ 2015-08-05 23:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3036 bytes --]

> Aditya Mahajan <mailto:adityam@umich.edu>
> 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

[-- Attachment #1.2: Type: text/html, Size: 4757 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

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

* Re: Numbering subformulas
  2015-08-05 23:25   ` Wolfgang Schuster
@ 2015-08-06  9:32     ` Procházka Lukáš Ing. - Pontex s. r. o.
  2015-08-06 10:07       ` Wolfgang Schuster
  0 siblings, 1 reply; 21+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2015-08-06  9:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 4152 bytes --]

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 <schuster.wolfgang@gmail.com> wrote:

>> Aditya Mahajan <mailto:adityam@umich.edu>
>> 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:LPr@pontex.cz
Pontex s. r. o.      | mailto:pontex@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

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

[-- Attachment #2: strc-mat.mkiv --]
[-- Type: application/octet-stream, Size: 29918 bytes --]

%D \module
%D \module
%D   [       file=strc-mat,
%D        version=2008.10.20,
%D          title=\CONTEXT\ Structure Macros,
%D       subtitle=Math Numbering,
%D         author=Hans Hagen,
%D           date=\currentdate,
%D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
%C
%C This module is part of the \CONTEXT\ macro||package and is
%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
%C details.

\writestatus{loading}{ConTeXt Structure Macros / Math Numbering}

\registerctxluafile{strc-mat}{1.001}

% -- we have potential for captions
% -- this module will use the commandhandler
% -- key/value pairs will be added (I have no time now)

\unprotect

\setupformulas
  [%\c!way=,
   %\c!blockway=,
   %\c!sectionnumber=,
   %\c!conversion=\v!numbers,
   %\c!numberstyle=,
   %\c!numbercolor=,
   %\c!numbercommand=,
   %\c!margin=,
   %\c!align=,
   %\c!separator=,
   %\c!grid=,
   \c!location=\v!right,
   \c!left=(,
   \c!right=),
   \c!expansion=\v!yes, % maybe automatically
   \c!spacebefore=\v!big,
   \c!spaceafter=\formulaparameter\c!spacebefore,
   \c!leftmargin=\zeropoint,
   \c!rightmargin=\zeropoint,
   \c!indentnext=\v!no,
   \c!alternative=\s!default,
   \c!strut=\v!no,
   \c!distance=2\emwidth]

\ifdefined\matheqnogapstep
    % we're ok, now we have that quad in the distance which is
    % more consistent and not depending on the text font in math
    \matheqnogapstep\zerocount
\else
    % we will keep this for a while
    \setupformulas[\c!distance=\emwidth]
\fi

\setupsubformulas % subformulas could be last in chain
  [\c!indentnext=\formulaparameter\c!indentnext]

\definecounter % one ?
  [\v!formula]

\defineconversionset
  [\v!formula]
  [numbers,characters] % no \v! ?

\installcounterassociation{formula} \registerformulacounter\v!formula % currently we only have one

\appendtoks
    \synchronizeformulacounters
\to \everysetupformula

% \appendtoks
%     \synchronizeformulacounters
% \to \everydefineformula

\setupformulas
  [\c!numberconversionset=\v!formula] % why forgotten

\appendtoks
    \normalexpanded{\definelist[\currentformula]}% is expansion needed?
    \setuevalue{\e!start\currentformula\v!formula}{\strc_formulas_start_formula{\currentformula}}%
    \setuevalue{\e!stop \currentformula\v!formula}{\strc_formulas_stop_formula}%
\to \everydefineformula

\definelist[\v!formula]

\setuvalue{\e!start\v!formula}{\strc_formulas_start_formula{}}
\setuvalue{\e!stop \v!formula}{\strc_formulas_stop_formula}

\let\strc_formulas_start_formula\relax % defined later
\let\strc_formulas_stop_formula \relax % defined later

\unexpanded\def\defineformulaalternative               % this might change ... start and stop can become keys
  {\dotripleargument\strc_formulas_define_alternative} % to the general define .. s!startcommand

\def\strc_formulas_define_alternative[#1][#2][#3]%
  {\setvalue{\e!start#1\v!formula}{#2}%
   \setvalue{\e!stop #1\v!formula}{#3}}

% sp = single line paragraph  sd = single line display
% mp = multi  line paragraph  md = multy  line display

\defineformulaalternative[\s!default][\startdisplaymath][\stopdisplaymath]
\defineformulaalternative[\s!single] [\startdisplaymath][\stopdisplaymath]
\defineformulaalternative[\s!multi]  [\startdisplaymath][\stopdisplaymath]

\defineformula
  [sp]
  [\c!spacebefore=\v!none,
   \c!spaceafter=\v!none,
   \c!indentnext=\v!no,
   \c!alternative=\s!single]

\defineformula
  [sd]
  [\c!spacebefore=\v!none,
   \c!spaceafter=\v!none,
   \c!indentnext=\v!yes,
   \c!alternative=\s!single]

\defineformula
  [mp]
  [\c!indentnext=\v!no,
   \c!alternative=\s!multi]

\defineformula
  [md]
  [\c!indentnext=\v!yes,
   \c!alternative=\s!multi]

\newtoks\everyresetformulas

\appendtoks
    \let\currentformula\empty % to be checked:
\to \everyresetformulas

% implementation

\unexpanded\def\strc_formulas_store_number#1#2#3#4#5% ref, todo:str, \sync % todo: title etc (like float)
  {\settrue\c_strc_formulas_handle_number
   \strc_counters_register_component
     {formula}%
     \setupcurrentformula \formulaparameter \detokenizedformulaparameter
     \relax \relax \relax
     [\c!name=\v!formula,\s!counter=\v!formula,%
      \s!hascaption=\v!yes,\s!hastitle=\v!yes,\s!hasnumber=\v!yes,%\s!haslevel=#6,%
      \c!reference=#1,\c!title=\namedformulaentry,\c!bookmark=]%
     [#2]%
   \glet\namedformulaentry\empty % \relax
   \globallet#3\m_strc_counters_last_registered_index
   \globallet#4\m_strc_counters_last_registered_synchronize
   \globallet#5\m_strc_counters_last_registered_attribute}

% modes: 0=unset, 1=forced, 2=none, 3=reference

\newconstant\c_strc_formulas_place_number_mode
\newconstant\c_strc_formulas_number_mode
\newconstant\c_strc_formulas_sub_number_mode
\newconstant\c_strc_formulas_nested_number_mode

\appendtoks
    \c_strc_formulas_place_number_mode \zerocount
    \c_strc_formulas_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

\newconditional\c_strc_formulas_handle_number
\newconditional\c_strc_formulas_increment
\newconditional\c_strc_formulas_inside_place
\newconditional\c_strc_formulas_inside_place_sub
\newconditional\c_strc_formulas_inside_formulas
\newconditional\c_strc_formulas_inside_formulas_sub

\appendtoks
    \global\setfalse\c_strc_formulas_inside_place
    \global\setfalse\c_strc_formulas_inside_place_sub
\to \everyresetformulas

% \def\strc_formulas_place_numbering % place formula
%   {\settrue\c_strc_formulas_handle_number
%    \strc_formulas_check_reference\c_strc_formulas_place_number_mode\currentplaceformulareference
%    \glet\strc_formulas_place_number\strc_formulas_place_number_indeed
%    \glet\strc_formulas_place_number_nested\strc_formulas_place_number_nested_indeed}

\def\strc_formulas_place_numbering % place formula
  {\settrue\c_strc_formulas_handle_number
   \strc_formulas_check_reference\c_strc_formulas_place_number_mode\currentplaceformulareference
   \ifnum\c_strc_formulas_place_number_mode=\plustwo
     \glet\strc_formulas_place_number\relax
   \else
     \glet\strc_formulas_place_number\strc_formulas_place_number_indeed
   \fi
   \glet\strc_formulas_place_number_nested\strc_formulas_place_number_nested_indeed}

\def\strc_formulas_handle_number % formulas
  {\strc_formulas_check_reference\c_strc_formulas_number_mode\currentformulareference}

\def\strc_formulas_handle_sub_number_indeed % sub formulas
  {\strc_formulas_check_reference\c_strc_formulas_sub_number_mode\currentsubformulasreference
   \strc_counters_increment\v!formula
   \strc_formulas_store_number
     \currentsubformulasreference
     \empty
     \currentsubformulasnumber
     \currentsubformulassynchronize
     \currentsubformulasattribute}

\def\strc_formulas_handle_sub_number % sub formulas
  {\iftrialtypesetting
     \strc_counters_save\v!formula
     \strc_formulas_handle_sub_number_indeed
     \strc_counters_restore\v!formula
   \else
     \strc_formulas_handle_sub_number_indeed
   \fi}

\let\strc_formulas_reference_trace\relax
\let\strc_formulas_reference_show \relax

% \def\strc_formulas_reference_trace
%   {\rlap{\hbox{\quad\tt\txx[%
%       \number\c_strc_formulas_place_number_mode,%
%       \number\c_strc_formulas_number_mode,%
%       \number\c_strc_formulas_sub_number_mode,%
%       \number\c_strc_formulas_nested_number_mode
%    ]}}}

% \def\strc_formulas_reference_show
%   {\writestatus{\v!formula}%
%      {place:      \number\c_strc_formulas_place_number_mode,\space
%       formula:    \number\c_strc_formulas_number_mode,\space
%       subformula: \number\c_strc_formulas_sub_number_mode,\space
%       nested:     \number\c_strc_formulas_nested_number_mode]}}

\unexpanded\def\placecurrentformulanumber
  {\begingroup
   \rm % determines the distance and main font
   \edef\p_location{\formulaparameter\c!location}%
   \ifx\p_location\v!right
      \hskip\formulaparameter\c!distance
   \fi
   \begingroup
   \useformulastyleandcolor\c!numberstyle\c!numbercolor
   \formulaparameter\c!numbercommand
     {\strut
      \formulaparameter\c!left
      \namedtaggedlabeltexts
        \t!formulalabel \v!formula
        \t!formulanumber\v!formula
        {\ignorespaces\strc_formulas_place_current_number\removeunwantedspaces}%
      \formulaparameter\c!right}%
   \endgroup
   \ifx\p_location\v!left
     \hskip\formulaparameter\c!distance
   \fi
   \endgroup}

\unexpanded\def\strc_formulas_place_current_number
  {\strc_formulas_handle_current_references
   \labeltexts\currentformula{\convertedcounter[\v!formula][]}}

% \def\theboxdestinationattribute#1{\iflocation\ifx#1\relax\else\ifx#1\empty\else attr      \destinationattribute#1\fi\fi\fi}
% \def\thedestinationattribute   #1{\iflocation\ifx#1\relax\else\ifx#1\empty\else \attribute\destinationattribute#1\fi\fi\fi}

\def\theformuladestinationattribute#1%
  {\iflocation\ifx#1\relax\else\ifx#1\empty\else
     \attribute\destinationattribute#1%
     \glet#1\relax
   \fi\fi\fi}

\let\currentplaceformulaattribute\relax
\let\currentformulaattribute     \relax
\let\currentsubformulaattribute  \relax
\let\currentformulasattribute    \relax

\let\currentplaceformulanumber\relax
\let\currentformulanumber     \relax
\let\currentsubformulanumber  \relax
\let\currentformulasnumber    \relax

\let\currentformulasreference     \empty
\let\currentformulareference      \empty
\let\currentsubformulareference   \empty
\let\currentnestedformulareference\empty

\appendtoks
    \glet\currentformulasreference     \empty
    \glet\currentformulareference      \empty
    \glet\currentsubformulareference   \empty
    \glet\currentnestedformulareference\empty
\to \everyresetformulas

\let\currentformulassuffix     \empty
\let\currentformulasuffix      \empty
\let\currentsubformulasuffix   \empty
\let\currentnestedformulasuffix\empty

\appendtoks
    \glet\currentformulassuffix     \empty
    \glet\currentformulasuffix      \empty
    \glet\currentsubformulasuffix   \empty
    \glet\currentnestedformulasuffix\empty
\to \everyresetformulas

\let\currentplaceformulasynchronize\relax
\let\currentformulasynchronize     \relax
\let\currentsubformulasynchronize  \relax
\let\currentformulassynchronize    \relax

\appendtoks
    \glet\currentplaceformulasynchronize \relax
    \glet\currentformulassynchronize     \relax
    \glet\currentsubformulassynchronize  \relax
    \glet\currentnestedformulasynchronize\relax
\to \everyresetformulas

% currently we do the number, some day we will do the (sub) formula

\def\strc_formulas_handle_current_references
  {\strc_formulas_reference_show
   \ifnum\c_strc_formulas_place_number_mode=\plusthree
     \strc_formulas_store_number
       \currentplaceformulareference
       \empty
       \currentplaceformulanumber
       \currentplaceformulasynchronize
       \currentplaceformulaattribute
     \currentplaceformulasynchronize
     \glet\currentplaceformulasynchronize\relax
     \theformuladestinationattribute\currentplaceformulaattribute
   \fi
   \ifnum\c_strc_formulas_number_mode=\plusthree
     \strc_formulas_store_number
       \currentformulasreference
       \empty
       \currentformulasnumber
       \currentformulassynchronize
       \currentformulasattribute
     \currentformulassynchronize
     \glet\currentformulassynchronize\relax
     \theformuladestinationattribute\currentformulasattribute
   \fi
   \ifnum\c_strc_formulas_sub_number_mode=\plusthree
     \currentsubformulassynchronize
     \glet\currentsubformulassynchronize\relax
   \fi
   \ifnum\c_strc_formulas_nested_number_mode=\plusthree
     \strc_formulas_store_number
       \currentnestedformulareference
       \empty
       \currentnestedformulanumber
       \currentnestedformulasynchronize
       \currentnestedformulaattribute
     \currentnestedformulasynchronize
     \glet\currentnestedformulasynchronize\relax
     \theformuladestinationattribute\currentnestedformulaattribute
   \fi}

% needs checking ... too many:

\def\strc_formulas_handle_numbering_indeed
  {\strc_counters_increment\v!formula
   \doiftext\currentplaceformulasuffix{\strc_counters_setown_sub\v!formula\plustwo\currentplaceformulasuffix}%
   \placecurrentformulanumber}

\def\strc_formulas_handle_numbering
  {\iftrialtypesetting
     \strc_counters_save\v!formula
     \strc_formulas_handle_numbering_indeed
     \strc_counters_restore\v!formula
   \else
     \strc_formulas_handle_numbering_indeed
   \fi}

\def\strc_formulas_handle_sub_numbering_indeed
  {\let\strc_formulas_handle_sub_numbering\relax % else error: see math/numbering-001.tex
   \doifelsetext\currentsubformulasuffix
     {\strc_counters_setown_sub\v!formula\plustwo\currentsubformulasuffix}
     {\strc_counters_increment_sub\v!formula\plustwo}%
   \placecurrentformulanumber}

\def\strc_formulas_handle_sub_numbering
  {\iftrialtypesetting
     \strc_counters_save\v!formula
     \strc_formulas_handle_sub_numbering_indeed
     \strc_counters_restore\v!formula
   \else
     \strc_formulas_handle_sub_numbering_indeed
   \fi}

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

\installstructurelistprocessor\v!formula % to be checked ...
  {\let\currentlistentrynumber    \structurelistgenericnumber
   \let\currentlistentrytitle     \structurelistgenerictitle
   \let\currentlistentrypagenumber\structurelistpagenumber
   \strc_lists_apply_renderingsetup}

\newif\ifinformula

%D We need a hook into the plain math alignment macros
%D
%D \starttyping
%D \displaylines
%D \eqalignno
%D \eqalignno
%D \stoptyping
%D
%D Otherwise we get a missing \type {$$} error reported.

\let\reqno\eqno

\unexpanded\def\resetdisplaymatheq % when used?
  {\let\normalleqno\gobbleoneargument \let\leqno\gobbleoneargument
   \let\normalreqno\gobbleoneargument \let\eqno \gobbleoneargument
   \let\strc_formulas_place_number\relax}

%D \macros
%D   {startsubformulas}

% \placeformula
% \startsubformulas[Maxwell]
%     \startformulas
%      \startformula \startalign
%        \NC \nabla\cdot\bf E  \NC = \frac{\rho}{\varepsilon_0} \NR[Maxwell 1]
%        \NC \nabla\times\bf E \NC = - \frac{\partial\bf B}{\partial t} \NR[Maxwell II]
%        \stopalign \stopformula
%        \startformula \startalign
%          \NC \nabla\cdot \bf B \NC = 0 \NR[Maxwell III]
%          \NC \nabla\times\bf B \NC = \mu_0{\bf j}+\varepsilon_0\mu_0\frac{\partial\bf E}{\partial t} \NR[Maxwell IV]
%        \stopalign \stopformula
%    \stopformulas
% \stopsubformulas
%
% Maxwell : \in [Maxwell] and II : \in [Maxwell II]

%D Tricky stuff:

\newdimen\lastlinewidth

\abovedisplayskip      \zeropoint
\abovedisplayshortskip \zeropoint % evt. 0pt minus 3pt
\belowdisplayskip      \zeropoint
\belowdisplayshortskip \zeropoint % evt. 0pt minus 3pt

\predisplaypenalty     \zerocount
\postdisplaypenalty    \zerocount % -5000 gaat mis, zie penalty bij \paragraaf

% we don't use the skip's

\unexpanded\def\strc_formulas_forget_display_skips
  {\abovedisplayskip     \zeropoint
   \belowdisplayskip     \zeropoint
   \abovedisplayshortskip\zeropoint
   \belowdisplayshortskip\zeropoint}

% \def\predisplaysizethreshhold{2\emwidth} % was 3\emwidth

\newdimen\d_strc_formulas_display_skip_left
\newdimen\d_strc_formulas_display_skip_right
\newdimen\d_strc_formulas_display_margin_left
\newdimen\d_strc_formulas_display_margin_right
\newdimen\d_strc_formulas_display_pre_threshold
\newskip \d_strc_formulas_display_skip_par

\unexpanded\def\beforedisplayspace
  {\edef\p_spacebefore{\formulaparameter\c!spacebefore}%
   \ifx\p_spacebefore\v!none \else
     \blank[\p_spacebefore]%
   \fi}

\unexpanded\def\afterdisplayspace
  {\edef\p_spaceafter{\formulaparameter\c!spaceafter}%
   \ifx\p_spaceafter\v!none \else
     \blank[\p_spaceafter]%
   \fi}

\unexpanded\def\setdisplaydimensions
  {\displayindent\d_strc_formulas_display_skip_left
   \advance\displayindent\d_strc_formulas_display_margin_left
   \displaywidth\hsize
  %\setlocalhsize
  %\displaywidth\localhsize
   \ifdim\hangindent>\zeropoint
     \advance\displayindent\hangindent
   \else
     \advance\displaywidth\hangindent
   \fi
   \advance\displaywidth\dimexpr-\displayindent-\d_strc_formulas_display_skip_right-\d_strc_formulas_display_margin_right\relax
   \hsize\displaywidth} % new, else overfull in itemize

\unexpanded\def\strc_formulas_start_formula#1%
  {\dodoubleempty\strc_formulas_start_formula_indeed[#1]}

% \newskip\formulastrutht
% \newskip\formulastrutdp

%D \startbuffer
%D \startformula[9pt] x = 1 \stopformula
%D \startformula[7pt] x = 1 \stopformula
%D \stopbuffer
%D
%D \typebuffer \getbuffer

\unexpanded\def\strc_formulas_start_formula_indeed[#1][#2]% setting leftskip adaption is slow !
  {\bgroup % HERE
   \def\currentformula{#1}%
   \dostarttaggedchained\t!formula\currentformula\??formula
   \the\everybeforedisplayformula
   \d_strc_formulas_display_skip_par\parskip\relax
  %\formulastrutdp\strutdepth
  %\formulastrutht\strutheight
   \edef\p_option  {\formulaparameter\c!option}%
   \edef\p_margin  {\formulaparameter\c!margin}%
   \edef\p_bodyfont{#2}%
  %\ifx\p_bodyfont\empty
  %  \edef\p_bodyfont{\formulaparameter\c!bodyfont}%
  %\fi
   \ifx\p_bodyfont\empty \else
     \switchtoformulabodyfont[#2]%
   \fi
   \parskip\d_strc_formulas_display_skip_par\relax
   \ifx\p_option\v!middle
     \d_strc_formulas_display_skip_left \zeropoint
     \d_strc_formulas_display_skip_right\zeropoint
   \else
     \d_strc_formulas_display_skip_left \leftskip
     \d_strc_formulas_display_skip_right\rightskip
   \fi
   \d_strc_formulas_display_margin_left \formulaparameter\c!leftmargin \relax
   \d_strc_formulas_display_margin_right\formulaparameter\c!rightmargin\relax
   \ifx\p_margin\empty \else
     \dosetleftskipadaption\p_margin
     \d_strc_formulas_display_margin_left\leftskipadaption
   \fi
   \let\strc_formulas_start_formula\strc_formulas_start_formula_nested
  %\freezedimenmacro\predisplaysizethreshhold
   \strc_formulas_forget_display_skips
   \getvalue{\e!start\formulaparameter\c!alternative\v!formula}}

\unexpanded\def\strc_formulas_start_formula_nested#1%
  {\bgroup
   \let\strc_formulas_stop_formula\strc_formulas_stop_formula_nested
   \dostarttagged\t!subformula\empty}

\unexpanded\def\strc_formulas_stop_formula_nested
  {\dostoptagged
   \egroup}

% tagging of formulanumbers is not ok (we get two display maths blobs)

\unexpanded\def\strc_formulas_stop_formula
  {\dostarttagged\t!formulacaption\empty
   \strc_formulas_place_number
   \dostoptagged
   \dostarttagged\t!formulacontent\empty
   \getvalue{\e!stop\formulaparameter\c!alternative\v!formula}%
   \dostoptagged
   \dostoptagged
   \nonoindentation
   \useindentnextparameter\formulaparameter
   \egroup
   \hangafter\minusone   % added for side floats
   \hangindent\zeropoint % added for side floats
   \setfalse\c_strc_formulas_handle_number
   \the\everyresetformulas
   \dorechecknextindentation} % here ?

% experiment:

\appendtoks
   \edef\p_grid{\formulaparameter\c!grid}%
   \ifx\p_grid\empty \else
     \spac_grids_snap_value_auto\p_grid
   \fi
\to \everybeforedisplayformula

\unexpanded\def\switchtoformulabodyfont
  {\switchtobodyfont}

\setuvalue{\v!formula}{\dosingleempty\strc_formulas_formula}

\def\strc_formulas_formula[#1]#2% todo: tagged
  {\begingroup
   \edef\p_bodyfont{#1}%
   \ifx\p_bodyfont\empty \else
     \switchtoformulabodyfont[\p_bodyfont]%
   \fi
   % not : \def\strc_formulas_formula[##1]##2{\mathematics{##2}}%
   \mathematics{#2}%
   \endgroup}

%D \starttyping
%D % test \par       % no preceding hlist
%D % $$x$$           % preceding hlist
%D % \noindent $$x$$ % no preceding hlist
%D \startformula x \stopformula % now has \noindent (in mkii we messed with baselineskip)
%D \stoptyping

% \unexpanded\def\startdisplaymath
%   {\bgroup
%    \par
%    \informulatrue
%    \beforedisplayspace
%    \par
%    \ifvmode
%      \prevdepth-\maxdimen % texbook pagina 79-80
%    \fi
%    \noindent % else funny hlist with funny baselineskip
%    $$% \Ucheckedstartdisplaymath
%    \setdisplaydimensions
%    \startinnermath}
%
% \unexpanded\def\stopdisplaymath
%   {\stopinnermath
%    $$% \Ucheckedstopdisplaymath
%    \par
%    \afterdisplayspace
%    \par
%    \egroup}

\newconstant\c_strc_formulas_space_model

\c_strc_formulas_space_model\plusone
%c_strc_formulas_space_model\plustwo % needs chdcking with spac-ver

\unexpanded\def\startdisplaymath
  {\bgroup
   \par
   \informulatrue
   \beforedisplayspace
   \par
   \ifvmode
     \ifcase\c_strc_formulas_space_model
       % nothing
     \or
       % nothing yet
     \or
       \prevdepth-\maxdimen % texbook pagina 79-80
     \fi
   \fi
   \noindent % else funny hlist with funny baselineskip
   \Ucheckedstartdisplaymath
   \setdisplaydimensions
   \startinnermath}

\unexpanded\def\stopdisplaymath
  {\stopinnermath
   \Ucheckedstopdisplaymath
   \par
   \ifvmode
     \ifcase\c_strc_formulas_space_model
       % nothing
     \or
       \prevdepth .5\strutdp
     \or
       \prevdepth\lineheight
     \fi
   \fi
   \afterdisplayspace
   \par
   \egroup}

% already defined
%
% \let\startinnermath\empty
% \let\stopinnermath \empty

% \defineformulaalternative[multi][\begindmath][\enddmath]
%
% \fakewords{20}{40}\epar
% \placeformula {a} $$              \fakespacingformula $$
% \fakewords{20}{40}\epar
% \placeformula {b} \startformule   \fakespacingformula \stopformule
% \placeformula {b} \startformule   \fakespacingformula \stopformule
% \fakewords{20}{40}\epar
% \placeformula {c} \startmdformule \fakespacingformula \stopmdformule
% \placeformula {c} \startmdformule \fakespacingformula \stopmdformule
% \fakewords{20}{40}\epar
% \placeformula {d} \startmpformule \fakespacingformula \stopmpformule
% \placeformula {d} \startmpformule \fakespacingformula \stopmpformule
% \fakewords{20}{40}\epar
% \placeformula {e} \startsdformule \fakespacingformula \stopsdformule
% \placeformula {e} \startsdformule \fakespacingformula \stopsdformule
% \fakewords{20}{40}\epar
% \placeformula {f} \startspformule \fakespacingformula \stopspformule
% \placeformula {f} \startspformule \fakespacingformula \stopspformule
% \fakewords{20}{40}

\unexpanded\def\startsubformulas
  {\dosingleempty\strc_formulas_start_sub_formulas}

\def\strc_formulas_start_sub_formulas[#1]%
  {\edef\currentsubformulasreference{#1}%
   \global\settrue\c_strc_formulas_inside_formulas_sub
   \strc_formulas_handle_sub_number}

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

%D Named subformulas (to be redone)

\unexpanded\def\startnamedsubformulas
  {\dosingleempty\strc_formulas_start_named_sub_formulas}

\def\strc_formulas_start_named_sub_formulas[#1]#2%
  {\setformulalistentry{#2}%
   \startsubformulas[#1]}

\unexpanded\def\stopnamedsubformulas
  {\stopsubformulas}

%D Experimental goodie:
%D
%D \startbuffer
%D \placelist[formula][criterium=text] \blank[2*big]
%D \placenamedformula[one]{first}  \startformula a = 1 \stopformula \endgraf
%D \placeformula                   \startformula a = 2 \stopformula \endgraf
%D \placenamedformula     {second} \startformula a = 3 \stopformula \endgraf
%D \stopbuffer
%D
%D \typebuffer \getbuffer

\unexpanded\def\startformulas
  {\dosingleempty\strc_formulas_start_formulas}

\def\strc_formulas_start_formulas[#1]#2\stopformulas % new / to be internationalized
  {\bgroup
   \dostarttagged\t!formulaset\empty
   \global\settrue\c_strc_formulas_inside_formulas
   \edef\currentformulasreference{#1}%
   \strc_formulas_handle_number
   \let\currentformula\empty
   \strc_formulas_forget_display_skips
   \startdisplaymath
   \setlocalhsize
   \unexpanded\def\startformula##1\stopformula
     {\advance\scratchcounter\plusone}%
   \scratchcounter\zerocount
   #2% preroll
   \ifcase\scratchcounter\else
     \divide \hsize \scratchcounter
   \fi
   \hbox to \localhsize \bgroup
     \hss
     \let\startformula\strc_formulas_nested_formula_start
     \let\stopformula \strc_formulas_nested_formula_stop
     #2%
     \egroup
   \stopdisplaymath
   \global\setfalse\c_strc_formulas_inside_formulas
   \dostoptagged
   \egroup
   \the\everyresetformulas
   \hangafter\minusone    % added for side floats
   \hangindent\zeropoint} % added for side floats

\unexpanded\def\strc_formulas_nested_formula_start
  {\Ustartmath
   \vcenter\bgroup
   \vskip-\strutdepth
   \Ustartdisplaymath}

\unexpanded\def\strc_formulas_nested_formula_stop
  {\Ustopdisplaymath
   \egroup
   \Ustopmath
   \hss}

% place

\def\m_strc_formulas_flag_inhibit{-}
\def\m_strc_formulas_flag_force  {+}

\def\strc_formulas_check_reference#1#2%
  {#1\unless\ifx\namedformulaentry\empty % \relax % new 29/8/2010
     \plusthree
   \else\ifx#2\empty
     \zerocount
   \else\ifx#2\m_strc_formulas_flag_force
     \plusone
   \else\ifx#2\m_strc_formulas_flag_inhibit
     \plustwo
   \else
     \plusthree
   \fi\fi\fi\fi}

\unexpanded\def\formulanumber
 {\strc_formulas_number} % for the moment

\def\strc_formulas_number
  {\dosingleempty\strc_formulas_number_again}

\def\strc_formulas_number_again[#1]%
  {\def\currentformulareference{#1}%
   \dosinglegroupempty\strc_formulas_number_indeed}

\unexpanded\def\placeformula
  {\global\settrue\c_strc_formulas_inside_place
   \settrue\c_strc_formulas_increment
   \dosingleempty\strc_formulas_place}

\unexpanded\def\placesubformula
  {\global\settrue\c_strc_formulas_inside_place_sub
   \setfalse\c_strc_formulas_increment
   \dosingleempty\strc_formulas_place}

\def\strc_formulas_place[#1]%
  {\def\currentplaceformulareference{#1}%
   \let\currentplaceformulasuffix\empty
   \doifelsenextbgroup\strc_formulas_place_yes\strc_formulas_place_nop\strc_formulas_place_nop} % [ref]{}

\def\strc_formulas_place_yes#1%
  {\def\currentplaceformulasuffix{#1}%
   \strc_formulas_place_nop}

\def\strc_formulas_place_nop
  {\doifelsenextchar$\strc_formulas_place_pickup\strc_formulas_place_indeed} % [ref]$$ [ref]\start

\def\strc_formulas_place_indeed
  {\strc_formulas_place_numbering}

\def\strc_formulas_place_pickup$$#1$$%
  {\strc_formulas_place_numbering
   \strc_formulas_start_formula{}#1\strc_formulas_stop_formula}

\let\startplaceformula\placeformula
\let\stopplaceformula \relax

% to be checked

\let\strc_formulas_place_number       \relax
\let\strc_formulas_place_number_nested\gobbletwoarguments

\def\strc_formulas_place_number_nested_indeed#1#2%
  {\def\currentnestedformulareference{#1}%
   \def\currentnestedformulasuffix{#2}%
   \glet\strc_formulas_place_number\relax
   \strc_formulas_check_reference\c_strc_formulas_nested_number_mode\currentnestedformulareference
   \ifcase\c_strc_formulas_nested_number_mode
     % nothing
   \or
     \strc_formulas_number % hm, looks ahead for []
   \or
     % nothing
   \or
     \strc_formulas_number % hm, looks ahead for []
   \fi}

\def\strc_formulas_place_number_indeed
  {\glet\strc_formulas_place_number\relax
   \doifelse{\formulaparameter\c!location}\v!left
     {\normalleqno{\strc_formulas_number_indeed}}
     {\normalreqno{\strc_formulas_number_indeed}}}

% todo

\unexpanded\def\placenamedformula
  {\dosingleempty\strc_formulase_place_named}

\def\strc_formulase_place_named
  {\iffirstargument
     \expandafter\strc_formulase_place_named_yes
   \else
     \expandafter\strc_formulase_place_named_nop
   \fi}

\def\strc_formulase_place_named_yes[#1]#2%
  {\setformulalistentry{#2}%
   \placeformula[#1]}

\def\strc_formulase_place_named_nop[#1]#2%
  {\setformulalistentry{#2}%
   \placeformula}

\let\namedformulaentry\empty % \relax % this will become a key/value so that we can do bookmarks

\unexpanded\def\setformulalistentry#1%
  {\gdef\namedformulaentry{#1}}

\protect \endinput

% \abovedisplayshortskip0pt \belowdisplayshortskip0pt \abovedisplayskip0pt \belowdisplayskip0pt \forgetall
%
% test       \par                      $$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx$$ \par test \par
% test       \par                      $$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx$$ \par test \par
% test plus  \par \prevdepth \maxdimen $$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx$$ \par test \par
% test minus \par \prevdepth-\maxdimen $$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx$$ \par test \par
%
% \parskip\baselineskip
%
% test       \par                      $$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx$$ \par test \par
% test       \par                      $$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx$$ \par test \par
% test plus  \par \prevdepth \maxdimen $$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx$$ \par test \par
% test minus \par \prevdepth-\maxdimen $$xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx$$ \par test \par

[-- Attachment #3: SubForm3.mkiv --]
[-- Type: application/octet-stream, Size: 577 bytes --]

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

\starttext
  \placeformula[eq:a]
    \startformula
      \fakeformula
    \stopformula

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

     \placeformula[eq:ba]
       \startformula
         \fakeformula
       \stopformula
     \placeformula[eq:bb]
       \startformula
         \fakeformula
       \stopformula
  \stopsubformulas

  See \in[eq:a] and \in[eq:b] and \in[eq:ba] and \in[eq:bb].
\stoptext

[-- Attachment #4: SubForm3.pdf --]
[-- Type: application/pdf, Size: 9006 bytes --]

[-- Attachment #5: Type: text/plain, Size: 485 bytes --]

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

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

* Re: Numbering subformulas
  2015-08-06  9:32     ` Procházka Lukáš Ing. - Pontex s. r. o.
@ 2015-08-06 10:07       ` Wolfgang Schuster
  2015-08-06 11:18         ` Procházka Lukáš Ing. - Pontex s. r. o.
                           ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: Wolfgang Schuster @ 2015-08-06 10:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1344 bytes --]

> Procházka Lukáš Ing. - Pontex s. r. o. <mailto:LPr@pontex.cz>
> 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

[-- Attachment #1.2: Type: text/html, Size: 2627 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

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

* Re: Numbering subformulas
  2015-08-06 10:07       ` Wolfgang Schuster
@ 2015-08-06 11:18         ` Procházka Lukáš Ing. - Pontex s. r. o.
  2015-08-06 11:42         ` Otared Kavian
  2015-08-06 14:03         ` Procházka Lukáš Ing. - Pontex s. r. o.
  2 siblings, 0 replies; 21+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2015-08-06 11:18 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hello,

great, thanks for explanation!

Best regards,

Lukas


On Thu, 06 Aug 2015 12:07:18 +0200, Wolfgang Schuster <schuster.wolfgang@gmail.com> 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:LPr@pontex.cz
Pontex s. r. o.      | mailto:pontex@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
___________________________________________________________________________________

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

* Re: Numbering subformulas
  2015-08-06 10:07       ` Wolfgang Schuster
  2015-08-06 11:18         ` Procházka Lukáš Ing. - Pontex s. r. o.
@ 2015-08-06 11:42         ` Otared Kavian
  2015-08-06 14:03         ` Procházka Lukáš Ing. - Pontex s. r. o.
  2 siblings, 0 replies; 21+ messages in thread
From: Otared Kavian @ 2015-08-06 11:42 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 3657 bytes --]

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 <schuster.wolfgang@gmail.com> wrote:
> 
>> Procházka Lukáš Ing. - Pontex s. r. o. <mailto:LPr@pontex.cz>	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
> ___________________________________________________________________________________


[-- Attachment #1.2: Type: text/html, Size: 7610 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

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

* Re: Numbering subformulas
  2015-08-06 10:07       ` Wolfgang Schuster
  2015-08-06 11:18         ` Procházka Lukáš Ing. - Pontex s. r. o.
  2015-08-06 11:42         ` Otared Kavian
@ 2015-08-06 14:03         ` Procházka Lukáš Ing. - Pontex s. r. o.
  2015-08-06 14:38           ` Otared Kavian
  2 siblings, 1 reply; 21+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2015-08-06 14:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 885 bytes --]

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:LPr@pontex.cz
Pontex s. r. o.      | mailto:pontex@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

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

[-- Attachment #2: SubForm4.mkiv --]
[-- Type: application/octet-stream, Size: 315 bytes --]

\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

[-- Attachment #3: SubForm4.pdf --]
[-- Type: application/pdf, Size: 10513 bytes --]

[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

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

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

* Re: Numbering subformulas
  2015-08-06 14:03         ` Procházka Lukáš Ing. - Pontex s. r. o.
@ 2015-08-06 14:38           ` Otared Kavian
  2015-08-06 15:41             ` Procházka Lukáš Ing. - Pontex s. r. o.
  0 siblings, 1 reply; 21+ messages in thread
From: Otared Kavian @ 2015-08-06 14:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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. <LPr@pontex.cz> 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:LPr@pontex.cz
> Pontex s. r. o.      | mailto:pontex@pontex.cz | http://www.pontex.cz
> Bezová 1658
> 147 14 Praha 4
> 
> Tel: +420 241 096 751
> Fax: +420 244 461 038<SubForm4.mkiv><SubForm4.pdf>___________________________________________________________________________________
> 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
___________________________________________________________________________________

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

* Re: Numbering subformulas
  2015-08-06 14:38           ` Otared Kavian
@ 2015-08-06 15:41             ` Procházka Lukáš Ing. - Pontex s. r. o.
  2015-08-06 21:03               ` Wolfgang Schuster
  0 siblings, 1 reply; 21+ messages in thread
From: Procházka Lukáš Ing. - Pontex s. r. o. @ 2015-08-06 15:41 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: text/plain, Size: 1972 bytes --]

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 <otared@gmail.com> 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:LPr@pontex.cz
Pontex s. r. o.      | mailto:pontex@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

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

[-- Attachment #2: SubForm4.mkiv --]
[-- Type: application/octet-stream, Size: 782 bytes --]

\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

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

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

    \chapter{Cha2}
      \section{A}
        \placeformula\startformula\fakeformula\stopformula

  \part{P2}
    \chapter{Cha1}
      \section{A}
        \placeformula\startformula\fakeformula\stopformula
\stoptext

[-- Attachment #3: SubForm4.pdf --]
[-- Type: application/pdf, Size: 10616 bytes --]

[-- Attachment #4: Type: text/plain, Size: 485 bytes --]

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

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

* Re: Numbering subformulas
  2015-08-06 15:41             ` Procházka Lukáš Ing. - Pontex s. r. o.
@ 2015-08-06 21:03               ` Wolfgang Schuster
  0 siblings, 0 replies; 21+ messages in thread
From: Wolfgang Schuster @ 2015-08-06 21:03 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 491 bytes --]

> Procházka Lukáš Ing. - Pontex s. r. o. <mailto:LPr@pontex.cz>
> 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

[-- Attachment #1.2: Type: text/html, Size: 1476 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

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

* Re: Numbering subformulas
  2012-10-15 14:58           ` Wolfgang Schuster
@ 2012-10-15 17:47             ` Hans Hagen
  0 siblings, 0 replies; 21+ messages in thread
From: Hans Hagen @ 2012-10-15 17:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Wolfgang Schuster

On 15-10-2012 16:58, Wolfgang Schuster wrote:
>
> Am 15.10.2012 um 13:45 schrieb Otared Kavian <otared@gmail.com>:
>
>> 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
___________________________________________________________________________________


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

* Re: Numbering subformulas
  2012-10-15 11:45         ` Otared Kavian
  2012-10-15 14:57           ` Hans Hagen
@ 2012-10-15 14:58           ` Wolfgang Schuster
  2012-10-15 17:47             ` Hans Hagen
  1 sibling, 1 reply; 21+ messages in thread
From: Wolfgang Schuster @ 2012-10-15 14:58 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 15.10.2012 um 13:45 schrieb Otared Kavian <otared@gmail.com>:

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


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

* Re: Numbering subformulas
  2012-10-15 11:45         ` Otared Kavian
@ 2012-10-15 14:57           ` Hans Hagen
  2012-10-15 14:58           ` Wolfgang Schuster
  1 sibling, 0 replies; 21+ messages in thread
From: Hans Hagen @ 2012-10-15 14:57 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Otared Kavian

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
___________________________________________________________________________________


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

* Re: Numbering subformulas
  2012-10-15 10:44       ` Andreas Mang
@ 2012-10-15 11:45         ` Otared Kavian
  2012-10-15 14:57           ` Hans Hagen
  2012-10-15 14:58           ` Wolfgang Schuster
  0 siblings, 2 replies; 21+ messages in thread
From: Otared Kavian @ 2012-10-15 11:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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 <mang@imt.uni-luebeck.de> 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
___________________________________________________________________________________


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

* Re: Numbering subformulas
  2012-10-14 21:22     ` Wolfgang Schuster
@ 2012-10-15 10:44       ` Andreas Mang
  2012-10-15 11:45         ` Otared Kavian
  0 siblings, 1 reply; 21+ messages in thread
From: Andreas Mang @ 2012-10-15 10:44 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

* Re: Numbering subformulas
  2012-10-14 20:25   ` Andreas Mang
@ 2012-10-14 21:22     ` Wolfgang Schuster
  2012-10-15 10:44       ` Andreas Mang
  0 siblings, 1 reply; 21+ messages in thread
From: Wolfgang Schuster @ 2012-10-14 21:22 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Otared Kavian


Am 14.10.2012 um 22:25 schrieb Andreas Mang <mang@imt.uni-luebeck.de>:

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


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

* Re: Numbering subformulas
  2012-10-14 19:07 ` Aditya Mahajan
@ 2012-10-14 20:25   ` Andreas Mang
  2012-10-14 21:22     ` Wolfgang Schuster
  0 siblings, 1 reply; 21+ messages in thread
From: Andreas Mang @ 2012-10-14 20:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Otared Kavian

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
___________________________________________________________________________________


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

* Re: Numbering subformulas
  2012-10-14 16:19 Otared Kavian
@ 2012-10-14 19:07 ` Aditya Mahajan
  2012-10-14 20:25   ` Andreas Mang
  0 siblings, 1 reply; 21+ messages in thread
From: Aditya Mahajan @ 2012-10-14 19:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 827 bytes --]

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

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

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

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

* Numbering subformulas
@ 2012-10-14 16:19 Otared Kavian
  2012-10-14 19:07 ` Aditya Mahajan
  0 siblings, 1 reply; 21+ messages in thread
From: Otared Kavian @ 2012-10-14 16:19 UTC (permalink / raw)
  To: mailing list for ConTeXt users

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
___________________________________________________________________________________


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

end of thread, other threads:[~2015-08-06 21:03 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-03 10:20 Numbering subformulas Procházka Lukáš Ing. - Pontex s. r. o.
2015-08-03 15:47 ` Procházka Lukáš Ing. - Pontex s. r. o.
2015-08-04  0:08 ` Aditya Mahajan
2015-08-05 23:25   ` Wolfgang Schuster
2015-08-06  9:32     ` Procházka Lukáš Ing. - Pontex s. r. o.
2015-08-06 10:07       ` Wolfgang Schuster
2015-08-06 11:18         ` Procházka Lukáš Ing. - Pontex s. r. o.
2015-08-06 11:42         ` Otared Kavian
2015-08-06 14:03         ` Procházka Lukáš Ing. - Pontex s. r. o.
2015-08-06 14:38           ` Otared Kavian
2015-08-06 15:41             ` Procházka Lukáš Ing. - Pontex s. r. o.
2015-08-06 21:03               ` Wolfgang Schuster
  -- strict thread matches above, loose matches on Subject: below --
2012-10-14 16:19 Otared Kavian
2012-10-14 19:07 ` Aditya Mahajan
2012-10-14 20:25   ` Andreas Mang
2012-10-14 21:22     ` Wolfgang Schuster
2012-10-15 10:44       ` Andreas Mang
2012-10-15 11:45         ` Otared Kavian
2012-10-15 14:57           ` Hans Hagen
2012-10-15 14:58           ` Wolfgang Schuster
2012-10-15 17:47             ` Hans Hagen

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