3

I am using mathtools in the following way:

\usepackage{mathtools}
\mathtoolsset{showonlyrefs,showmanualtags}

Then, to refer to equations I use \refeq{equation}.

What happens is that there is a numbering for the equation that appears in the text, but the (Eq-Number) does not appear next to the equation itself. In fact, there are no (Eq-Number) for any of the equations.

Any ideas what could cause that? Is there a way to force to have an equation number next to an equation?

Edit

Minimal example:

\documentclass[11pt,letterpaper]{article}
\usepackage{latexsym}
\usepackage{times}
\usepackage{amsfonts,eucal,amsbsy,amsthm,amsopn,amssymb}
\usepackage{color}
\usepackage{graphicx}
\usepackage{array}
\usepackage{url}
\usepackage{mathtools}

\mathtoolsset{showonlyrefs,showmanualtags}



\begin{document}


\begin{eqnarray}
A & = & B \label{eq:first}
\end{eqnarray}

see Equation ~\refeq{eq:first}

\end{document}
  • How do you define your equations? You should wrap them in \begin{equation} ... \end{equation} (or \begin{eqnarray} ... \end{eqnarray} depending if you have one or more rows you want to number...) - maybe you're just wrapping them in \[ \] or something? – Tomas Aschan Nov 17 '10 at 19:29
  • 2
    @Tomas: No eqnarray, please :-) – Joseph Wright Nov 17 '10 at 19:36
  • A complete minimal example might be useful. – Harald Hanche-Olsen Nov 17 '10 at 19:40
  • According to mathtools's manual, you are supposed to use \eqref{..} and not \refeq{..} \\ Beside this, the equation numbering is reintroduced not directly after inserting the \ref, but after two or sometimes three compilations. \\ For the question "Is there a way to force to have an equation number next to an equation?" : yes, you can use \tag{something}. – Jhor Feb 22 at 21:36
3

I see in your example that you are using eqnarray. This is well-known to be seriously defective, and a number of tools simply do not support it. I see that eqnarray does not show up in the mathtools manual, so I suspect the omission may not be accidental! Use the gather or align environments, as shown in the mathtools manual.

For more detail on the problems of eqnarray see the UK FAQ.

  • Works now. But I used with eqnarray \lefteqn in quite many places, so that I have more space for the line below the first line. It does work well with the align environment. Any replacement? Thanks. – kloop Nov 17 '10 at 20:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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