I need to compile my .Rnw (Sweave) file into HTML, using Cambria as the default font and UTF-8 encoding so that e.g. Greek letters are represented correctly as characters in inline text (obviously equation mode is fine since those are embedded as image files).
Here's my "Hello, world!" tex document:
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Cambria}
\usepackage{Sweave}
\begin{document}
Lorem ipsum dolor, sit amet.
\end{document}
Then I run the command make4ht -xu foo.tex
and document conversion fails.
Relevant bits of the log seem to be:
This is XeTeX, Version 3.14159265-2.6-0.999992 (MikTeX 2.9.7300 64-bit)
<snip, no errors or warnings...>
(<path components>\tex/generic\tex4ht\fontspec-xetex.4ht
version 2017-01-24-15:21
! Undefined control sequence.
<argument> \fontspec_ht_scripts
l.23 ...{\typeout{use block #1}\xeunisuseblock{#1}}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
Compilation fails with exit code 1.
Compiling without fontspec and using pdflatex in place of xetex works fine. I haven't tried compiling with xetex and no fontspec.
2017 was a while ago... is it possible we just need to update our packages? I know fontspec support was only added to tex4ht within the last few years or so.
I'm in a very restricted environment so upgrading would be difficult, though not perhaps impossible.