3
\begin{align}
E\left(y_{i}^{T}|u_{1i}\succ-x_{1i}'\beta_{1},u_{2i}\succ-x_{2i}'\beta_{2}\right)&=\frac{\sigma}{\Psi\left(x_{1i}'\beta_{1},\tfrac{x_{2i}'\beta_{2}}{\sigma},\rho\right)}\left[\phi\left(\tfrac{x_{2i}'\beta_{2}}{\sigma}\right)\Phi\left(\tfrac{x_{1i}'\beta_{1}-\rho\tfrac{x_{2i}'\beta_{2}}{\sigma}}{\left(1-\rho^{2}\right)^{1/2}}\right)\right.\\
&\qquad + \left. \rho\phi(x_{1i}'\beta_{1})\Phi\left(\tfrac{\tfrac{x_{2i}'\beta_{2}}{\sigma}-\rho x_{1i}'\beta_{1}}{\left(1-\rho^{2}\right)^{1/2}}\right)\right]
\end{align}

The code above gives two equation numbers but I want only one since they belong to only one equation. How do I do that?

1
  • 3
    equation with split inside helps here. Commented Dec 1, 2013 at 20:55

3 Answers 3

4

Option 1

\documentclass[preview,border=12pt,12pt]{standalone}% change it to your own document class
\usepackage[a4paper,margin=2cm,landscape]{geometry}% edit it to meet your preference
\usepackage{amsmath}
\begin{document}
\abovedisplayskip=0pt\relax% don't use this line in your production
\begin{equation}
\begin{split}
E\left(y_{i}^{T}|u_{1i}\succ-x_{1i}'\beta_{1},u_{2i}\succ-x_{2i}'\beta_{2}\right)
&=\frac{\sigma}{\Psi\left(x_{1i}'\beta_{1},\tfrac{x_{2i}'\beta_{2}}{\sigma},\rho\right)}\left[\phi\left(\tfrac{x_{2i}'\beta_{2}}{\sigma}\right)\Phi\left(\tfrac{x_{1i}'\beta_{1}-\rho\tfrac{x_{2i}'\beta_{2}}{\sigma}}{\left(1-\rho^{2}\right)^{1/2}}\right)\right.\\
&\qquad + \left. \rho\phi(x_{1i}'\beta_{1})\Phi\left(\tfrac{\tfrac{x_{2i}'\beta_{2}}{\sigma}-\rho x_{1i}'\beta_{1}}{\left(1-\rho^{2}\right)^{1/2}}\right)\right]
\end{split}
\end{equation}
\end{document}

enter image description here

Suggestion

To make the code more readable (to make you easier to locate what you want to modify), remove the unnecessary {} (such as replacing X_{a}^{b} with X_a^b) and align the equation code with a better pattern as follows.

\documentclass[preview,border=12pt,12pt]{standalone}% change it to your own document class
\usepackage[a5paper,margin=2cm,landscape]{geometry}% edit it to meet your preference
\usepackage{amsmath}
\begin{document}
\abovedisplayskip=0pt\relax% don't use this line in your production
\begin{equation}
\begin{split}
E\left(y_i^T|u_{1i}\succ-x_{1i}'\beta_1,u_{2i}\succ-x_{2i}'\beta_2\right)
&=
\frac{\sigma}{\Psi\left(x_{1i}'\beta_1,\tfrac{x_{2i}'\beta_2}{\sigma},\rho\right)}
\left[
    \phi\left(\tfrac{x_{2i}'\beta_2}{\sigma}\right)
    \Phi\left(\tfrac{x_{1i}'\beta_1-\rho\tfrac{x_{2i}'\beta_2}{\sigma}}{\left(1-\rho^2\right)^{1/2}}\right)
\right.\\
&
\qquad +
\left.
    \rho\phi(x_{1i}'\beta_1)\Phi\left(\tfrac{\tfrac{x_{2i}'\beta_2}{\sigma}-\rho x_{1i}'\beta_1}{\left(1-\rho^2\right)^{1/2}}\right)
\right]
\end{split}
\end{equation}
\end{document}
2
  • 3
    You should use article for the example code, without irrelevant tokens that can be disorienting.
    – egreg
    Commented Dec 1, 2013 at 21:04
  • @egreg: I have considered this negative effect many times so I started giving some comments to warn users that some additional tokens should not be used for their own purposes. I think I need to have a package derived from standalone class that does my common settings out of the box via key-value options, e.g., \documentclass[<key-values>]{derivedstandalone}. My settings are used to generate the tight output to mimic the screenshot output. Commented Dec 1, 2013 at 21:08
4

Option 2

Use multline instead of align (option 1 already in DonutE.Knot's answer...)

MWE

\documentclass{article}

\usepackage{amsmath}
\usepackage{hyperref}

\begin{document}

\begin{multline}
E\left(y_{i}^{T}|u_{1i}\succ-x_{1i}'\beta_{1},u_{2i}\succ-x_{2i}'\beta_{2}\right)=\frac{\sigma}{\Psi\left(x_{1i}'\beta_{1},\tfrac{x_{2i}'\beta_{2}}{\sigma},\rho\right)}\left[\phi\left(\tfrac{x_{2i}'\beta_{2}}{\sigma}\right)\Phi\left(\tfrac{x_{1i}'\beta_{1}-\rho\tfrac{x_{2i}'\beta_{2}}{\sigma}}{\left(1-\rho^{2}\right)^{1/2}}\right)\right.\\
\qquad + \left. \rho\phi(x_{1i}'\beta_{1})\Phi\left(\tfrac{\tfrac{x_{2i}'\beta_{2}}{\sigma}-\rho x_{1i}'\beta_{1}}{\left(1-\rho^{2}\right)^{1/2}}\right)\right]
\end{multline}

\end{document} 

enter image description here


EDIT

As Barbara Beeton states in her comment, the equation doesn't fit in the page, so it would be better to add another break, for example

\documentclass{article}

\usepackage{amsmath}
\usepackage{hyperref}

\begin{document}

\begin{multline}
E\left(y_{i}^{T}|u_{1i}\succ-x_{1i}'\beta_{1},u_{2i}\succ-x_{2i}'\beta_{2}\right)\\
=\frac{\sigma}{\Psi\left(x_{1i}'\beta_{1},\tfrac{x_{2i}'\beta_{2}}{\sigma},\rho\right)}\left[\phi\left(\tfrac{x_{2i}'\beta_{2}}{\sigma}\right)\Phi\left(\tfrac{x_{1i}'\beta_{1}-\rho\tfrac{x_{2i}'\beta_{2}}{\sigma}}{\left(1-\rho^{2}\right)^{1/2}}\right)\right.\\
+ \left. \rho\phi(x_{1i}'\beta_{1})\Phi\left(\tfrac{\tfrac{x_{2i}'\beta_{2}}{\sigma}-\rho x_{1i}'\beta_{1}}{\left(1-\rho^{2}\right)^{1/2}}\right)\right]
\end{multline}

\end{document}  

enter image description here

6
  • the position of the equation number says that something is wrong here; the problem is that the equation is wider than the page allows. breaking it into three parts can still be done with multline. (i still think that using [final] mode as default is a latex mis-feature.) Commented Dec 2, 2013 at 15:05
  • @barbarabeeton I know. Added a possible alternative. Feel free to edit my answer if you think there is a better alternative. Commented Dec 2, 2013 at 15:17
  • except that i'd prefer to see the equals sign at the beginning of the second line, that's just fine. Commented Dec 2, 2013 at 15:23
  • @barbarabeeton Corrected. Thanks for your hints. Commented Dec 2, 2013 at 15:26
  • I'd rather not recommend multiline especially when there is more than one line break, then proper use of align is a lot better. Especially when margins are changed.
    – daleif
    Commented Dec 2, 2013 at 15:37
0

What about a simple use of \nonumber after the part of the equation which should not have a number (before the \\)

\documentclass{article}
\usepackage{amsmath}

\begin{document}
\begin{align}
    E\left(y_{i}^{T}|u_{1i}\succ-x_{1i}'\beta_{1},u_{2i}\succ-x_{2i}'\beta_{2}\right)&=\frac{\sigma}{\Psi\left(x_{1i}'\beta_{1},\tfrac{x_{2i}'\beta_{2}}{\sigma},\rho\right)}\left[\phi\left(\tfrac{x_{2i}'\beta_{2}}{\sigma}\right)\Phi\left(\tfrac{x_{1i}'\beta_{1}-\rho\tfrac{x_{2i}'\beta_{2}}{\sigma}}{\left(1-\rho^{2}\right)^{1/2}}\right)\right.\nonumber\\
    &\qquad + \left. \rho\phi(x_{1i}'\beta_{1})\Phi\left(\tfrac{\tfrac{x_{2i}'\beta_{2}}{\sigma}-\rho x_{1i}'\beta_{1}}{\left(1-\rho^{2}\right)^{1/2}}\right)\right]
\end{align}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .