Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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.

share|improve this question
1  
I recently read about Fisher's rule and found it quite plausible. Applying it would also circumvent your problem ;-) Read about it in this article of David Mermin. –  canaaerus Jul 20 '12 at 11:05
    
The following is a point not directly related to the problem you describe, but is of some relevance anyway: The article document class does not recognize an 8pt option. Better to strike it from the MWEs. –  Mico Jul 20 '12 at 11:12
    
Hah, I always make that mistake. –  fg nu Jul 20 '12 at 11:17
    
@canaaerus, there are different opinions about what to number and what not. All have plausible reasons. A good overview is given at tex.stackexchange.com/q/29267/7323 –  Patrick Häcker Jul 22 '12 at 20:23
    
I can confirm the bugs, thanks for finding them. I will have a look to see if it is possible to fully support both environments in autonum. If this is not possible, autonum must be changed to at least not break these environments. –  Patrick Häcker Jul 22 '12 at 20:26
add comment

1 Answer

up vote 2 down vote accepted

This was a bug, which is fixed with version 0.3. Both environments are now supported in autonum, such that automatic numbering should work as in amsmath's other math environments. Thanks for reporting.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.