[Tex/LaTex] Force equation number to be right aligned

alignamsmathequations

I'm trying to typeset some basic equations with proper numbering. I simply want a single equation to have a right aligned number in the two column environment that I'm using. I tried three approaches, but none was satisfactory. I tried the regular equation environment, which produced a number on the next line; the \mbox approach which put the number directly next to the equation (could modify with some \; padding); and the align environment which produced no number. Specifically, I have the following

\documentclass[10pt,twocolumn]{article}
\usepackage{amsmath}

\begin{document}
\begin{equation} \label{NPV}

\textit{NPV}_{System} = P_d+&P_{a}Y\left(\frac{1}{1+r},N\right)+C_cf_{OM}Y\left(\frac{1+i}{1+r},L\right)

\end{equation}

\begin{equation} \label{NPV}

\mbox{\textit{NPV}_{System} = P_d+&P_{a}Y\left(\frac{1}{1+r},N\right)+C_cf_{OM}Y\left(\frac{1+i}{1+r},L\right)}

\end{equation}

\begin{align} \label{NPV}

\mbox{\textit{NPV}_{System} = P_d+&P_{a}Y\left(\frac{1}{1+r},N\right)+C_cf_{OM}Y\left(\frac{1+i}{1+r},L\right)}

\end{align}

\end{document}

A few questions.

  1. How does LaTeX determine the spacing and when to break the line (first example)?
  2. Is there a way to use \mbox to right align and not just "keep together".
  3. Why does \align not produce an equation number in this instance?

Some background: I'm using TeXnicCenter with LuaLaTeX though I get similar results using XeLaTeX.

Best Answer

You need to fix all errors before looking at the alignment, TeX's error recovery is designed to let it continue, not to make any reasonable output at the point of the error.

Your expression is just too long to fit on one line in 2 column, here are a couple of possibilities:

\documentclass[10pt,twocolumn]{article}
\usepackage{amsmath}

\begin{document}
\begin{multline} \label{NPV}
\mathit{NPV}_{\mathrm{System}} ={}\\
 P_d+P_{a}Y(\frac{1}{1+r},N)+C_cf_{\mathrm{OM}}Y(\frac{1+i}{1+r},L)
\end{multline}

\begin{equation}\label{NPV2}
\begin{gathered} 
\mathit{NPV}_{\mathrm{System}} ={}\\
 P_d+P_{a}Y(\frac{1}{1+r},N)+C_cf_{\mathrm{OM}}Y(\frac{1+i}{1+r},L)
\end{gathered}
\end{equation}
\end{document}
Related Question