[Tex/LaTex] Compilation error with tex4ht when using the authblk package

authblktex4ht

The following example, taken from Adding more than one author with different affiliation and saved as example.tex, compiles well with pdflatex example.tex.

\documentclass[11pt,a4paper]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{authblk}

\title{More than one Author with different Affiliations}
\author[1]{Author A\thanks{A.A@university.edu}}
\author[1]{Author B\thanks{B.B@university.edu}}
\author[1]{Author C\thanks{C.C@university.edu}}
\author[2]{Author D\thanks{D.D@university.edu}}
\author[2]{Author E\thanks{E.E@university.edu}}
\affil[1]{Department of Computer Science, \LaTeX\ University}
\affil[2]{Department of Mechanical Engineering, \LaTeX\ University}

\renewcommand\Authands{ and }

\begin{document}
  \maketitle
\end{document}

But with mk4ht oolatex example.tex I get three times the error message "! Illegal parameter number in definition of \@author." and not the desired output file.

Best Answer

authblk redefines standard LaTeX commands, such as \maketitle and \author. As these commands are redefined by tex4ht as well, it is not surprise that they clash each other. The fix is easy in this case. Save the following code as authblk.4ht:

\def\maketitle{\bgroup%
  \AB@maketitle%
\egroup}

\endinput

This fixes \maketitle definition provided by authblk and your can be compiled without errors.

enter image description here

Related Question