4

The autonum package apparently doesn't like me to declare math modes to be unnumbered, and prefers to do this on its own. Can't really tell if this is intended behavior and if so, why.

\documentclass{article}
\usepackage{amsmath}
\usepackage{autonum}
\begin{document}

\begin{align*}
x &= a+b
\end{align*}

\end{document}
tchakravarty
  • 2,427
  • 3
  • 26
  • 45

2 Answers2

6

The idea of the autonum package is to automatically number only those equations that you reference in the text. Therefore using unnumbered maths environments alongside autonum does not make sense. Page 1 of the documentation says 'never use the starred form'.

Ian Thompson
  • 43,767
  • Hmm, I guess I should have read the manual. I was including some tex files which predated working with autonum and they used the starred versions pretty liberally. I didn;t think it would have bothered autonum. Thanks for your reply. My bad. – tchakravarty Jul 19 '12 at 15:01
  • 1
    @FgNu, Ian Thompson is completely correct with his reasoning. When I switched to using autonum myself, I searched for starred math environments and replaced them by their unstarred version in my documents, as I optimized for consistency. I now see, that this reduces compatibility to old documents. Is there interest to have a package option deciding between consistency (starred versions forbidden) and compatibility (starred versions as without autonum)? – Patrick Häcker Jul 19 '12 at 20:23
  • I think that actually should not be a problem. I can just put together a simple python script to go through my files and turn all starred environments into unstarred environments. – tchakravarty Jul 20 '12 at 10:03
  • It’s definitely bad design to have autonum break starred environments. At the very least, autonum should redefine \begin{align*} to be \begin{align} — the user should not be forced to destructively change their LaTeX before it being compatible with autonum. – Jollywatt Sep 07 '21 at 01:13
0

You can modify autonum.sty to work with align*, equation*, gather*, and \Cref by copying it into the directory of your main latex file and replacing \AtBeginDocument{<existing>} with

\AtBeginDocument{
<existing>
\ifdef{\Cref}{\autonum@generatePatchedReferenceCSL{Cref}}{}
\newenvironment{align*}{\align}{\endalign}
\newenvironment{equation*}{\equation}{\endequation}
\newenvironment{gather*}{\gather}{\endgather}
}
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. – Community Oct 16 '23 at 10:35