ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Procházka Lukáš Ing. - Pontex s. r. o." <LPr@pontex.cz>
To: ConTeXt <ntg-context@ntg.nl>
Subject: Re: Numbering subformulas
Date: Mon, 03 Aug 2015 17:47:46 +0200	[thread overview]
Message-ID: <op.x2st5weutpjj8f@lpr> (raw)
In-Reply-To: <op.x2se0usutpjj8f@lpr>

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

  reply	other threads:[~2015-08-03 15:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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. [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=op.x2st5weutpjj8f@lpr \
    --to=lpr@pontex.cz \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).