As per my requirement, I need the tag <span class="inlinemath">...</span> for all inline math, so I've created the .cfg file like:
\Preamble{xhtml,fn-in}
\RequirePackage{etoolbox}% for the \forsvlist command
\newtoks\eqtoks
\def\AltMath#1${\eqtoks{$#1$}%
\HCode{\the\eqtoks}$}
\Configure{$}{\HCode{<span class="inlinemath">}}{\HCode{</span>}}{}
\begin{document}
\EndPreamble
Sample.tex
\documentclass{book}
\begin{document}
This is for test $a+b=c$ then complex equations $\frac{1}{2}+c=z$
\end{document}
Conversion:
htlatex test "test,xhtml" " -cunihft" "-cvalidate -p"
Converted HTML file:
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd-->
<html xmlns="http://www.w3.org/1999/xhtml"
>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta name="generator" content="TeX4ht (http://www.tug.org/tex4ht/)" />
<meta name="originator" content="TeX4ht (http://www.tug.org/tex4ht/)" />
<!-- xhtml,html,fn-in -->
<meta name="src" content="test.tex" />
<meta name="date" content="2017-08-16 14:36:00" />
<link rel="stylesheet" type="text/css" href="test.css" />
</head><body
>
<!--l. 5--><p class="noindent" >This is for test <span class="inlinemath"><span
class="cmmi-10">a </span>+ <span
class="cmmi-10">b </span>= <span
class="cmmi-10">c</span></span> then complex equations <span class="inlinemath"><img
src="test0x.png" alt="12" class="frac" align="middle" /> + <span
class="cmmi-10">c </span>= <span
class="cmmi-10">z</span></span>
</p>
</body></html>
This works fine, but in addition to my requirement, I need to change the HTML tag <span class="inlinemath"> to <span class="inlinemathimage"> when the tags \frac, \sqrt, \sum, comes in an inline math.
How can I achieve this? Please suggest
\frac,\sqrtand\sum? – michal.h21 Aug 16 '17 at 09:28