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

Michal Hoftich puszcza-hackers at gnu.org.ua
Tue Oct 27 21:24:36 CET 2020

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

I've modified the CSS code to produce a better result - the fractions are now
vertically aligned and font sizes are better:

% \Configure{over}
%    {\Send{GROUP}{0}
%       {<\a:mathml mfrac><\a:mathml mrow>}\HCode{</\a:mathml mrow>}}
%    {\HCode{<\a:mathml mrow>}\Send{EndGROUP}{0}
%       {</\a:mathml mrow></\a:mathml mfrac>}}
   {\Send{GROUP}{0}{<span class="fraction"><span

.fraction {
  display: inline-flex;
  flex-direction: column;
  padding: 0 2px;
  align-items: center;
  font-size:70\%; % to get correct box size
  vertical-align: 50\%;

% reset font size, it will be downsized to 70% by HT fonts
\Css{.fraction span{font-size:1rem;}}

\Css{.top {
  border-bottom: 2px solid grey;


We will definitely add this to TeX4ht sources once we find a good CSS that
works in all cases. We may use this method also for \frac and other more
complicated formatting that uses images at the moment. It should result in
much better inline math than in the current state, where text and images are
used. We may even try to use it for display math, where we use images by


Reply to this item at:


  Message sent via/by Puszcza

More information about the tex4ht mailing list.