1

I have asked a question here old question, and I exactly follow the answer, now accent problem has been solved, but there are still some bugs. Here is my html, I have converted it to pictures. enter image description here enter image description here enter image description here enter image description here I think there are some bugs in default CSS setting of tex4ht or make4ht. Hope someone can fix them. I use texlive 2019.

1

OK, this seems like a lot of issues :) I've updated TeX4ht sources with most of the fixes presented here, so they should become unnecessary soon. Some issues were fixed also in make4ht, so you will need the development version.

Issue 1 - huge text.

It is caused by the extarticle class, because the document selects font size of 20pt as the base font size. TeX4ht can detect the font sizes and produce CSS instructions to use these sizes in the document. In this case we obviously don't want that.

To fix that, use the following version of extarticle.4ht:

\ifnum\@ptsize>12\relax
\renewcommand\@ptsize{10}
\input{size\@ptsize.clo}
\fi
\Hinput{extarticle}
\endinput

The size of \verb command will be fixed in the config file

Issue 2 - size of integrals

This was bug in TeX4ht, it generated wrong MathML structure.

Issue 3 - non-italic math text

Bug in make4ht, it should be fixed by the development version.

Issue 4 - missing \boldsymbol support

It should be supported now.

Note that some issues can be also caused by different rendering of MathML in contrast to TeX, it isn't always the same. I've noticed that for example the multi-line code in section 7 is broken to lines by Firefox, but it remains on one line when rendered by MathJax.

Here is the updated config file:

\Preamble{xhtml,mathml,fn-in,html5}  
\Css{body{  
    margin:40px auto;  
    max-width:36em;  
    line-height:1.6;  
    font-size:1em; 0.88em;  
    color:\#222;  
    background-color:\#FEFEF7;  
    padding:0 10px;}}  
\Css{h1,h2,h3{line-height:1.2}}  
\Css{p.indent{text-indent:0;}}  
\Css{@media (min-width: 29.63em){  
  :root {  
    font-size: 3vw;  
  }  
}}  

\Css{@media (min-width: 40.74em){  
  :root {  
    font-size: 1.375em;  
  }  
}}  




\Css{body {  
font-family: STIXGeneral, "Linux Libertine O", Gentium, Georgia,  
"Times New Roman",  "Iowan Old Style",  
 Palatino Linotype, Palatino, serif;  
}}  

\Configure{verb}{\NoFonts\HCode{<code>}}{\HCode{</code>}\EndNoFonts}
%\Css{code{font-family:monospace,monospace}}
\begin{document}  
\catcode`\:=11

\def\myop#1{\PauseMathClass\HCode{<mo accent="true">}#1\HCode{</mo>}\EndPauseMathClass}
\def\:vec:over{\ifmmode\expandafter\myop\fi{\x:unicode{2192}}}
\def\:grave:over{\ifmmode\expandafter\myop\fi{\x:unicode{0300}}}
\def\:acute:over{\ifmmode\expandafter\myop\fi{\x:unicode{0301}}}
\def\:hat:over{\ifmmode\expandafter\myop\fi{\x:unicode{0302}}}
\def\:widehat:over{\ifmmode\expandafter\myop\fi{\x:unicode{0302}}}
\def\:tilde:over{\ifmmode\expandafter\myop\fi{\x:unicode{0303}}}
\def\:widetilde:over{\ifmmode\expandafter\myop\fi{\x:unicode{0303}}}
\def\:bar:over{\ifmmode\expandafter\myop\fi{\x:unicode{0304}}}
\def\:breve:over{\ifmmode\expandafter\myop\fi{\x:unicode{0306}}}
\def\:dot:over{\ifmmode\expandafter\myop\fi{\x:unicode{0307}}}
\def\:ddot:over{\ifmmode\expandafter\myop\fi{\x:unicode{0308}}}
\def\:uml:over{\ifmmode\expandafter\myop\fi{\x:unicode{0308}}}
\def\:ring:over{\ifmmode\expandafter\myop\fi{\x:unicode{030A}}}
\def\:Huml:over{\ifmmode\expandafter\myop\fi{\x:unicode{030B}}}
\def\:check:over{\ifmmode\expandafter\myop\fi{\x:unicode{030C}}}
\def\:d:under{\ifmmode\expandafter\myop\fi{\x:unicode{0323}}}
\def\:cedil:under{\ifmmode\expandafter\myop\fi{\x:unicode{0327}}}
\def\:b:under{\ifmmode\expandafter\myop\fi{\x:unicode{0331}}}
\def\:udot:over{\ifmmode\expandafter\myop\fi{\x:unicode{0361}}}


% handle integrals
\def\:tempc{\ifDisplayMath\mathop:prefix{largeop="true"}\fi\o:n:int::}
\HLet\n:int:\:tempc


\renewcommand\boldsymbol[1]{\HCode{<mstyle class="boldsymbol" mathvariant="bold-italic">}#1\HCode{</mstyle>}}

\def\mathop:prefix#1{%
   \Configure{mathop}{*}{<\a:mathml mo #1\Hnewline>}{</\a:mathml mo>}%
    {\Configure{mathop}{*}{<\a:mathml mo>}{</\a:mathml mo>}{}}}
\catcode`\:=12
\EndPreamble

enter image description here

enter image description here

enter image description here

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.