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.

2
  • 1
    Welcome to TeX.SX! To what would you change the numbering?
    – egreg
    Jun 30, 2014 at 22:13
  • For example I want the parent equation to be (P1) and the two line to be (P1a) and (P1b).
    – user92991
    Jun 30, 2014 at 22:19

1 Answer 1

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

4
  • 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? Nov 14, 2014 at 11:07
  • I also tried to put % signs anywhere as suggested in tex.stackexchange.com/questions/54032/… But this does not work either Nov 14, 2014 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. Nov 14, 2014 at 11:18
  • 1
    @Quickbeam2k1 Let me fix it! Done!
    – egreg
    Nov 14, 2014 at 11:32

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .