1

I have a problem opposite to most of the questions posted regarding the equation numbering. I would like to have a global numbering for equations, regardless of the section. With or without the package chngcntr, in the equation, it shows the global numbering, as wished.

However, when I try to refer these equation, the first one is correctly referred, but the second one includes the section number. See below for the minimal working example and the result.

Does anyone know why this is happening?

Thanks!

\documentclass[12pt,amsfonts,graphicx,subfigure,letterpaper]{article}
\usepackage{amsmath}


\usepackage{chngcntr}
\counterwithout{equation}{subsection}
\counterwithout{equation}{section} % undo numbering system provided by phstyle.cls

\begin{document}

\section{Section}
\label{sec:1} 

\subsection{A} 


\subsection{B} 


\begin{align}
a &= b\notag\\
    &= c.\label{eq:a}
\end{align}

Equation (\ref{eq:a}) 
\begin{align}
a &= b
\end{align}\label{eq:b}
Equation (\ref{eq:b}) 

\end{document}

Result

2
  • 2
    Welcome to TeX.SX! Try to put the \label into the align environment and not out (that references the subsection). – TeXnician Mar 26 '17 at 15:48
  • I have posted it as answer, so you can accept it. – TeXnician Mar 26 '17 at 16:04
2

You have one mistake in your code: The \label you want to tag the second equation with is outside of it. That causes LaTeX to use the subsection-counter to be referenced.

If you want to reference the equation move the \label into the align environment.

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.