I have had good experience with tex4ht (htlatex), but in a new article I am compiling, there are random cases where inline and display mode matrices are in italics when using $\mathbf{L}$ for inline and e.g.


for display mode. Is this likely due to not using $$ or \[ ... \] for html projects?

  • the default tex4ht configuration compiles your example to picture which keeps the used style. other solutions that should work is to use "mathjax" or "mathml,mathjax" tex4ht options on the command line or in the configuration file
    – michal.h21
    Commented Jun 28, 2019 at 6:57

1 Answer 1


Please try with the below:

%% your own.cfg%%
    {\bgroup \Tg<span class="bold">\PauseMathClass}%
    {\EndPauseMathClass\Tg</span>\egroup }%

Also, refer michal's suggestion on More TeX4ht issues with chrome and safari for better clarification...

  • Thanks, but adding that configuration to the .cfg and recompiling didn't fix the issue. Also, I only use \Preamble{xhtml} in the .cfg, since I am using the high-resolution .svg equation files, and not the default .png. This is accomplished by using a command line like htlatex myfile.tex "myfile.cfg,charset=utf-8,pic-m" " -utf8 -cunihft", which is performed by the pic-m option.
    – user62494
    Commented Jun 28, 2019 at 7:47
  • @JoleT Glad to hear that you fixed the issue...
    – MadyYuvi
    Commented Jun 28, 2019 at 9:06
  • It didn't fix the issue. Please re-read the comment above.
    – user62494
    Commented Jun 28, 2019 at 9:07
  • 1
    @JoleT when you use pictures, the math should look exactly the same as in the PDF. does it look correct in the PDF? there may be some issue caused by some package or macro
    – michal.h21
    Commented Jun 28, 2019 at 18:07
  • 1
    this was resolved, so thanks for the help. works like a charm, so no problems with MiKTeX 2.9, tex4ht, or DOS paths, and cmd escapes, etc.
    – user62494
    Commented Jun 28, 2019 at 18:44

You must log in to answer this question.