[tex4ht] Issues with unpaired brackets

Michal Hoftich michal.h21 at gmail.com
Thu Apr 13 15:23:47 CEST 2017


Thanks Bill,

On Thu, Apr 13, 2017 at 1:16 AM, William F Hammond <gellmu at gmail.com> wrote:
>
> I regard this as nonsensical source.  With real mathematical expressions
> things
> like $f(x$) and things like $a(b(c(d(e)))$ are common author mistakes.  I
> think they should be trapped at source level.  Using a suitable LaTeX
> profile is a way to do that.

In most cases it is probably mistake, but one can too often see
various hacks in TeX sources which can work in PDF but explode when
you want semantic output.

Some more realistic example is the following, coming from a real-world document:

\documentclass{article}
\usepackage{amsmath}
\newcommand{\Bv}{\mathbf{B}}
\begin{document}
\begin{equation}
\Bv = \frac{ \mu_0 m}{4 \pi \epsilon_0r^3}[3 \hat p \cdot \hat r) \hat
r - \hat {p}].
\end{equation}
\end{document}

I guess that there is missing left parenthesis between "[" and "3".


>
> I find it impossible to make a rational decision on how examples of this
> type should be handled by a translator.  Again I say, it would be better to
> trap nonsensical source.
>

These issues can be found in HTML validation. It is not that
straightforward to go from mathml snippet back to TeX source, but
probably only realistic way with tex4ht.

Best regards,
Michal


More information about the tex4ht mailing list