Here is an error from latexml (installed with brew install latexml on OS X):
$ latexml --dest tmp/book.xml main.tex
latexml (LaTeXML version 0.8.5)
processing started Thu Aug 26 13:19:17 2021
(Digesting TeX main...
(Loading /usr/local/Cellar/latexml/0.8.5/libexec/lib/perl5/LaTeXML/Package/TeX.pool.ltxml...
(Loading /usr/local/Cellar/latexml/0.8.5/libexec/lib/perl5/LaTeXML/Package/eTeX.pool.ltxml... 0.00 sec)
(Loading /usr/local/Cellar/latexml/0.8.5/libexec/lib/perl5/LaTeXML/Package/pdfTeX.pool.ltxml... 0.01 sec) 0.14 sec)
(Processing content .../main.tex...
Error:undefined:\include The token T_CS[\include] is not defined.
at main.tex; line 4 col 8 - line 4 col 8
Defining it now as <ltx:ERROR/>
...
I believe the include directive is LaTeX.
This is a book, so there are 20 files or so that are put together in a certain order by main.tex. The book compiles just fine on overleaf.
EDIT: Here is a simplified version of main.tex:
\include{preamble}
% more preamble files "include"-d here.
\begin{document}
\frontmatter
\input{titlepage}
% more frontmatter files here ...
\tableofcontents
\mainmatter
\input{chapter01n}
% more chapter files here ...
\appendix
\appendixpage
\addappheadtotoc
\input{appendixA}
% more appendix files here ...
\end{document}
The preamble has lots of \usepackage and \newcommand and such. The first statement in the preamble (actually called aprogpre2.tex) is:
\documentclass[reqno,10pt,english]{book}
\includebefore the document begins. The reason this breaks gave an error is that LaTeXML starts out assuming TeX input, and switches over to LaTeX when it sees a handful of LaTeX specific commands.\includeis not one of those commands. – Teepeemm Jan 24 '24 at 03:08