[tex4ht] [bug #488] \over does not give the same result as equivalent \frac

Michal Hoftich puszcza-hackers at gnu.org.ua
Mon Oct 26 23:35:17 CET 2020

Follow-up Comment #1, bug #488 (project tex4ht):

The simplest thing you can do is to convert your whole inline math to image,
using for example:

httex filename "xhtml,html5,pic-m"

Also, it works in MathML:

htttex filename "xhtml,html5,mathml,mathjax"

As it works in MathML, it is obvious that it is possible to configure \over to
produce sensible output in plain HTML. Here is a sample HTML document:

${a+2 \over b} $

$  1 + \begingroup a \over b \endgroup + 2$

$  1 + \bgroup a \over b \egroup + 2$

$  1 + { a \over b \egroup + 2$

$  1 + \bgroup a \over b } + 2$

And here is a config file:


   {\Send{GROUP}{0}{<span class="fraction"><span

.fraction {
  display: inline-flex;
  flex-direction: column;
  padding: 0 2px;
  align-items: center;
\Css{.top {
  border-bottom: 2px solid grey;


It uses CSS flex box to render fractions. 

I don't really understand how \Send command works, as it is not really
documented anywhere in TeX4ht sources. But it can be used in these cases to
insert HTML code at beginning and end of the current group. It works only in
\DviMath mode, which is why the following configuration is necessary:


I don't know if it will have any side effects on other math configurations,
hopefully not.

Compile the example using 

make4ht -c config.cfg sample.tex


Reply to this item at:


  Message sent via/by Puszcza

More information about the tex4ht mailing list.