I've been using the answers developed in this question in order to have mixed equations and sub-equation numbering inside of an align environment, MWE:
\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage{etoolbox}
\usepackage[breaklinks=true, linkcolor=blue, citecolor=blue, colorlinks=true]{hyperref}
% subequations inside of align
% https://tex.stackexchange.com/questions/34566/mixed-subequation-numbering-within-an-array
\AtBeginEnvironment{align}{\setcounter{subeqn}{0}}% Reset subequation number at start of align
\newcounter{subeqn} \renewcommand{\thesubeqn}{\theequation\alph{subeqn}}%
\newcommand{\subeqn}{%
\refstepcounter{subeqn}% Step subequation number
\tag{\thesubeqn}% Label equation
}
\newcommand{\beginsubeqn}{\setcounter{subeqn}{0}\refstepcounter{equation}\subeqn}
\begin{document}
\begin{align}
\frac{\partial A }{\partial x } &= a &\;,& \label{e:first} \\
\frac{\partial A }{\partial y } &= b &\;,& \label{e:second} \\
\intertext{and:}
\frac{\partial A}{\partial z } &= c &\text{if type Z,}&\beginsubeqn \\
\frac{\partial A }{\partial w } &= d &\text{if type W,}&\subeqn
\label{e:last}
\end{align}
Eqs.~\ref{e:first}~and~\eqref{e:second} are fine, but I'd like Eq.~\ref{e:last} to show as Eq.~(3).
It's easy to do with a regular `subequations` environment:
\begin{subequations}
\label{e:goodref}
\begin{align}
a&=b \\
b&=c
\end{align}
\end{subequations}
See? Eq.~\ref{e:goodref}.
\end{document}
and result:
However, this is a little bit short of my requirements. I need to be able to refer to the sub-equations as a single equation. This is easy to do with a sub-equations environment (see MWE), which unfortunately breaks inside of align.
Is this possible?
edit: I found a hackish solution using cleverref and xstring:
\documentclass[12pt]{article}
\usepackage{etoolbox}
\usepackage{amsmath}
\usepackage{xstring}
\usepackage[breaklinks=true, linkcolor=blue, citecolor=blue, colorlinks=true]{hyperref}
\usepackage[english,capitalise]{cleveref}
% subequations inside of align
% https://tex.stackexchange.com/questions/34566/mixed-subequation-numbering-within-an-array
\AtBeginEnvironment{align}{\setcounter{subeqn}{0}}% Reset subequation number at start of align
\newcounter{subeqn} \renewcommand{\thesubeqn}{\theequation\alph{subeqn}}%
\newcommand{\subeqn}{%
\refstepcounter{subeqn}% Step subequation number
\tag{\thesubeqn}% Label equation
}
\newcommand{\beginsubeqn}{\setcounter{subeqn}{0}\refstepcounter{equation}\subeqn}
% remove last character if letter
\newcommand{\removeendalpha}[1]{\expandarg\def\last{\StrRight{#1}{1}}\def\withoutlast{\StrGobbleRight{#1}{1}}\IfInteger{\last}{#1}{\withoutlast}}
% define cref that labels subequations as parent
\crefname{subasparent}{eq.}{eqs.}
\crefformat{subasparent}{(#2\removeendalpha{#1}#3)}
\begin{document}
\begin{align}
\frac{\partial A }{\partial x } &= a &\;,& \label{e:first} \\
\frac{\partial A }{\partial y } &= b &\;,& \label{e:second} \\
\intertext{and:}
\label[subasparent]{e:last}
\frac{\partial A}{\partial z } &= c &\text{if type Z,}&\beginsubeqn \\
\frac{\partial A }{\partial w } &= d &\text{if type W,}&\subeqn
\end{align}
\cref{e:first,e:second,e:last}, I'd like~\cref{e:last} to show as Eq.~(3).
It's easy to do with a regular `subequations` environment:
\begin{subequations}
\label{e:goodref}
\begin{align}
a&=b \\
b&=c
\end{align}
\end{subequations}
See?~\cref{e:goodref}.
\end{document}
But now I can't figure out how to have the "Eq." part of the reference appear and the equations don't properly combine anymore (... Eqs. (1) and (2) and (3) instead of Eqs. (1) to (3))
edit2: Implementing using Werner's suggestion
\documentclass[12pt]{article}
\usepackage{amsmath,amssymb,eqparbox}
\usepackage[breaklinks=true, linkcolor=blue, citecolor=blue, colorlinks=true]{hyperref}
\usepackage[english,capitalise]{cleveref}
\begin{document}
\begin{align}
\frac{\partial [X]_i }{\partial T } &= - \frac{[C] \alpha_{{N_s},i}}{T} & \eqmakebox[cond][r]{,} \label{e:dci_thd_dt} \\
\frac{\partial [X]_i }{\partial n_{j} } &= \frac{1}{V} \left(- \alpha_{{N_s},i} + \alpha_{j,i}\right) & \eqmakebox[cond][r]{,} \label{e:dci_thd_dnj}
\end{align}
and:
\begin{subequations}
\label{e:dci_thd_de}
\begin{align}
\frac{\partial [X]_i }{\partial V } &= \frac{1}{V} \left([C] \alpha_{{N_s},i} - [X]_{i}\right) & \eqmakebox[cond][r]{,\qquad\text{for CONP}}\\
\frac{\partial [X]_i }{\partial P } &= \frac{\alpha_{{N_s},i}}{T R_u} & \eqmakebox[cond][r]{,\qquad\text{for CONV}}
\end{align}
\end{subequations}
\end{document}
I have slightly broken alignment in the equals sign (a bit more pronounced in my actual document):




alignwith\intertextand then mixed in some subequations. The reason for wanting to stick toalignis because you want the two blocks with partial derivatives to remain aligned across the\intertext. Correct? – Werner Dec 22 '17 at 17:19\hphantomsand splitting thealigninto two separate ones, but that's a pretty ugly solution as well (e.g., if you ever change the longest entry, you have to update all the\hphantomsas well) – arghdos Dec 22 '17 at 17:47