\usemodule[newmath]

\setupformulas[way=bytext,prefix=no]
\setupsubformulas[conversion=romannumerals]

\starttext
\title{List of formulas}

\placelist[formula][criterium=all,alternative=c]

\framed{not ok}

\chapter{Chapter One}

\chapter{Chapter Two}

\subject{math - formula}

Expected formular number: (1):

\placenamedformula[one]{Der einfache Test}
\startformula
c^2 = a^2 + b^2.
\stopformula

\framed{ok}

\subject{math - subformula}

Expected formular numbers: (2a) and (2b):

\startsubformulas[eq:1]
\placeformula[eq:first]
\startformula
PM \xrightarrow R_{PM} \xrightarrow PM
\stopformula

\placeformula[eq:second]
\startformula
R_{PM} = \{ K, F, Z, U, I, J\}
\stopformula
\stopsubformulas

\framed{not ok}

\subject{math - align - formula}

Expected formular numbers: (3a) and (3b) and a reference to formular (3b):

\startsubformulas
\startformulas
\placeformula
\startformula
\startalign[n=3, align={right,middle,left}]
\NC PM \xrightarrow \NC R_{PM} \NC \xrightarrow PM \NR[+]
\NC R_{PM} \NC = \NC \{ A, B, C, D, E\} \NR[a]
\stopalign
\stopformula
\stopformulas
\stopsubformulas

\framed{not ok}

Expected formular numbers: (4) and (5)

\placeformula
\startformula
\startalign[n=3, align={right,middle,left}]
\NC PM \xrightarrow \NC R_{PM} \NC \xrightarrow PM \NR[+]
\NC R_{PM} \NC = \NC \{ A, B, C, D, E\} \NR[+]
\stopalign
\stopformula

\framed{ok}


\subject{math - align - subformula}

Expected formular numbers: (6.1), (6.2) and (6.c) plus referece on (6.1) and (6.2):

\placesubformula
\startformula
\startalign[n=3, align={right,middle,left}]
\NC PM \xrightarrow \NC R_{PM} \NC \xrightarrow PM \NR[gleichung1a][.1]
\NC R_{PM} \NC = \NC \{ A, B, C, D, E\} \NR[gleichung1b][.2]
\NC R_{PM} \NC = \NC \{ A, B, C, D, E\} \NR[+][c]
\stopalign
\stopformula

\framed{not ok}

Expected formular numbers: (8a) and (8b) plus reference on (8a and 8b):

\placesubformula
\startformula
\startalign[n=3, align={right,middle,left}]
\NC PM \xrightarrow \NC R_{PM} \NC \xrightarrow PM \NR[gleichung1a][+]
\NC R_{PM} \NC = \NC \{ A, B, C, D, E\} \NR[gleichung1b][]
\stopalign
\stopformula

\framed{not ok}

\subject{math - eqalignno - formula}

Taken from wiki and removed the subformulanumber. Expected formular numbers: (11), (12), (13) and (14):

\placeformula
\startformula
\eqalignno{
  c^2 &= a^2 + b^2  &\formulanumber \cr
  c &= \left(a^2 + b^2\right)^{\vfrac{1}{2}} &\formulanumber\cr
  a^2 + b^2 &= c^2  &\formulanumber \cr
  d^2 &= e^2        &\formulanumber \cr}
\stopformula

\framed{ok}

\subject{math - eqalignno - subformula}

Directly taken form wiki. Expected formular numbers:

%\placeformula
%\startformula
%\eqalignno{
%  c^2 &= a^2 + b^2  &\formulanumber{a} \cr
%  c &= \left(a^2 + b^2\right)^{\vfrac{1}{2}} &\subformulanumber{b}\cr
%  a^2 + b^2 &= c^2  &\subformulanumber{c} \cr
%  d^2 &= e^2        &\formulanumber\cr}
%\stopformula

\framed{not ok (does not work. subformularnumber is unknown)}

\stoptext
