我想获得一个左侧对齐的方程列表,其中每个方程的右侧都有标签编号,可以使用对齐来实现。但是我有一个方程式包含两行,我希望整个方程只有一个标签编号。我该怎么做?谢谢
编辑:
\documentclass[a4paper,twoside,openright]{book}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[pdftex]{color,graphicx}
\usepackage{amsthm, amssymb, amsmath,mathrsfs}
\usepackage{caption}
\usepackage{subfig}
\usepackage{fancyhdr}
\usepackage[italian]{babel}
\usepackage{indentfirst}
\usepackage{microtype}
\usepackage{varioref}
\usepackage{hyperref}
\usepackage{comment}
\usepackage{amsmath}
\begin{document}
\begin{align}
&(\lambda_0,\lambda(t))\neq(0,0) \label{eq:nontriv}\\
&\text{Maximum principle: } u^{\ast}(t) \text { maximizes } \mathcal{H}(x^{\ast}(t),u(t),t), \text { for } u\in U \notag\\
&\text {that is } \mathcal{H}(x^{\ast}(t),u^{\ast}
(t),\lambda(t),t)\ge\mathcal{H}(x^{\ast}(t),u,\lambda(t),t) \label{eq:pmax}\\
(...etc...)
\end{align}
\end{document}
我只想列举第一行和第三行,现在我明白了。但是我还想收集第二行和第三行。
答案1
您可能需要将两个方程式枚举为一个方程式的一些常规选项:
\documentclass[]{article}
\usepackage{amsmath}
\begin{document}
Using subeqations to give them number 3a and 3b, also inserts more vertical
space.
\begin{align}
E &= mc^2\\
E &= \frac{1}{2}mv^2
\end{align}
\begin{subequations}
\begin{align}
\Delta E &= E_0 - E_1\\
\Delta E &> 0
\end{align}
\end{subequations}
Using split, so they share a number which is printed vertically between the two
equations.
\begin{align}
E &= mc^2\\
E &= \frac{1}{2}mv^2\\
\begin{split}
\Delta E &= E_0 - E_1\\
\Delta E &> 0
\end{split}
\end{align}
\end{document}
答案2
由于第二个“方程”由包含内联数学术语的几个句子组成,因此最好将材料放在 中\parbox
。观察关联的方程编号在(两行) parbox 的内容上垂直居中。
\documentclass[a4paper,twoside,openright]{book}
\usepackage[utf8x]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsthm, amssymb, amsmath,mathrsfs}
%% The following packages aren't needed for this example:
%\usepackage{xcolor,graphicx} % omit the 'pdftex' option
%\usepackage{caption}
%\usepackage{subfig}
%\usepackage{fancyhdr}
%\usepackage[italian]{babel}
%\usepackage{indentfirst}
%\usepackage{microtype}
%\usepackage{varioref}
%\usepackage{hyperref}
%\usepackage{comment}
%\usepackage{amsmath} % no need to load a package twice
\begin{document}
\hrule % just to illustrate width of textblock
\begin{align}
&(\lambda_0,\lambda(t))\neq(0,0) \label{eq:nontriv}\\
&\parbox{0.85\textwidth}{\raggedright
Maximum principle: $u^{\ast}(t)$ maximizes
$\mathcal{H}(x^{\ast}(t),u(t),t)$ for $u\in U$.
That is, $\mathcal{H}(x^{\ast}(t),u^{\ast} (t),\lambda(t),t)\ge
\mathcal{H}(x^{\ast}(t),u,\lambda(t),t)$.} \label{eq:pmax}\\
&\text{(\dots etc\dots) } \notag
\end{align}
\end{document}