[tex4ht] problem using \sl and \sc in tex4ht when using matghjax mode

Nasser M. Abbasi nma at 12000.org
Sun Nov 18 20:27:02 CET 2018


There is problem translating Latex code to HTML when using
mathjax mode when latex uses the old \sl and \sc commands.

This is code generated by Maple Latex so it is not possible
to change it and not practical to edit it by hand each time
since this is autogenerated each time the files are compiled.

Maplesoft seems to have abandoned working maintaining its
Latex export for some other exotic math rendering software
so no chance this will fixed by them.

I do not know what I need to change in mathjax-latex-4ht.sty
to fix this.

Here is a MWE

----------------
\documentclass[11pt]{article}

\usepackage{amsmath,mathtools,amssymb}

\begin{document}
\begin{align*} %code below is copied from part of Maple's Latex
u  &= s{{\sl I}_{0}} \\
    &= s{{\sc I}_{0}} \\
    &= s{{\rm I}_{0}}
\end{align*}

\end{document}
------------------------

When compiled using mathjax mode, it gives

https://www.12000.org/tmp/11182018/screen_shot.jpg

I also tried using this class istead

\documentclass[11pt,enabledeprecatedfontcommands]{scrartcl}%this also fail

I also tried adding

\makeatletter
\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
\makeatother

But had no effect on resulting HTML.

This seems to affect only \sl and \sc commands, but there
might be more.

Is it possible to change mathjax-latex-4ht.sty to work around this?

The command I used to compile is the same as before and described
here

===================
make4ht -ulm default  -c ./nma_mathjax.cfg report.tex
       "htm,0,notoc*,p-width,charset=utf-8" " -cunihtf -utf8"

Where nma_mathjax.cfg is

-------------------------
\RequirePackage{mathjax-latex-4ht}
\Preamble{xhtml}
\begin{document}
\EndPreamble
-------------------

And mathjax-latex-4ht.sty is from

https://github.com/michal-h21/helpers4ht/blob/master/mathjax-latex-4ht.sty

========================

This problem only shows with mathjax. No problem when using SVG.

Thank you for any help.
--Nasser

  




More information about the tex4ht mailing list