I could not find exactly where the error is generated, but I've made a small example to reproduce it.
The example file is:
\documentclass{example}
\begin{document}
\keywords{ábaba \sep Abba2 \sep Ababa3}
\end{document}
Using the following example template:
\ProvidesClass{example}[2022/03/16 Example class]
\ProcessOptions\relax
\ExecuteOptions{}
\LoadClass{article}
\RequirePackage{mfirstuc}
% KEYWORDS % requires: mfirstuc
\def\sep{\unskip. }%
\newcommand{\capitalizekeywords}[2][\sep]{%
\def\dolist##1{\expandafter\@dolist##1#1\@eol}%
\def\@dolist##1#1##2\@eol{%
\begingroup\setbox0=\hbox{##1\unskip}\ifdim\wd0=0pt\endgroup\else\endgroup\ignorespaces\makefirstuc{##1}\unskip\sep\fi%
\ifx\@eol##2\@eol\else\@dolist##2\@eol\fi}%
\dolist{#2}%
}
\newcommand{\keywords}[1]{%
\emph{Keywords}: \capitalizekeywords{#1}\par
}
Compiling with XeLaTeX
works fine, but make4ht
crashes with the following error:
[ERROR] htlatex: ./example.tex 3 Missing \endcsname inserted.
[ERROR] htlatex: ./example.tex 3 Undefined control sequence.
[ERROR] htlatex: ./example.tex 3 Undefined control sequence.[ERROR] htlatex: ./example.tex 3 Undefined control sequence.
[ERROR] htlatex: ./example.tex 3 Undefined control sequence.
[ERROR] htlatex: ./example.tex 3 Use of \\capitalizekeywords doesn't match its definition.
[ERROR] htlatex: ./example.tex 3 Use of \\capitalizekeywords doesn't match its definition.
[ERROR] htlatex: ./example.tex 3 Use of \\capitalizekeywords doesn't match its definition.
[ERROR] htlatex: ./example.tex 3 Argument of \@dolist has an extra }.[ERROR] htlatex: ./example.tex 3 Paragraph ended before \@dolist was complete.[ERROR] htlatex: ./example.tex 3 Extra \else.
Note 1: When the commands are defined directly in the .tex
file, no error is generated.
Note 2: When there is no diacritical mark in the first character, for example: \keywords{abába \sep Abba2 \sep Ababa3}
, no error occurs.
make4ht
ormake4ht -x
, but from playing around with your samples, it seems like it works when compiling with the lua backend:make4ht -l test.tex
.