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.

I always wanted to have a package like autonum. Well, it is finally here and its development is still under way, but I already have two problems:

  1. It does not work with eqnarray.

  2. When referencing to equation, there appears space in front of the number, e.g. ( 3).

Is that already possible to resolve or we'll have to wait?

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

\begin{document}

\begin{eqnarray}
a = g,\\
a = g.
\end{eqnarray}

\begin{equation}
a = g.
\label{tlabel}
\end{equation}

Reference to: (\ref{tlabel})

\begin{equation}
a = g.
\end{equation}

\end{document}
share|improve this question
1  
Why not to use eqnarray –  cgnieder Aug 22 '12 at 12:15
1  
And by autoref you mean autonum? –  Jonas Nyrup Aug 22 '12 at 12:23

2 Answers 2

up vote 6 down vote accepted

It is a bug in the new package autonum. A line end in the definition of \autonum@generatePatchedReferenceGeneral is not commented. (Another candidate for unwanted white spaces is \autonum@possiblyHideNumber.)

At a quick glance I didn't find any relevant white spaces at the line end, therefore disabling the line ends helps:

\endlinechar=-1
\usepackage{autonum}
\endlinechar=13

Or a little more defensive:

\edef\RestoreEndlinechar{\endlinechar=\the\endlinechar\relax}
\endlinechar=-1 %
\usepackage{autonum}
\RestoreEndlinechar

Also there is another problem, at \begin{document} an underfull \hbox warning is printed.

Further remarks:

  • The environment eqnarray is not recommended, see Kurt's answer or l2tabu

  • "Autonumbering" might be useful for the writer, but it forgets the reader. The equation number help to identify the equation. Referencing inside the text is just one application. Others might want to reference an equation of your work as well, but they can't because the number is missing. Therefore all equations or at least all relevant equations should be numbered, not only the equations that are referenced in the text.

share|improve this answer
    
l2tabu is full of interesting suggestions. Good reading! –  Pygmalion Aug 22 '12 at 14:39
1  
Thanks for directly giving the solution to the problems. I just uploaded version 0.3.1, which should fix these problems. –  Patrick Häcker Aug 25 '12 at 16:13

Well, not the answer you expect, but I would say: "Do not use eqnarray".

See the question \eqnarray vs \align for an explanation.

share|improve this answer
    
I am actively using latex for 15 years and only now I am aware of that... Thanks –  Pygmalion Aug 22 '12 at 14:40

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.