1

Hi I am writing in an iopart document and hence, frustratingly, amsmath doesn't seem like an option. Nonetheless I have three equations on a single line like this:

\begin{equation}
some equation, \qquad 
another equation, \qquad 
third equation,
\end{equation}

and I wish for the equation number to read (4,5,6) and not just (4) as it does at the moment. I would use the tag command and just manually tag it but the tag command does not work because of amsmath not being available. Any help would be greatly appreciated. Thank you

1

For a one-off case, you can do it manually:

\documentclass[12pt]{iopart}

\makeatletter
\newcommand{\advancethree}[3]{%
  \stepcounter{equation}%
  \edef\@currentlabel{\theequation}\label{#1}%
  \edef\temp{\theequation, }%
  \stepcounter{equation}%
  \edef\@currentlabel{\theequation}\label{#2}%
  \edef\temp{\temp\theequation, }%
  \stepcounter{equation}%
  \edef\@currentlabel{\theequation}\label{#3}%
  \edef\temp{\temp\theequation}%
  \renewcommand{\theequation}{\temp}%
}
\let\ORItheequation\theequation
\newcommand{\restore}{\addtocounter{equation}{-1}\let\theequation\ORItheequation}
\makeatother

\begin{document}

\advancethree{one}{two}{three}
\begin{equation}
1+1=2\qquad
2+2=4\qquad
3+3=6
\end{equation}\restore
Another equation
\begin{equation}
4+4=8
\end{equation}
Here are the references: \ref{one}, \ref{two} and \ref{three}.

\end{document}

enter image description here

  • Brilliant, that worked perfectly thank you. Made one which advances two as well. – Joey Tindall Dec 1 '16 at 22:02

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.