Math & ScienceFormula exceeds the Width of the Page

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

Formula exceeds the Width of the Page

Post by NELLLY »

Hi
I need the first equation to be at the same line. When I use the following, it exceeds the width of the page. Thanks.

Code: Select all

\begin{eqnarray*}
p_{i2}^{(1)}&=&P(CCC_t \in I_2|CCC_{t-1} \in I_i,
p=p_0)=\sum_{j=LCL_i}^{WL_i-1} p_0
(1-p_0)^{j-1}=(1-p_0)^{LCL_1-1}-(1-p_0)^{WL_1-1},\\
...&=&
\end{eqnarray*}

Recommended reading 2024:

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

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

Frits
Posts: 169
Joined: Wed Feb 02, 2011 6:02 pm

Formula exceeds the Width of the Page

Post by Frits »

Depending on how you've set your margins, you could try to decrease the font size of the eqnarray environment and after the expression changing it back to the normal font size:

Code: Select all

\scriptsize
\begin{eqnarray*}
p_{i2}^{(1)}&=&P(CCC_t \in I_2|CCC_{t-1} \in I_i,
p=p_0)=\sum_{j=LCL_i}^{WL_i-1} p_0
(1-p_0)^{j-1}=(1-p_0)^{LCL_1-1}-(1-p_0)^{WL_1-1},\\
...&=&
\end{eqnarray*}
\normalsize
For me, \scriptsize gave no warning. Other standard fontsizes in LaTeX are for example \tiny, \footnotesize and \small.
howtoTeX.com - Your LaTeX resource site (Tips, Tricks, Templates and more!)
Follow howtoTeX on twitter
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Formula exceeds the Width of the Page

Post by localghost »

NELLLY wrote:Hi
I need the first equation to be at the same line. When I use the following, it exceeds the width of the page. […]
For good reason you should not use the eqnarray environment any more [1]. Use the structures provided by the amsmath package instead and split the concerned lines in your equations.

Code: Select all

\documentclass{article}
\usepackage{mathtools}   % loads »amsmath«

\begin{document}
  \begin{align*}
    p_{i2}^{(1)} &= P(CCC_t \in I_2|CCC_{t-1} \in I_i, p=p_0) \\
                 &= \sum_{j=LCL_i}^{WL_i-1} p_0 (1-p_0)^{j-1}=(1-p_0)^{LCL_1-1}-(1-p_0)^{WL_1-1},\\
          \ldots &= \ldots
  \end{align*}
\end{document}
[1] The PracTeX Journal — TeX Users Group, Lars Madsen: Avoid eqnarray!


Thorsten
Post Reply