Math & Sciencenumber of the equation below the formula

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
NELLLY
Posts: 113
Joined: Thu Nov 26, 2009 2:21 am

number of the equation below the formula

Post by NELLLY »

Hello
I have a miltiline formula. To get the equation number only for the last equation I used the following code

Code: Select all

\documentclass[12pt]{article}

\renewcommand{\baselinestretch}{1.5}
\date{}

\usepackage{pdfpages}

\usepackage{tabularx,graphicx,rotating,subfigure,multirow}
\usepackage{booktabs}
 \usepackage{array}
 \usepackage{siunitx,amsmath}
 \usepackage[T1]{fontenc}

\usepackage{multirow}
\usepackage{mathtools}

\usepackage[format=hang]{caption}

\hyphenpenalty 100000
\usepackage{authblk}
\date{}

\usepackage{geometry}
\geometry{
  text={6in,8.9in},
  headsep=.4in,
  footnotesep=.2in
}
\captionsetup{
  format=hang,
  width=17cm,
  aboveskip=4pt,
  belowskip=12pt
}
\begin{document}

\begin{align}
\begin{split}
P(S_0=x, D_{S_0}\in I_1)&= \sum_{y=0}^{x-1} P\left( \mbox{there are $y$ intervals of
length $h_1$ and $(x-1-y)$ intervals of length}\right.\\
&\mbox{$h_2$ between samples $1$ and $x$, $D_x \in I_1$
and}\\
 &\left.h_2 (x-y)+y h_1 <T_A <h_2(x-y)+h_1 (y + 1)\right)\nonumber
 \end{split}\\
 &=\sum_{y=0}^{x-1}C_{y}^{x-1} p_{h_1}^{y} (1-p_{h{1}})^{x-1-y}\, p_{h_1} \int_{h_2 (x-y) +h_1 y}^{h_2 (x-y)+ h_1 (y+1)} \lambda  e^{-\lambda t} dt \;\;\mbox{for $x \geq 1$.}
\end{align}
\end{document}
but I get the number below the line of the equation. What should I do?
Thanks.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

number of the equation below the formula

Post by Johannes_B »

I like loading package showframe in my minimal
working example, because that way i can see the margins of the
page a much better. Doing this in you case, immedeatly shows,
that your stuff is just too wide for the text block. There is an
according warning message in the log files ass well:

Code: Select all

Overfull \hbox (68.53334pt too wide) in paragraph at lines 49--49
I don't know what maths you have there, but i suggest to write
big/long equations on their own (displayed math). Simple maths
can be set in line.

Please note, that mbox creates a box, where hyphenation and line
breaking is prevented.

Code: Select all

\documentclass[12pt]{article}

\renewcommand{\baselinestretch}{1.5}
\usepackage{showframe}
\usepackage[T1]{fontenc}
\usepackage{mathtools}
\usepackage{physics}

\usepackage{geometry}
\geometry{
text={6in,8.9in},
headsep=.4in,
footnotesep=.2in
}
\begin{document}

\[P(S_0=x, D_{S_0}\in I_1)= \sum_{y=0}^{x-1} P\] 
there are $y$ intervals of 
length $h_1$ and $(x-1-y)$ intervals of length
$h_2$ between samples $1$ and $x$, $D_x \in I_1$ and
\begin{align*}
&\left.h_2 (x-y)+y h_1 <T_A <h_2(x-y)+h_1 (y + 1)\right)\\
&=\sum_{y=0}^{x-1}C_{y}^{x-1} p_{h_1}^{y} (1-p_{h{1}})^{x-1-y}\, p_{h_1} 
\int_{h_2 (x-y) +h_1 y}^{h_2 (x-y)+ h_1 (y+1)} \lambda
e^{-\lambda t}%
\dd{t}%coming from package physics
\;\;\mbox{for $x \geq 1$.}
\end{align*}
\bigskip


\begin{align}
\begin{split}
P(S_0=x, D_{S_0}\in I_1)&= \sum_{y=0}^{x-1} P\left( \mbox{there are $y$ intervals of
length $h_1$ and $(x-1-y)$ intervals of length}\right.\\
&\mbox{$h_2$ between samples $1$ and $x$, $D_x \in I_1$ and}\\
&\left.h_2 (x-y)+y h_1 <T_A <h_2(x-y)+h_1 (y + 1)\right)\nonumber
\end{split}\\
&=\sum_{y=0}^{x-1}C_{y}^{x-1} p_{h_1}^{y} (1-p_{h{1}})^{x-1-y}\, p_{h_1} \int_{h_2 (x-y) +h_1 y}^{h_2 (x-y)+ h_1 (y+1)} \lambda e^{-\lambda t} dt \;\;\mbox{for $x \geq 1$.}
\end{align}

\end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply