5

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: current result

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: wanted result

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.

7

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.