[tex4ht] two additional issues converting latex to HTML with mathjax.

Michal Hoftich michal.h21 at gmail.com
Tue Sep 11 16:35:51 CEST 2018


Hi Nasser.

> So If  I can learn how to make one work in the .cfg file so that mathjax
> renders it OK, I'll add the rest myself. Here is an example of two
> such cases:

MathJax has in contrast to tex4ht extensive documentation, so I am
sure you should be able to find some examples here.
The tricky thing are commands with parameters, as the config file
produces errror when #1 is uses inside the configuration.
I've found a workaround using LaTeX3 regexes:

--------------------
\RequirePackage{mathjax-latex-4ht}
\Preamble{xhtml}
\begin{document}
\edef\mymathjaxconf{\detokenize{MathJax.Hub.Config({
        TeX: {
  Macros : {
relax: "{}",
setlength: ["{}", 2],
RootOf: "\\mathrm{RootOf}",
Ei: "\\mathrm{Ei}",
Aboxed: ["\\boxed{#1}", 1]
}},
});}}

\ExplSyntaxOn
\regex_replace_all:nnN{ \x{23}\x{23}}{\x{23}}{\mymathjaxconf}
\ExplSyntaxOff

\Configure{@HEAD}{\HCode{<script
type="text/x-mathjax-config"> \mymathjaxconf</script>}}
\EndPreamble
--------------


I cannot find a solution for the \Aboxed command, I cannot get box at all.

Aboxed: ["\\boxed{#1}", 1]

doesn't seem to work. I am sure some MathJax people can a solution for that.

Best,
Michal


More information about the tex4ht mailing list