When compiling this example file, obtained from suggest-a-nice-font-family-for-my-basic-latex-template-text-and-math
it gives an error
(/usr/local/texlive/2017/texmf-dist/tex/latex/mweights/mweights.sty)
(/usr/local/texlive/2017/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
Runaway argument?
{ \RequirePackage {fontaxes} \fa@naming@exception {figures}{{superior\ETC.
! Paragraph ended before \IfFileExists was complete.
<to be read again>
\par
l.25
?
Only when compiled using make4ht --lua foo.tex but no error with lualatex foo.tex
Why is that? Is this expected to happen or something else is going on?
Here is the example
\documentclass{article}
%taken from answer by @Mico
%https://tex.stackexchange.com/questions/59702/suggest-a-nice-font-family-for-my-basic-latex-template-text-and-math
\usepackage[T1]{fontenc}
\usepackage{ntheorem}
\newtheorem{theorem}{Theorem}
\usepackage{amsmath}
\usepackage{XCharter}
\DeclareMathOperator{\Res}{Res}
\usepackage[english]{babel}
\usepackage{blindtext}
\begin{document}
\blindtext
\pagestyle{empty}
\begin{theorem}[Residue Theorem]
Let $f$ be analytic in the region $G$ except for the isolated
singularities $a_1,a_2,\dots,a_m$. If $\gamma$ is a closed
rectifiable curve in $G$ which does not pass through any of the
points $a_k$ and if $\gamma\approx 0$ in $G$, then
\[
\frac{1}{2\pi i}\int_\gamma\! f = \sum_{k=1}^m
n(\gamma;a_k)\Res(f;a_k)\,.
\]
\end{theorem}
\end{document}
Now
>make4ht --lua foo_before.tex
Output dir:
Compiler: dvilualatex
Latex options: -jobname=foo_before
tex4ht.sty : xhtml,
tex4ht
build_file foo_before.mk4
Cannot open config file foo_before.mk4
setting param correct_exit
setting param correct_exit
setting param correct_exit
setting param ext
Adding: ext dvi
LaTeX call: dvilualatex -jobname=foo_before '\makeatletter\def\HCode{\futurelet\HCode\HChar}\def\HChar{\ifx"\HCode\def\HCode"##1"{\Link##1}\expandafter\HCode\else\expandafter\Link\fi}\def\Link#1.a.b.c.{\g@addto@macro\@documentclasshook{\RequirePackage[#1,html]{tex4ht}}\let\HCode\documentstyle\def\documentstyle{\let\documentstyle\HCode\expandafter\def\csname tex4ht\endcsname{#1,html}\def\HCode####1{\documentstyle[tex4ht,}\@ifnextchar[{\HCode}{\documentstyle[tex4ht]}}}\makeatother\HCode xhtml,.a.b.c.\input foo_before.tex'
This is LuaTeX, Version 1.0.4 (TeX Live 2017)
restricted system commands enabled.
LaTeX2e <2017-04-15>
(using write cache: /home/me/.texlive2017/texmf-var/luatex-cache/generic)(using read cache: /usr/local/texlive/2017/texmf-var/luatex-cache/generic /home/me/.texlive2017/texmf-var/luatex-cache/generic)
luaotfload | main : initialization completed in 0.130 secondsBabel <3.18> and hyphenation patterns for 1 language(s) loaded.
(./foo_before.tex
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/size10.clo(load luc: /home/m
e/.texlive2017/texmf-var/luatex-cache/generic/fonts/otl/lmroman10-regular.luc))
) (/usr/local/texlive/2017/texmf-dist/tex/generic/tex4ht/tex4ht.sty)
(/usr/local/texlive/2017/texmf-dist/tex/generic/tex4ht/usepackage.4ht)
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/t1enc.def)
(/usr/local/texlive/2017/texmf-dist/tex/latex/lm/t1lmr.fd))
(/usr/local/texlive/2017/texmf-dist/tex/latex/ntheorem/ntheorem.sty
Style `ntheorem', Version 1.33 <2011/08/15>
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/ifthen.sty))
(/usr/local/texlive/2017/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2017/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2017/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2017/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2017/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/texlive/2017/texmf-dist/tex/latex/xcharter/XCharter.sty
`XCharter' v1.112, 2017/12/19 Text macros for XCharter, an extension of Charter
(msharpe) (/usr/local/texlive/2017/texmf-dist/tex/latex/base/fontenc.sty
(/usr/local/texlive/2017/texmf-dist/tex/latex/cyrillic/t2aenc.def)
(/usr/local/texlive/2017/texmf-dist/tex/latex/ly1/ly1enc.def)
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/t1enc.def)
(/usr/local/texlive/2017/texmf-dist/tex/latex/psnfss/t1ptm.fd))
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/textcomp.sty
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/ts1enc.def))
(/usr/local/texlive/2017/texmf-dist/tex/latex/mweights/mweights.sty)
(/usr/local/texlive/2017/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
Runaway argument?
{ \RequirePackage {fontaxes} \fa@naming@exception {figures}{{superior\ETC.
! Paragraph ended before \IfFileExists was complete.
<to be read again>
\par
l.25
?
Using latest texlive, updated yesterday. On Linux.

latex --versioncommand and replace that phrase until while waiting for answer... – koleygr Mar 28 '18 at 21:47