# \startalign and \startcases are not compatible

In ConTeXt, it seems that \startalign and \startcases are not compatible. If so, what should I do when I want to align an equation containing a case-statement and a following equation?

\starttext

\placeformula
\startformula
\startalign % < -- Causes compilation error
\NC f(x) \NC
=\startcases
\NC 1, \MC x >0 \NR
\NC 0,\MC x \leq 0 \NR
\stopcases
\NC g(x) \NC =x^2 +2x +1
\stopalign % < -- Causes compilation error
\stopformula

\stoptext


Each line of a multi-line math align environment must be of the form:

\NC .... \NC .... \NR


So, you have to close the first line with \NR after the case environment:

\starttext
\startformula \startalign
\NC f(x) \NC =  \startcases
\NC 1,  \MC x >  0 \NR
\NC 0,  \MC x >= 0 \NR
\stopcases  \NR
\NC g(x) \NC = x^2 +2x +1   \NR
\stopalign \stopformula
\stoptext


• @TeXnician Totally – DG' Feb 22 at 12:35
• Oh, the first =0 in my question is superfluous. Since the text is invented, I overlooked that. Shall I edit it away for future reader? – Aminopterin Feb 22 at 13:09
• @DG' I changed the language a little bit. Hope that you don't mind. – Aditya Feb 22 at 16:02
• @Aditya On the contrary, I appreciate it – DG' Feb 22 at 16:11
• @TeXnician: sorry I misread your comment – Aditya Feb 23 at 5:17