我怎样才能以这种形式对方程式进行编号:
方程 1;方程 2;方程 3;方程 4(4a-d)
它们都位于同一条线上
\begin{subequations}\label{eq:35}
\begin{align}
u(0)=u_1; \qquad \phi(0)=-\phi_1; \qquad u(L)=u_2; \qquad \phi(L) = -\phi_2,
\end{align}
\end{subequations}
答案1
下面将显示您想要的内容,但只允许您一起引用所有四个,而不能像(4a)
或那样单独引用(4c)
。
\documentclass{article}
\usepackage{amsmath}
\begin{document}
First put in a normal equation
\begin{equation}
E = mc^2
\end{equation}
Then the weird one:
\begin{equation}
u(0)=u_1; \qquad \phi(0)=-\phi_1; \qquad u(L)=u_2; \qquad \phi(L) = -\phi_2,
\refstepcounter{equation}\tag{\theequation a-d}\label{eq:35}
\end{equation}
The above is \eqref{eq:35}. Then another one to make sure the numbering is ok.
\begin{equation}
K = \frac12 mv^2
\end{equation}
\end{document}
版本 2:如果你想引用个别的,你可以做得更糟从 egreg 窃取。
\documentclass{article}
\usepackage{amsmath}
\AtBeginDocument{\let\latexlabel\label}
\begin{document}
First put in a normal equation
\begin{equation}
E = mc^2
\end{equation}
Then the weird one:
\begin{subequations}\label{eq:all}
\[
\refstepcounter{equation}\latexlabel{eq:partA}
\refstepcounter{equation}\latexlabel{eq:partB}
\refstepcounter{equation}\latexlabel{eq:partC}
\refstepcounter{equation}\latexlabel{eq:partD}
u(0)=u_1; \qquad \phi(0)=-\phi_1; \qquad u(L)=u_2; \qquad \phi(L) = -\phi_2,
\tag{\ref{eq:partA}--\ref{eq:partD}}
\]
\end{subequations}
The above is \eqref{eq:all}, which is composed of \eqref{eq:partA}, \eqref{eq:partB}, \eqref{eq:partC}, \eqref{eq:partD}. Then another one to make sure the numbering is ok.
\begin{equation}
K = \frac12 mv^2
\end{equation}
\end{document}
这样写的话,您会得到整个集合eq:all
和单个集合的单独参考点。
答案2
这是你想要的东西吗?我定义了一个tabequation
环境:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}%
\usepackage{array, tabularx, mathtools}
\usepackage[showframe]{geometry}
\newcolumntype{E}[1]{>{\equation}>{\hsize=#1\hsize}X<{\endequation}}
\newcolumntype{Y}{>{\equation}X<{\endequation}}
\newcolumntype{P}[1]{>{\equation}p{#1\linewidth}<{\endequation}}
\newenvironment{tabequations}[1]{%
\vspace{\abovedisplayskip}\par\noindent\setlength\tabcolsep{2pt}\setlength\abovedisplayskip{0pt}
\tabularx{\linewidth}{#1}}%
{\endtabularx\par}
\begin{document}
Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text. Some text.%
\setcounter{equation}{3}%
\begin{subequations}
\begin{tabequations}{*{4}{Y}}
x = y & z = t & u = v & a = b
\end{tabequations}
\end{subequations}
\end{document}
答案3
既然这四个短方程似乎构成了某种群体,那么创建单独的假标签有什么意义呢?要么将它们视为一个实体(具有一个方程编号),要么为每个方程分配单独的标签——(1a)、(1b)等。
\documentclass{article}
\usepackage{amsmath} % for 'subequations' environment
\begin{document}
\bigskip\noindent
\begin{subequations}
Four equations placed side by side, each one labelled individually:
\par\noindent
\begin{minipage}{0.21\textwidth}
\begin{equation}\label{eq:a} u(0)=u_1 \end{equation}
\end{minipage}\hfill
\begin{minipage}{0.24\textwidth}
\begin{equation}\label{eq:b} \phi(0)=-\phi_1 \end{equation}
\end{minipage}\hfill
\begin{minipage}{0.21\textwidth}
\begin{equation}\label{eq:c} u(L)=u_2 \end{equation}
\end{minipage}\hfill
\begin{minipage}{0.24\textwidth}
\begin{equation}\label{eq:d} \phi(L) = -\phi_2 \end{equation}
\end{minipage}
\par\noindent
\end{subequations}
\bigskip\noindent
And a normal equation:
\begin{equation} \label{eq:trivial}
1+1=2
\end{equation}
\end{document}
\documentclass{article}
\usepackage{amsmath} % for 'subequations' environment
\begin{document}
\bigskip\noindent
\begin{subequations}
Four equations placed side by side, each one labelled individually:
\par\noindent
\begin{minipage}{0.21\textwidth}
\begin{equation}\label{eq:a} u(0)=u_1 \end{equation}
\end{minipage}\hfill
\begin{minipage}{0.24\textwidth}
\begin{equation}\label{eq:b} \phi(0)=-\phi_1 \end{equation}
\end{minipage}\hfill
\begin{minipage}{0.21\textwidth}
\begin{equation}\label{eq:c} u(L)=u_2 \end{equation}
\end{minipage}\hfill
\begin{minipage}{0.24\textwidth}
\begin{equation}\label{eq:d} \phi(L) = -\phi_2 \end{equation}
\end{minipage}
\par\noindent
\end{subequations}
\bigskip\noindent
And a normal equation:
\begin{equation} \label{eq:trivial}
1+1=2
\end{equation}
\end{document}