11

biblatex and autonum don't seem to work together in the newest version. Consider the following MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber]{biblatex}
\usepackage{autonum}

\begin{document}

\end{document}

I get the following error messages:

0 File ended while scanning use of \ettl@for@do1
0 pdflatex: \pdfmatch: repetition-operator operand invalid pdfTeX warning: pdflatex: \pdfmatch: repetition-operator operand invalid)Runaway argument?{{\blx@bibdata@i {\blx@tempb }}\blx@bibfiles \eappto \blx@tempa {\blx@xml@comme

After commenting out either biblatex or autonum, the errors disappear.

Deniz
  • 664
  • I can confirm this –  Jan 01 '15 at 21:44
  • 1
    The problem is in the fact that autonum uses etextools that takes the liberty of redefining \forlistloop in a way that is incompatible with what biblatex expects. I don't recommend using etextools, nor any package relying on it. – egreg Jan 01 '15 at 22:09
  • So far autonum (and some mathtools package option) are the only ways of achieving the desired automatic equation numbering, right? – Deniz Jan 01 '15 at 22:15
  • @Deniz I think so; but I also think that numbering only the referenced equations is a bad idea. – egreg Jan 01 '15 at 22:17
  • @egreg That is highly context-dependent. But thanks for pointing out the problem so fast - I guess the autonum package will need to be changed? – Deniz Jan 01 '15 at 22:26
  • 1
    See also https://github.com/plk/biblatex/issues/669 and https://github.com/plk/biblatex/issues/383. Related https://tex.stackexchange.com/q/431965/35864 – moewe Jun 04 '18 at 15:38

1 Answers1

11

The problem is in the fact that autonum uses etextools. Indeed, the error is reproducible also with

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber]{biblatex}
\usepackage{etextools}

\begin{document}

\end{document}

The problem is that etextools redefines \forlistloop in a way that is incompatible with what biblatex expects.

From what I see in autonum.sty, \forlistloop is not used, so it could be safe restoring it to the value biblatex is expecting. But there's no guarantee that other macros of biblatex use constructs made buggy by etextools.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[backend=biber]{biblatex}


\let\etoolboxforlistloop\forlistloop % save the good meaning of \forlistloop
\usepackage{autonum}
\let\forlistloop\etoolboxforlistloop % restore the good meaning of \forlistloop


\begin{document}

\begin{equation}
A\label{A}
\end{equation}

\begin{equation}
B\label{B}
\end{equation}

\ref{A}

\begin{equation}\label{C}
\begin{split} A\\ b \end{split}
\end{equation}

\end{document}

enter image description here

The functionality of autonum seems to be OK.

See also Incompatibility between etextools and etoolbox command \dolistloop (\forlistloop)?

egreg
  • 1,121,712
  • Thanks a lot. Before we finish this: If I add the following split environment (without any labels/references), I get several errors, and again, only in connection with both autonum and biblatex.
    `\begin{equation} \begin{split} A\\ b \end{split} \end{equation}`
    
    

    How do I correctly address this here on StackExchange? As a new question?

    – Deniz Jan 01 '15 at 22:45
  • 1
    @Deniz Sorry, with split some features of etextools are indeed used. I've changed into another fix – egreg Jan 01 '15 at 22:47
  • Now it still doesn't work when a subequations environment around align is used (and then referencing the equations inside the alignenvironment).... – Deniz Jan 01 '15 at 23:02
  • 2
    @Deniz Sorry, but etextools is buggy and its author abandoned it. However I have no problem with align in subequations. – egreg Jan 01 '15 at 23:03
  • @egreg I would like to know more about the bugs in etextools and that it is abondoned. Do you have any references? I know that he once wrote, that it is an experimental package, but I thought it would be proven by use now, as in my tests everything worked flawlessly with the exception of the macro conflict between etoolbox and etextools (which was caused by etoolbox, as etextools was first). – Patrick Häcker Jan 03 '15 at 13:20
  • @PatrickHäcker No, etextools came later than etoolbox and its biggest defect is trying to “improve” commands from etoolbox without ensuring compatibility. Had the developer used different command names, the problem would disappear. – egreg Jan 03 '15 at 13:32
  • Yes, etextools came later than etoolbox, but both packages added more functionality after their first release. I was referring to the definition of forlistloop, where both authors agreed on a solution, which, unfortunately, does not seem to be implemented up to this day. Anyway, do you know of more conflicting ("improved") macros or how to get such a list? – Patrick Häcker Jan 03 '15 at 13:52
  • @PatrickHäcker I don't really know whether etextools implemented \forlistloop and \forcsvlist before they were introduced in etoolbox. But etextools has always been marked as “experimental”, so no package author is bound to avoid conflicts with it: actually it's the opposite. – egreg Jan 03 '15 at 13:56
  • I try to reach Florent Chervet (the author of etextools) to fix the problem, but I do not know if his address is still valid. In the mean time autonum version 0.3.10 (soon to be on CTAN) basically contains the workaround above. Thanks to all involved for the analysis. – Patrick Häcker Jan 03 '15 at 17:41
  • @PatrickHäcker I've seen the update; never issue \makeatletter and \makeatother in a .sty file: the declarations are implicit at the beginning and end of it. So the line \makeatletter % The missing \makeatother command is on purpose (as every other combination results in an error). should be removed altogether. – egreg Jan 04 '15 at 17:23
  • @PatrickHäcker: I have seen the "GL" (who is imho Florent Chervet) on c.t.t. and f.c.t.t. some days ago. – Ulrike Fischer Jan 05 '15 at 18:53
  • @UlrikeFischer: Thanks a lot for answering. I assume c.t.t and f.c.t.t are mailing lists or something similar. Could you please explain the abbreviations (that's hard for a search engine)? Do you know a valid mail address of him? – Patrick Häcker Jan 06 '15 at 14:36
  • c.t.t is comp.text.tex and f.c.t.t. is fr.comp.text.tex. This are newsgroups. I can see a mail adress in the newsreader but I don't know if it is valid. – Ulrike Fischer Jan 06 '15 at 15:07
  • I also mailed him about this very issue. Apart from that \forlistloop clash which is easily worked around as @egreg says, there are some really useful macros in etextools which fill some holes in a nice expandable way like \xifempty etc. – PLK Mar 19 '16 at 15:40
  • 2
    This solution does not work, and gives ! Package biblatex Error: Incompatible package 'etextools' – Jason Gross Feb 06 '18 at 21:32
  • 2
    @JasonGross It seems that now biblatex disallows loading etextools. You're doomed, sorry. – egreg Feb 06 '18 at 21:48
  • The example now needs the biblatex option noerroretextools to demote the incompatibility error message to a warning. – moewe Mar 17 '22 at 16:22