Skip to main content
10 votes
Accepted

Convert LaTeX to HTML with MathJax

Update: It is possible to use the direct colors now. Try this version of colortbl.4ht: % colortbl.4ht (2019-11-21-17:51), generated from tex4ht-4ht.tex % Copyright 1997-2009 Eitan M. Gurari % ...
michal.h21's user avatar
  • 51.3k
9 votes
Accepted

How to use my own HTML template with make4ht?

The easiest way is to use configurable hooks that TeX4ht provides for basic HTML configuration. Here is the basic info that is put in the .log file when you use the info option for make4ht: \Configure{...
michal.h21's user avatar
  • 51.3k
8 votes
Accepted

Pre-compiled mathjax output using mathjax node in make4ht or htlatex

Edit: The current version of make4ht now contains an extension for mjcli. It can be requested using make4ht -f html5+mjcli filename.tex Here is a sample document. There is a command line application ...
michal.h21's user avatar
  • 51.3k
8 votes
Accepted

after changing to \usepackage{fontspec} now make4ht do not compile my Latex file in lualatex mode

Edit: Fontspec support have been just added to tex4ht, you can get it after TL update. Both XeLaTeX and LuaLaTeX are supported, although the implementation is different for both engines. If you use ...
michal.h21's user avatar
  • 51.3k
8 votes
Accepted

htlatex, garamond fonts, and nulled "ff" and "fi" strings

The issue is that there are no support font files for EB Garamond or other fonts you tested. tex4ht needs supporting htf files for 8-bit fonts. They contain mappings from the font characters to ...
michal.h21's user avatar
  • 51.3k
7 votes
Accepted

A new problem with tex4ht and tikz

Try the following configuration file: \Preamble{xhtml} \tikzset{every node/.style={/pgf/tex4ht node/escape=true}} \begin{document} \EndPreamble From the TikZ manual: Selects the rendering method ...
michal.h21's user avatar
  • 51.3k
7 votes
Accepted

Use ODT Template for make4ht

Edit: the development version of make4ht has the following code integrated as odttemplate filter and extension. It can be used in the following way: make4ht -f odt+odttemplate filename.tex "...
michal.h21's user avatar
  • 51.3k
7 votes

make4ht for plain tex

It is not so straightforward to get TeX4ht working with Plain TeX. Ulrike already pointed to my older answer. We can use that as a starting point. Save the following code as plain-4ht.tex: % file ...
michal.h21's user avatar
  • 51.3k
7 votes
Accepted

Graphics scaling in tex4ht

Edit: The code bellow is now built-in to TeX4ht sources, you can require it using the Gin-percent option. It may take some time to be included in TeX Live though. That linked answer is really old and ...
michal.h21's user avatar
  • 51.3k
7 votes
Accepted

tex4ht place maintext and footnote in the same file

Sure, you can achieve what you want using the fn-in option: make4ht -x httest "fn-in" I would use make4ht instead of htxelatex, as it has much more features and fixes some issues. This is ...
michal.h21's user avatar
  • 51.3k
6 votes
Accepted

tex4ht corrupts "--" inside CDATA in the HTML file

Hyphen character is made active by \ScriptEnv command, which means that it calls a command when it is encountered in the environment defined with it. The ScriptEnv definition is little bit cryptic: \...
michal.h21's user avatar
  • 51.3k
6 votes

Ideal directory structure for make4ht, clean build

You can copy the generated files to different directory using make4ht with --output-dir (or -d) option, so you can try that: make4ht -d html tex/main.tex It will left your temporary files in ...
michal.h21's user avatar
  • 51.3k
6 votes
Accepted

make4ht cannot render newcommand in mathjax mode

Edit: It is now possible to use the \Configure{MathJaxMacros} command. See the MathJax how-to for an example. It seems you can put your macro definitions at the beginning of the HTML page and the ...
michal.h21's user avatar
  • 51.3k
6 votes
Accepted

All math in chapter or section titles is messed up after updating to latest TL 2022

When you encounter issues with math commands in TOC with the MathJax mode, you usually need to declare the problematic command using the \fixmathjaxtoc command. In this case, the issue is with \left ...
michal.h21's user avatar
  • 51.3k
5 votes
Accepted

Different SVG Output for mathematics symbols with dvisvgm used with htlatex or make4ht

Edit: As Martin mentioned in the comments, some glyphs may exceed it's bounding box, which may result in a cropping of theirs parts. It is possible to tell dvisvgm to trace the actual glyph shape ...
michal.h21's user avatar
  • 51.3k
5 votes

htlatex with minted

You can use --shell-escape (or -s shortdd) option provided by make4ht: make4ht -s document.tex If you want to use htlatex, it is a little bit more involved, as parameters for LaTeX are passed as ...
michal.h21's user avatar
  • 51.3k
5 votes
Accepted

Filenames of images in tex4ht

The original image files should be used by default. The behavior you describe is an issue which was caused by a recent update to the Graphics package. I've updated the TeX4ht sources with a fix, so it ...
michal.h21's user avatar
  • 51.3k
5 votes
Accepted

make4ht: can it generate framed html output?

You can try the frames option if really want to use frames. Like in this example: \documentclass{book} \usepackage{kantlipsum} \begin{document} \chapter{Hello} \kant[1-3] \chapter{World} \section{...
michal.h21's user avatar
  • 51.3k
5 votes
Accepted

tex4ht: using tikzexternalize still includes svg, not png

This is caused by the fact that TeX4ht now uses the pgfsys-dvisvgm4ht.def driver by default. It doesn't support the external library. Here is the version that fixes this issue: % Copyright 2021 by ...
michal.h21's user avatar
  • 51.3k
5 votes
Accepted

When compiling with make4ht, how to avoid generation of intermediate files that are corrupting the index of version control?

There is a method for cleaning the build files discussed on page 5 of the make4ht documentation. It involves using the -m clean option. This is done in a separate call to the command. To chain it ...
frabjous's user avatar
  • 41.7k
4 votes
Accepted

Use tabu with htlatex

The issue with tabu is that it redefines lot of LaTeX macros, which is the same thing as tex4ht does. And they clash with each other. It was quite hard to create patch file for tex4ht, tabu.4ht, that ...
michal.h21's user avatar
  • 51.3k
4 votes
Accepted

make4ht, tikz and utf-8 encoding question

The problem is that pgfsys-tex4ht.def sets the encoding of the SVG file to iso-8859-1: \pgfsys@invoke{<?xml version="1.0" encoding="iso-8859-1" standalone="no"?> This definition is hardwired ...
michal.h21's user avatar
  • 51.3k
4 votes
Accepted

Configuring htlatex for section names in html

Try this configuration file: \Preamble{xhtml} \newcounter{sectid} \def\myendp{\ifvmode\IgnorePar\fi\EndP} \Configure{section}{\stepcounter{sectid}\myendp\HCode{<div class="content" id="content-\...
michal.h21's user avatar
  • 51.3k
4 votes
Accepted

How to teach make4ht to understand newcommand properly?

This is a common issue regarding sub- and superscripts in TeX4ht. The _ and ^ characters are not active in the preamble, so commands defined here don't work correctly. It is best to use the \sp and \...
michal.h21's user avatar
  • 51.3k
4 votes

make4ht complains about "module 'luaxml-domobject' not found"

On Ubuntu (20.04), I had make4ht installed through the apt standard package texlive-extra-utils. And I have a similar error : ...texmf-dist/scripts/make4ht/filters/make4ht-domfilter.lua:2: module '...
Regman's user avatar
  • 41
4 votes

latex to html conversion with make4ht - pictures' width and height

You can find some information about image sizes in the work in progress TeX4ht documentation. By default, it uses dimensions provided by Graphicx package, so the value 345 is related to your \...
michal.h21's user avatar
  • 51.3k
4 votes
Accepted

Why does make4ht mathjax convert AMS gather environment to html code?

The default TeX4ht configurations turn gather environment into pictures. This configuration file should fix that: \Preamble{xhtml} \ConfigureEnv{gather}{}{}{}{} \begin{document} \EndPreamble Result: ...
michal.h21's user avatar
  • 51.3k
4 votes

Can I make cross-references between multiple HTML pages using make4ht/tex4ht?

The problem is that TeX4ht doesn't have access to values saved by \label inside math in the MathJax mode. All math contents are passed literally to MathJax, no expansion happens. Without label values, ...
michal.h21's user avatar
  • 51.3k

Only top scored, non community-wiki answers of a minimum length are eligible