# [tex4ht] exerquiz problems

Michal Hoftich michal.h21 at gmail.com
Tue Jan 19 23:10:54 CET 2021

Dear Tomáš,

>Well, the error message suggests there might be a problem in the
>configuration file (split.cfg), but - when getting rid of the exerquiz
>environment, the error message disappears. It's strange, maybe there is
>some interference between the align and example environments?? I don't
>know.
>
>Attached is a tarball containing all files needed for running the
>example. The examples are two - one with the exercise environment
>heavily used (exerquiz_exx.tex) and another without using this
>environment (exerquiz_ex.tex, this one runs ok).

In this particular example, exerquiz_exx.tex, I've found a following
issue:

Vztah~(\ref{eq:cross_section_annihilation}) dává číselnou hodnotu
\begin{displaymath}
\label{eq:cross_section_value}
\sigma
=\frac{4\pi\left(\frac{1}{137}\right)^2\left(0{,}197~\gev\cdot\mathrm{fm}\right)^2}{3s}
\doteq 8{,}66\cdot 10^{-6}\frac{1}{s~[\gev^2]}~\mathrm{fm}^2
% = 2{,}232\cdot 10^{-5}~\gev^{-2} = \\
% & = 2{,}232\cdot 10^{-5}\times 0{,}197^2~\mathrm{fm}^2 = 8{,}7\cdot
% 10^{-7}~\mathrm{fm}\nonumber
\end{displaymath}

The issue is with the \label command. It compiles correctly when I
remove it. I think the issue is that displaymath is internally
equation*, which is unnumbered and it cannot produce a number in \ref
anyway.

There must be something else going on though, because when I try a
following MWE:

\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{displaymath}
a=b
\label{ahoj}
\end{displaymath}

Ref: \ref{ahoj}
\end{document}

it compiles without errors. It even produces hyperlinks, just the
hyperlink produced by \ref is empty, so you cannot click on it.

So there is something going on, but it would be best to remove the
\label from this displaymath, as it is not useful anyway. You even don't
reference it anywhere.

>I should also note that - even when getting the error messages - the
>resulting HTML page looks reasonably, but when adding more chapters,
>the code crashes. So apparently one should avoid these error messages
>for large documents....

I could compile the sample file using:

make4ht -f html5+dvisvgm_hashes -m draft -c split.cfg -a debug exerquiz_exx.tex "svg,2,fn-in"

The -f html5+dvisvgm_hashes option can significantly speed up the
compilation, because it reuses math images.

I've also introduced svg and fn-in options, the first one requires
SVG images, the second puts footnotes at the end of the chapter where
they were used, instead of standalone files.

>Maybe the problem can be fixed by an improvement in the configuration
>file split.cfg??
>

Other than that, I can see only one issue regarding validity of the
produced HTML files, there is spurious </form> element in the lasth
HTML file. I need to investigate where it comes from.

Best regards,
Michal