11

I would like to change the numbering of the parent equation of the subequations.

\begin{subequations}
\label{eq:Parent}
  \begin{align}
  a& \label{eq:1}\\
  b& \label{eq:2}
  \end{align}
\end{subequations}

I cannot use \tag before \begin{align} since it is not in a math environment.

Werner
  • 603,163
user92991
  • 113

1 Answers1

10

I'd define a new environment, to which you give the desired label as argument.

\documentclass{article}
\usepackage{amsmath}

\makeatletter
\newenvironment{varsubequations}[1]
 {%
  \addtocounter{equation}{-1}%
  \begin{subequations}
  \renewcommand{\theparentequation}{#1}%
  \def\@currentlabel{#1}%
 }
 {%
  \end{subequations}\ignorespacesafterend
 }
\makeatother

\begin{document}
An equation
\begin{equation}
1=1
\end{equation}
Some subequations
\begin{varsubequations}{P1}
\label{eq:Parent}
  \begin{align}
  a& \label{eq:1}\\
  b& \label{eq:2}
  \end{align}
\end{varsubequations}
Another equation
\begin{equation}
2=2
\end{equation}
Now the references: \eqref{eq:Parent}, \eqref{eq:1}, \eqref{eq:2}.
\end{document}

enter image description here

egreg
  • 1,121,712
  • hey, I really like your environment. However, it seems to mess up indendation as can already be seen in your example. Any idea on how to solve this? – Quickbeam2k1 Nov 14 '14 at 11:07
  • I also tried to put % signs anywhere as suggested in http://tex.stackexchange.com/questions/54032/text-following-subequations-is-slightly-indented-if-a-label-is-used But this does not work either – Quickbeam2k1 Nov 14 '14 at 11:10
  • Inserting an empty line between \end{align} and \and{varsubequations} corrects the indendation, but at the cost of a new empty line in the output. – Quickbeam2k1 Nov 14 '14 at 11:18
  • 1
    @Quickbeam2k1 Let me fix it! Done! – egreg Nov 14 '14 at 11:32