-
Notifications
You must be signed in to change notification settings - Fork 6
Description
The upcoming June release will change the way counters are handled in theorems. The ltnews43 explicitly reads
Theorem-like environments like lemmas and definitions often use the same counter for the numbering. This makes it difficult to create suitable prefixes when referencing. We have therefore added a new command
\newcounteraliasthat allows to create an alias of a counter and so to use a counter under another name. The code is based on a similar command from the packagealiascnt. The command\newtheoremin LATEX and also inamsthmhas been changed to use\newcounteralias.
My understanding of this change is that aliascnt is no longer necessary at all, because the functionality will be provided out-of-the-box. Furthermore, the current prerelease versions (This is LuaHBTeX, Version 1.24.0 (MiKTeX 26.1) (format=lualatex-dev 2026.2.9) 10 FEB 2026 12:58) will error when using the standard aliascnt workflow:
\documentclass{article}
\usepackage{aliascnt,amsthm,hyperref}
\theoremstyle{definition}
\newtheorem{definition}{Definition}
\def\definitionautorefname{definition}
\def\axiomautorefname{axiom}
% old way:
\newaliascnt{axiom}{definition}
\newtheorem{axiom}[axiom]{Axiom} % ! LaTeX Error: Command \c@axiom already defined.
\aliascntresetthe{axiom}
% new way:
% \newtheorem{axiom}[definition]{Axiom}
\begin{document}
\begin{definition}\label{def}
Test
\end{definition}
\begin{axiom}\label{ax}
Test
\end{axiom}
Go to \autoref{def} -- \autoref{ax}
\end{document}hyperref is used just to check that indeed, the "old way" still works and produces the correct label. The error message is independent of hyperref. The simpler new way now also works as it should always have. I raise this issue here because eventually, aliascnt should deal with it, though since at the moment, it is a prerelease, one might perhaps also put the ball to firstaid?
How to deal with it? Provided the kernel is new enough, \aliascntresetthe should probably simply \@gobble. With \newaliascnt, it is more difficult. It should perhaps error and tell the user about this new feature to adapt the code. Maybe it could also look ahead and see whether it is directly (apart from spaces) followed by \newtheorem and then rewrite this macro (in this case only issuing a warning, which 99% of all users will ignore), assuming that the standard usage pattern is probably exactly this one, which comes directly from the documentation.