我有一个与 mwe 中类似的子方程环境
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{subequations}\label{eq:w} %\tag{myEQ}
\begin{align}
a &= b \label{eq:s1} \tag{myEQ.1}\\ %\tag{\ref{eq:w} 1}
c &= d \label{eq:s2} \tag{myEQ.2} %\tag{\ref{eq:w} 2}
\end{align}
\end{subequations}
I need to reference \eqref{eq:w} and \eqref{eq:s1} and
would like the tags to be coherent
\end{document}
我发现这个相关问题其中子方程中的编号是自动的。然而,这不是我关心的,而是\eqref{eq:w}
应该显示的事实(我的情商)而不是(1)。
答案1
如果只有一次,请这样做
% arara: pdflatex
% arara: pdflatex
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\begin{subequations}
\makeatletter
\def\@currentlabel{myEQ}
\makeatother
\label{eq:w}
\renewcommand{\theequation}{myEQ.\arabic{equation}}
\begin{align}
a &= b \label{eq:s1}\\
c &= d \label{eq:s2}
\end{align}
\end{subequations}
I need to reference \eqref{eq:w} and \eqref{eq:s1} and
would like the tags to be coherent.
\end{document}
如果你更频繁地需要它,你应该看看子方程的编号父方程
我不明白你的最后一点。方程式是对齐的。在你的 MWE 中已经如此了。
答案2
您可以根据以下内容定义不同的环境subequations
:
\documentclass{article}
\usepackage{mathtools}
\makeatletter
\newenvironment{taggedsubequations}[1]
{%
% \end{subequations} will advance `equation`
\addtocounter{equation}{-1}%
\begin{subequations}%
% set the current label
\def\@currentlabel{#1}%
% redefine \theequation
\renewcommand{\theequation}{#1.\arabic{equation}}%
}
{\end{subequations}}
\makeatother %not \makeatletter
\begin{document}
\begin{equation}
1=1
\end{equation}
\begin{taggedsubequations}{myEQ}\label{eq:w}
\begin{align}
a &= b \label{eq:s1}\\
c &= d \label{eq:s2}
\end{align}
\end{taggedsubequations}
I need to reference \eqref{eq:w} and \eqref{eq:s1} and
would like the tags to be coherent.
\begin{equation}
1=1
\end{equation}
\end{document}