[tex4ht] unbalanced parentheses

William F Hammond hammond at csc.albany.edu
Tue Sep 6 20:27:04 CEST 2011


I wrote:

>> It's not the business of the typesetter to detect math errors, so it
>> really shouldn't complain.  Unbalanced parentheses are not always an
>> error, for sure.  Just a simple interval open at one end and closed at
>> the other ... (1,2]
>
> Unbalanced containers are a serious obstacle for translating LaTeX or
> LaTeX-like math to presentation MathML.  So sane processing under a
> LaTeX profile for this purpose would enforce the use of things like,
> for your example, \left(1,2\right]

I should say a bit more about my viewpoint.  A mathematical expression
has a semantic tree structure that ideally should be reflected in markup
used to represent it.

A more complicated case is presented by an expression that is carried
to a new line in a display, say with the following under amsart:

\[ \begin{aligned}
  a = & (b \\
      & +c)
\end{aligned}   \]

In this case there is incompatibility between the structure of the
mathematical expression tree and the markup tree.  (It could, however,
some day I suppose, be lamely modeled for markup using something like
the "transparent content model" of html5.)

Tex4ht will be happy with \left( .. \right. on row 1 and
\left. .. \right) on row 2, but that stretches mathematical semantics.

Another work-around is to enter '(' and ')' in the source in a way
that will cause the translator toward xml to deal with them as
unrelated operators -- again contrary to mathematical semantics, but I
don't know how to do that with tex4ht.

                                    -- Bill




More information about the tex4ht mailing list