# tex4ht doesn't render \not correctly

I tried to htlatex the following code:

\documentclass{article}

\usepackage{amssymb}

\begin{document}

Given two sets $A,B$ such that $A$ is not a subset of $B$, i.e., $A\not\subseteq B$.

\end{document}


It compiles $\not\subseteq$ to something like $/\subseteq$. Is there a simple fix for that? Thanks.

EDIT: I refer to \subseteq just make things concrete (see an answer below for the usage of \nsubseteq. I wonder whether generally, \not could be modified to work for a general binary relation.

• what is strange is that a correct symbol is rendered in the html5 output, or with epub3. – michal.h21 Nov 27 '18 at 14:32

You can try the uni-html4 option for tex4ht. It configures some characters to use the Unicode encoding:

tex4ebook filename.tex "uni-html4"


I've modified the tex4ebook sources to use this option by default, as it uses the Unicode output anyway.

The result:

<!--l. 7--><p class="noindent" >Given two sets <span
class="cmmi-10">A,B </span>such that <span
class="cmmi-10">A </span>is not a subset of <span
class="cmmi-10">B</span>, i.e., <span
class="cmmi-10">A</span>⊈<span
class="cmmi-10">B</span>.
</p>

• Just out of curiosity: can we pass "uni-html4" to htlatex and how? – Yai0Phah Nov 27 '18 at 15:31
• @FrankScience sure, htlatex filename.tex "xhtml,uni-html4". the html5 option loads the Unicode declarations as well, which explain why make4ht produced a different output to tex4ebook - it uses the html5 output by default. – michal.h21 Nov 27 '18 at 16:32
• I discovered that tex4ht with option uni-html4 will compile \widehat to <span class='accentwidehat'> which seems ignored by the browser. – Yai0Phah Dec 10 '18 at 17:00
• @FrankScience you can try the new-accents option, it will convert hat to picture though. and it may have some side effects, I haven't explored this option fully yet. – michal.h21 Dec 10 '18 at 17:40
• @FrankScience ah, it needs to be new-accents,accent- option. and it needs LuaTeX or XeTeX to work correctly. – michal.h21 Dec 10 '18 at 17:52

You can use $\nsubseteq$ instead of $\not\subseteq. # MWE \documentclass{article} \usepackage{amssymb} \begin{document} Given two sets$A,B$such that$A$is not a subset of$B$, i.e.,$A\nsubseteq B\$.
\end{document}


## HTML Source:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html >
<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/)">
<!-- html -->
<meta name="src" content="temp245.tex">
>
<!--l. 6--><p class="noindent" >Given two sets <span
class="cmmi-10">A,B </span>such that <span
class="cmmi-10">A </span>is not a subset of <span
class="cmmi-10">B</span>, i.e., <span
class="cmmi-10">A </span><span
class="msbm-10">&#x2288; </span><span
class="cmmi-10">B</span>.
</body></html>


## Rendered HTML:

Given two sets A,B such that A is not a subset of B, i.e., AB.

• Thanks. In fact, I knew \nsubseteq. I am, however, trying to understand whether we can make \not generally working. – Yai0Phah Nov 27 '18 at 12:46
• @FrankScience, oh! Sorry, misunderstood. I don't know, but interesting question. – David Purton Nov 27 '18 at 12:51
• Well, that's due to the fact that I did not succeed to properly phrase the question, not a mistake from your part. And this answer should be useful for others (for example, it will be shown in the result of googling tex4ebook not subseteq). – Yai0Phah Nov 27 '18 at 12:55