1

I want to put equation numbers on these three equations. also I want them to be aligned with the"=" sign.

\documentclass[12pt,a4paper]{article}
\usepackage[a4paper, total={6in, 8in}]{geometry}
    \usepackage[utf8]{inputenc}
    \usepackage[T1]{fontenc}
    \usepackage{fourier}
    \usepackage{mathtools}
\usepackage{amsmath}
\usepackage[english]{babel}
\usepackage{graphicx}
\graphicspath{ {images/} }

\usepackage{marginnote}


\usepackage{lipsum}


\newcommand\blfootnote[1]{%
  \begingroup
  \renewcommand\thefootnote{}\footnote{#1}%
  \addtocounter{footnote}{-1}%
  \endgroup
}

\begin{document}

\[KP = e^{-\lambda} \Big( \frac {\nu'}{r}+ \frac {1}{r^2}\Big)-\frac {1}{r^2}\]
             \[KP = e^{-\lambda} \Big(\frac {\nu ''}{2}-\frac {\lambda ' \nu '}{4} + \frac {(\nu')^2}{4} + \frac {\nu' -\lambda'}{2r}\Big)\] 
    \[ K \rho c^2 = e^{-\lambda}\Big (\frac {\lambda '}{r}-\frac {1}{r^2}\Big) +\frac {1}{r^2}\]

\[
\frac{dP}{dr}=\frac{-(P+\rho c^2 )\nu'} {2}\]

\end {document}

1 Answers1

4

The environment align from amsmath does precisely what you need. Place & before each equal sign to mark the alignment point, and add \\ at the end of each line but the last to mark a new equation beginning.

\documentclass[12pt,a4paper]{article}
\usepackage[a4paper, total={6in, 8in}]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage{mathtools}

\begin{document}
\begin{align}
KP &= e^{-\lambda} \Big( \frac {\nu'}{r}+ \frac {1}{r^2}\Big)-\frac {1}{r^2} \\
KP &= e^{-\lambda} \Big(\frac {\nu''}{2}-\frac {\lambda' \nu'}{4} + \frac {(\nu')^2}{4} + \frac {\nu' -\lambda'}{2r}\Big) \\
K \rho c^2 &= e^{-\lambda}\Big (\frac {\lambda'}{r}-\frac {1}{r^2}\Big) +\frac {1}{r^2} \\
\frac{dP}{dr}&=\frac{-(P+\rho c^2 )\nu'} {2}
\end{align}
\end {document}

enter image description here

Also:

  • mathtools loads and extends amsmath so it's not strictly necessary to load it separately, and
  • consecutive displayed equations should never be typeset using consecutive \[...\] (or equation/equation* for that matter); the spacing is wrong. If you need alignment but no numbering, you can use the align* environment. If no specific alignment is required, use gather/gather*.
Paul Gessler
  • 29,607