[tex4ht] Possible bug in tex4ht

Michal Hoftich michal.h21 at gmail.com
Sun Jan 31 10:56:07 CET 2021

Hello Trent,

>Apologies if this is not the best place to submit a bug report -- I am
>trying out this mailing group thing for the first time -- but I think I am
>running into a bug with tex4ht. I am also fairly new with LaTex in general,
>so please bear with me if I am missing something obvious. I am trying to
>use TikZ in Emacs Org Mode via a LaTeX source block. For testing purposes,
>I am trying to compile the following block:

It is a good place, of course. 

>Trying to compile this with pdfTex fails; the shell outputs the following
>! Undefined control sequence.
>l.140 \AtBeginEnvironment
> [tex4ht]{abstract}{\ConfigureEnv{center}{\a:abstrac...
>! Emergency stop.
>l.140 \AtBeginEnvironment
> [tex4ht]{abstract}{\ConfigureEnv{center}{\a:abstrac...
>No pages of output.

Do you execute TeX4ht explicitly (using `htlatex` or `make4ht` 
commands)? You shouldn't get this error just with `pdflatex`, as it 
shouldn't execute TeX4ht configuration files unless TeX4ht is explicitly 

Could you please provide a TeX file that is generated by Org mode, 
command you use for compilation and maybe the .log file?

>I tried to track down where AtBeginEnivronment is from, with me being new
>to debugging LaTeX, a quick search suggests it is from the etoolbox
>package. Looking up the AtBeginEnvironment in the manual here:
>it looks like the definition is missing the `[tex4ht]`, so my best guess is
>that the control sequence is being invoked improperly in 

The \AtBeginEnvironment command is defined by current LaTeX kernel, see


It is really strange that you run into this error, because I've added 
the \AtBeginEnvironment command just week ago. This means that you have 
fairly up-to date TeX distribution and this command should be available 
for you. 

Which TeX distribution do you use? If you use MikTeX, try to update 
LaTeX core and all packages.

Best regards,

More information about the tex4ht mailing list.