# ConTeXt: custom \intertext

In a ConTeXt file, I would like to insert a line of text inside \eqalign.

When I use \intertext:

\starttext
\startalignment[middle]
\eqalign{ a &= b \cr \intertext{and} b &= c \cr }
\stopalignment
\stoptext


I get left-aligned equations with large vertical spacing around the inserted line:

I need a custom macro based on \intertext that:

• keeps the equations centered like all of my equations are,
• does not add vertical spacing.

The result should look like this:

My attempts at hacking ConTeXt's definition of \intertext:

\def\intertext#1%
{\noalign{\math_intertext{#1}}}

\unexpanded\def\math_intertext#1%
{\penalty\postdisplaypenalty
\afterdisplayspace
\vbox{\forgetall\noindent#1\par}%
\penalty\predisplaypenalty
\beforedisplayspace}


were unsuccessful.

The \intertext command adds the normal formula space set with the spacebefore and spaceafter keys from \setupformula.

\setupformula
[spacebefore=small,
spaceafter=none]

\starttext

\startformula
\startmathalignment
\NC a \EQ b \NR
\intertext{\midaligned{and}}
\NC b \EQ c \NR
\stopmathalignment
\stopformula

\stoptext