After yesterday's unsuccessful attempt, I am continuing in my attempts to find out the limits of autonum
. It seems that flalign
and alignat
environments break autonum
. Here is an MWE that works fine:
\documentclass[8pt]{article}
\usepackage{amsmath,amsthm,hyperref,cleveref,autonum}
\newtheorem{thm}{Theorem}
\crefname{thm}{theorem}{theorems}
\Crefname{thm}{Theorem}{Theorems}
%======================================
% MWE 1
\begin{document}
\begin{thm}\label{thm1}
This is a very important theorem.
\end{thm}
\begin{thm}\label{thm2}
Another very important theorem.
\end{thm}
The first theorem is \cref{thm1}, and the second is \cref{thm2}.
\end{document}
One which has an alignat
(resp. flalign
) environment, does not compile so smoothly:
\documentclass[8pt]{article}
\usepackage{amsmath,amsthm,hyperref,cleveref,autonum}
\newtheorem{thm}{Theorem}
\crefname{thm}{theorem}{theorems}
\Crefname{thm}{Theorem}{Theorems}
%======================================
% MWE 2
\begin{document}
\begin{thm}\label{thm1}
This is a very important theorem.
\end{thm}
%\begin{flalign}
%x &= y \implies & y &= x \label{eq4}\\
%y &= z \implies & z &= y \label{eq5}\\
%v &= w \implies & w &= v \label{eq6}
%\end{flalign}
\begin{alignat}{3}
x &= y \implies & y &= x \label{eq4}\\
y &= z \implies & z &= y \label{eq5}\\
v &= w \implies & w &= v \label{eq6}
\end{alignat}
\begin{thm}\label{thm2}
Another very important theorem.
\end{thm}
The first theorem, which appears before the \texttt{flalign} environment is \cref{thm1}, and the second, which appears after, is \cref{thm2}.
The first equation is \cref{eq4}.
\end{document}
My main problem then is that while autonum
provides support for some math environments, it does not for all. I wonder if there is a workaround where I can use it for the math environments it does provide support for and not have it interact with labels in other environments.
As before, my larger problem is to use cleveref
with a package that numbers only referenced equations.
Fisher's rule
and found it quite plausible. Applying it would also circumvent your problem ;-) Read about it in this article of David Mermin.article
document class does not recognize an8pt
option. Better to strike it from the MWEs.