I have a document that uses breqn, thm-restate (thmtools), and cleveref. I can't get it to compile.
Here is a minimal example:
\documentclass{article}
\usepackage{thm-restate}
\usepackage{breqn}
\usepackage{cleveref}
\begin{document}
\begin{restatable}{theorem}{foo}
Test
\end{restatable}
\end{document}
The output of pdflatex contains many errors like this:
! Extra \else.
<argument> \else
l.11 \end{restatable}
! Extra \else.
\cref@ifstreq ... \@firstoftwo \else \let \@tempc
\@secondoftwo \fi \expanda...
l.11 \end{restatable}
! Extra \else.
\cref@ifstreq ...i \expandafter \endgroup \@tempc
{#3}{#4}
I have tried multiple (I think all) orders to load the packages.
My feeling is that this can be fixed by changing the definition of \cref@ifstreq but this is beyond my current LaTeX skills.
Is there a workaround? Should I report a bug? (In which of the packages?)
I use TeX Live 2019, which has breqn 0.98g, thm-restate/thmtools 67, and cleveref 0.21.4. These are all the latest packages from CTAN except for thmtools, which I tried to update to 68 but that did not help either.
thmtools: if it had been more cautious with its expansion, the other packages using\@tempcwouldn't have been a problem. This same error can hapen withthmtoolsand other packages (other thancleverefandbreqn), but then it would require another unfortunate combination (which I looked for but couldn't find right now). – Phelype Oleinik Feb 10 '20 at 20:02thmtoolsis not maintained currently, not even the email address of the previous maintainer is active. I'll try to reach out to the maintainers ofbreqnorcleverefto see if they're willing to implement a workaround. – real-or-random Feb 12 '20 at 13:27breqn: the maintainer is more active thancleveref's. Alsocleverefis innocent in this issue. The problem really isthmtoolsbeing sloppy with its expansion andbreqnusing a generic, all purpose token to do something that needs to be done more carefully. – Phelype Oleinik Feb 12 '20 at 13:38breqnv0.98h, relased on 2020-02-16, see https://github.com/wspr/breqn/commit/686a9ff0f9a2ecb652a65c2fd1210430475f98e6. – real-or-random Feb 17 '20 at 10:30