I would like to automatically be able to label and reference parts of equations. To explain what I mean I'll provide an example.
\documentclass{article}
\usepackage{amsmath,hyperref,cleveref}
\begin{document}
\begin{align}
w&=x &
y&=z
\label{eqn:full}
\mylabel{eqn:wx}{a}
\mylabel{eqn:yz}{b}
\end{align}
We're talking about \cref{eqn:full}, specifically \cref{eqn:wx}.
\end{document}
The text should read
We're talking about (1), specifically (1a).
How do I define \mylabel in order to achieve this? Of course I could use multiline equations, for example
\documentclass{article}
\usepackage{amsmath,hyperref,cleveref}
\begin{document}
\begin{subequations}\label{eqn:full}\begin{align}
w&=x \label{eqn:wx}\\
y&=z \label{eqn:yz}
\end{align}\end{subequations}
We're talking about \cref{eqn:full}, specifically \cref{eqn:wx}.
\end{document}
However, what I want is to be able to have all the equations on the same line to save space when the equations are very small. Another solution would be to simply add the >a into the text, but then if I reorder the subequations things get messy. It's ok if the equations only apear with a (1) next to them in the text, its the referencing I'm interested in.
Edit: an example that shows my issue
\documentclass{article}
\usepackage{amsmath,hyperref,cleveref,multicol}
\DeclarePairedDelimiter{\shock}{[}{]_{-}^{+}}
\begin{document}
\begin{subequations}\begin{multicols}{2}
\begin{equation}
\shock*{(u-s) h} = 0 \label{eqn:part1}\\
\end{equation}
\break
\begin{equation}
\shock*{(u-s)^2 h + \frac{h^2}{2}} = 0 \label{eqn:part2}\\
\end{equation}
\end{multicols}\end{subequations}
We're talking about \cref{eqn:full}, specifically \cref{eqn:part1}.
\end{document}
Edit2: Final version of command
%Multiple labeled equations on same line
\newcommand{\sidebysidesubequations}[7]{
% #1 reference label
% #2 left subequation
% #3 left label
% #5 midtext
% #6 right subequation
% #7 right label
\begin{subequations}\label{#1}
\noindent
\begin{tabular}{@{}p{0.45\linewidth}@{}p{0.55\linewidth}@{}}
\begin{equation}
#2 \vphantom{\textrm{#4} \quad #5} \label{#3}
\end{equation}%
&
\begin{equation}
\textrm{#4} \qquad #5 \vphantom{#2} \label{#6}
\end{equation}%
\end{tabular}
\end{subequations}
}


amsmatdoes not provideDeclarePairedDelimiter,mathtoolsdoes. – BambOo Apr 06 '20 at 16:30