I have given simple code below:


This is for test $-3$ inline equation $-z a-3\sqrt[2]{a+b}$


Then I run the command htlatex test "xhtml" " -cunihft" "-cvalidate-p", it converts the first display equation as HTML tag and the second inline upto \sqrt, it converts as HTML tags and the remaining as image, check the image attached:

enter image description here

And the converted HTML as follows:

<?xml version="1.0" encoding="iso-8859-1" ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
<html xmlns="http://www.w3.org/1999/xhtml"  
<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 --> 
<meta name="src" content="test.tex" /> 
<meta name="date" content="2017-08-04 15:23:00" /> 
<link rel="stylesheet" type="text/css" href="test.css" /> 
<!--l. 6--><p class="noindent" >This is for test <span 
class="cmsy-10">&#x2212;</span>3 inline equation <span 
class="cmmi-10">za </span><span 
class="cmsy-10">&#x2212; </span>3<img 
src="test0x.png" alt="&#x221A; -----
2 a+ b"  class="root" align="middle"  />


Can you please advise me how htlatex decides which part should treat as images and which as HTML tags?

Thanks in advance...


Generally, content which can't be easily displayed using HTML is converted to images by default. This is the case of \sqrt of \frac, for example. Basic characters and numbers can be converted as HTML. Note also that display math is always converted.

You can use pic-m command line option to request conversion of inline math to images. Ideally, together with svg option, which will use SVG instead of bitmap images, it looks much better. Best option is of course to not use picture math at all, but use mathml and MathJax rendering.

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.