Skip to content

Issues using Make4ht

Valdinei Rodrigues edited this page Jan 22, 2024 · 5 revisions

Issues that need changes in LaTeX files

Colors (MWE)

You can use custom colors in LaTeX using color o xcolor packages. Both packages provide a common set of commands for color manipulation, but xcolor is more flexible and supports a larger number of color models, so is the recommended approach. [Using colors in LaTeX]

Normally, to change the color of a text you can use \color or \textcolor commands. The problem is that tex4ht doesn't support \color command, so you need to use \textcolor.

Ex.: Instead of using \color{red} some text, you should use \textcolor{red}{some text}.

PDF

HTML

Multiple line math equations

When using multiline math equations like

  • bmatrix
  • cases
  • array

You need to insert a line break before the last line of the equation using \\ (two backslashes), otherwise this last line will not be rendered in the HTML output from make4ht.

PDF

HTML

Math input errors (many specific cases)

Sometimes fbox can generate an math error

Use \boxed instead of \fbox

Phantom doesn't work in make4ht

Using \phantom directly with make4ht give us an "math input error", to avoid this you should use some package like ifpdf.

Ex.: Instead of using \phantom{=} use \ifpdf \phantom{=} \else \fbox{\phantom{=}} \fi.

PDF

HTML

Configuration issues

If using amsmath, mathtools or similar packages

Tex4ht MathML code has an error when you use tools like that with MathML. [Awnser by michal.h21].

You can include this configuration in the make4ht configuration file to fix it.

Figures size

Tables width and position

Still working in a solution to issue

Clone this wiki locally