filehook error with memoir after update texlive 2019 in Oct 15
Update 2020-02-04: both memoir
and filehook
were updated and now this problem shouldn't happen. If it does, please update your TeX distribution.
Here you have two problems at once. The first one was reported here, and is due to a bad timing of setting package hooks. This happens because filehook
loads filehook-memoir
, and filehook-memoir
does \RequirePackage{filehook}
, and this makes the option parser go off tracks and report that filehook
doesn't have a force
option (even though it does).
The issue has already been fixed here and will eventually be updated in the LaTeX format. For now, use this patch (this has to be the very first thing in your document):
\RequirePackage{etoolbox}
\makeatletter
\patchcmd\load@onefilewithoptions
{\expandafter\let\csname\@currname.\@currext-h@@k\endcsname\@empty
\let\CurrentOption\@empty% Anchor point to make sure we're patching the right place
}{}{}{\errmessage{This patch is no longer necessary}%
\newcommand\gobblesix[6]{}\gobblesix}
\patchcmd\load@onefilewithoptions
{\InputIfFileExists}
{\expandafter\let\csname\@currname.\@currext-h@@k\endcsname\@empty
\InputIfFileExists}{}{\FAILED}
\makeatother
After you get that out of the way, just tell filehook
to use the force
option until memoir
is updated (should be soon) and filehook-memoir
is updated to match the updated memoir
:
\PassOptionsToPackage{force}{filehook}
By the way, the problem doesn't depend on xsim
and fontspec
, also the problem arises with unicode-math
because it eventually loads filehook
, so the issue can be narrowed down to:
\PassOptionsToPackage{force}{filehook}
\documentclass{memoir}
\usepackage{filehook}
\begin{document}
\end{document}