# package autonum needs the obsolete etex package

With an up to date TL 2015, the following minimal example:

% \RequirePackage{etex}
\documentclass{article}

\usepackage{l3keys2e}
\usepackage{titlesec}
\usepackage{footmisc}
\usepackage{booktabs}
\usepackage{mathtools}
\usepackage{microtype}
\usepackage{enumitem}
\usepackage{bookmark}
\usepackage{glossaries}
\usepackage{autonum}

\begin{document}
\end{document}


is non working:

Package etex Warning: Extended allocation already in use.
(etex)                etex.sty code will not be used.
(etex)                \RequirePackage{etex}
(etex)                at the start of the document.

)
! Undefined control sequence.
l.905 \globcount
\ettl@for@nested
?
! Undefined control sequence.
l.905 \globcount\ettl@for@nested

?


because of the autonum package. But, it becomes working as soon as:

• either one of the packages before autonum is removed (not relevant in my case: I need these packages),
• or autonum is loaded before the other packages (not relevant in my case: I also need the cleveref package which is required to be loaded as the last one, with two exceptions: hypdvips and... autonum),
• or the etex package is loaded, as suggested in the above warning (but this package is nowadays considered as obsolete).

Do you understand what's going on? Is it safe to use etex though it is obsolete?

• It should be safe; please tell the author to update the package. Jan 4, 2016 at 17:13
• @egreg What kind of update the author should perform? Jan 4, 2016 at 17:14
• Not calling etex, for instance. Which means not using etextools, which is buggy and not recommended. Jan 4, 2016 at 17:15
• Since this is a package bug, i suggest closing this question. Jan 4, 2016 at 17:24
• @Johannes_B: Okay, I close it. Jan 8, 2016 at 15:58

The autonum package loads etextools, a package I don't recommend using and that has been declared “dead” by its author, as far as I remember.

For strange reasons, after loading etex, the package has a declaration \globcount\ettl@for@nested which could have been \newcount from the beginning.

Workaround: define \globcount to be \newcount before loading autonum.

\documentclass{article}

\usepackage{l3keys2e}
\usepackage{titlesec}
\usepackage{footmisc}
\usepackage{booktabs}
\usepackage{mathtools}
\usepackage{microtype}
\usepackage{enumitem}
\usepackage{bookmark}
\usepackage{glossaries}

%\expandafter\def\csname ver@etex.sty\endcsname{3000/12/31}
\let\globcount\newcount
\usepackage{autonum}

\begin{document}
\end{document}


Uncomment the line starting with % if you also want to get rid of the warning about etex.

• Your solution does not scale well. The code will break on January 1st, 3001. In other words, have my upvote ;) Jan 4, 2016 at 23:45
• @HenriMenke I did it with the secret hope that by 3001-01-01 these issues will have been straightened up: LaTeX3 will have been released. Perhaps. Jan 4, 2016 at 23:47
• It's not even the year 3001 yet and an update to etex.sty (version 2.5) has been submitted to ctan to address this issue. Jan 7, 2016 at 14:16
• I had a similar problem when autonum complained about \ifempty already being defined. In my case, \undef\ifempty before loading autonum was sufficient (I believe \undef comes from the etoolbox package).
– user61658
May 30, 2017 at 15:30