2

I want to obtain a list of equations aligned on the left, where every equation has the labeling number on the right and it can be done by using align. However I have an equation which takes two lines and I want only one labeling number for the whole equation. How could I do? Thanks

EDIT:

\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}

I wanted to enumerate only the first and the third line and now I got it. However I'd also like to gather the second and the third.

  • Welcome to TeX.SE. Just insert a \notag (or \nonumber) instruction on the line that's not supposed to receive an equation number. – Mico Oct 27 '17 at 8:04
  • Oh, it was very simple, thank you. And how can I visually gather the two lines of the same equation, in order to make them seem part of the same thing? – xyzt Oct 27 '17 at 8:07
  • 1
    You should where possible/always show a minimal working example (MWE) which is a complete document starting at \documentclass and ending at \end{document}, which reproduces the stuff you have yet, and showing what your problem is. – Skillmon Oct 27 '17 at 8:18
  • Thanks for posting that code, but you should really update your question and post the code there. Please note, that the code is not minimal, meaning you include more packages than you need to show your problem (which would be only amsmath I think) – Skillmon Oct 27 '17 at 8:22
  • I didn't realized I have removed it. It has been probably a mistake, sorry. – xyzt Oct 27 '17 at 8:31
1

Some general options you might have to enumerate two equations as one:

\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}

enter image description here

0

Since the second "equation" consists of a couple of sentences that contain inline math terms, it's a good idea to place the material in a \parbox. Observe that the associated equation number is centered vertically on the contents of the (two-line) parbox.

enter image description here

\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}
  • I don't have enough reputation yet to vote but your answer was very useful too. I didn't know \parbox. Thank you – xyzt Oct 27 '17 at 14:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.