1

I would like to suppress equation numbers for unlabeled (or better, unreferenced) equations but keep the equation count going. I am using the align environment throughout. Imagine \mathtoolsset{showonlyrefs} but with an equation number increment for every equation not just the visibly tagged ones.

(I prefer equation numbers everywhere, my coauthor does not; in this way we could keep the equation numbers synchronized while preparing the draft.)

user66081
  • 340
  • 1
    @Werner - I don't think it's a duplicate: I'm interpreting the OP's phrase "keep the equation count going" as meaning that equation numbers should be incremented but not shown. However, I may be wrong. Let's see if the OP weighs in with more information. – Mico May 19 '16 at 20:40
  • 1
    @Mico: True. I've retracted my vote. – Werner May 19 '16 at 20:46
  • As far as I understand, this seems to be needed during document preparation, when the presence of equation numbers should not bother your coauthor. For the final version, having numbers jumping up almost at random will confuse readers. – egreg May 19 '16 at 21:01
  • @egreg: yes. A submission for review will have all equations numbered. A publication will presumably have only the referenced ones with no jumps, as usual. That is the origin of the conundrum. – user66081 May 19 '16 at 21:06
  • Synchronized while preparing the draft ... as in we want to talk about equation 7? Just don't. Talk about equation massDensityOfEggYolk. Refer to the name, not the number. Awful problem setting gone. – Johannes_B May 20 '16 at 07:54
  • @Johannes_B - Yes, we want to talk about equation 7 and equation 157, often online – user66081 May 22 '16 at 14:33
  • You use label and ref, right? Use those identifiers instead of numbers. – Johannes_B May 22 '16 at 14:34

1 Answers1

1

You could load the mathtools package and use the \newtagform macro to create a new, "hidden", tag form for equation numbers. With the code shown below, use \usetagform{hidden} to suppress the showing of equation numbers and use \usetagform{default} to revert to default mode.

"Hidden" equation numbers will show when cross-referenced with \ref, \eqref, etc. Of course, readers may become rather confused if they see equation numbers shown in cross-references but not by the side of the actual equation...

enter image description here

\documentclass{article}

\newcommand\hidden[1]{} % this macro doesn't do anything with its argument
\usepackage{mathtools}
\newtagform{hidden}[\hidden]{}{}
\begin{document} 

\usetagform{hidden}
\begin{equation}\label{eq:pyth}
a^2+b^2=c^2
\end{equation}

\usetagform{default}
\begin{equation}\label{eq:euler}
e^{i\pi}-1=0
\end{equation}

A cross-reference to equation \eqref{eq:pyth}.
\end{document} 
Mico
  • 506,678
  • Thank you for the suggestion. This is roughly what it should look like. However, a referenced equation should indeed have a visible tag. And an automatic solution similar to \mathtoolsset{showonlyrefs} that can be turned on and off (eventually, depending on where the tex file is compiled) is of course preferable. – user66081 May 19 '16 at 20:57
  • 1
    This is the exact opposite of what the OP asked. Besides, it is a manual solution. Showing an equation number only when it is referenced, automatically, is probably more difficult. – Marijn May 19 '16 at 21:51
  • 2
    @Marijn - My answer was based on the OP's initial write-up, which was not exactly clear as to what was supposed to be achieved. Since then, the OP has (a) augmented the posting with additional, important explanations and (b) clarified his/her objectives further via a comment left below my answer. (Please check the time stamps if you wish to verify these assertions.) To say that my answer is the exact opposite of what the OP asked is more than a bit unfriendly. – Mico May 19 '16 at 22:04
  • Why answer if it is "not exactly clear as to what was supposed to be achieved"? But thanks for the newtagform / usetagform idea. – user66081 May 21 '16 at 09:28
  • @user66081 - I didn't fully realize how unclear the question was until after you started revising the posting. If I had, I wouldn't have posted an answer that wasn't likely to meet your objective. Would you like me to delete this answer? – Mico May 21 '16 at 09:48
  • @Mico - I think it could be useful. (Unfortunately, usetagform is not effective if used immediately after \begin{align}.) – user66081 May 22 '16 at 14:32
  • @user66081 - \usetagform must be run in text mode, not in math mode. – Mico May 22 '16 at 14:57