[tex4ht] [bug #477] Support for new LaTeX hook management

Michal Hoftich michal.h21 at gmail.com
Tue Apr 18 15:58:06 CEST 2023

Hello Ulrike,

> while there certainly can/will be problems, this error here seems to be
> unrelated to \DocumentMetadata. I get an error with make4ht also for this:

thanks for this example. You are right. It seems that packages added
in \AddToHook{begindocument/before} or \AtBeginDocument are ignored
too. It is strange because I thought .4ht files captured them, but
they are not.

I was able to fix these hooks issues by manually calling:

\UseHook {begindocument/before}
\UseHook {begindocument}

in redefinition of the \document command in tex4ht.sty. I wonder if it
wouldn't break something else, as in the original version of
\document, the begindocument hook is called much later, after setting
various variables. It can break some things in theory. However, the
variables are mainly related to line width and similar stuff, which
don't matter much in the conversion process.

It doesn't fix the issue with \DocumentMetadata, but that can be fixed
by loading tex4ht.sty earlier by make4ht.

Best regards,

More information about the tex4ht mailing list.