[tex4ht] [bug #337] tex4ht changes \_ in math mode to X in HTML when not including \usepackage[T1]{fontenc}

Michal Hoftich michal.h21 at gmail.com
Tue Aug 9 19:59:13 CEST 2016

Follow-up Comment #1, bug #337 (project tex4ht):

The problem is clearly this definition from latex.4ht:

   \def\csname ?\string\textunderscore\endcsname{\leavevmode#1}}

\HChar includes  special instruction for tex4ht DVI processor to replace next
character (which is X) with character with value 95. As math is converted to
image by other DVI processor (DVIPS or DVIPNG), which doesn't understand this
instruction, the character which should be removed, X, remains here instead of
_. we need to disable the use of \HChar in mathmode, use \mathunderscore

As a workaround, you can try the following:


   % \usepackage[T1]{fontenc} %do not use. Make tex4ht \verb not accept 
different fonts



\def\myunderscore{\ifmmode \mathunderscore\else\HChar{95}\fi}
    y = \_C1

hello \_C1


Reply to this item at:


  Message sent via/by Puszcza

More information about the tex4ht mailing list