Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I wonder why all the multilines of the equation are not left aligned? I tried to use align instead but the equation got too long and I could not manage to break it.

 \documentclass[11pt,a4paper,oneside]{report} 
 \usepackage[T1]{fontenc}
 \usepackage{fouriernc}
 \usepackage{mathtools}
 \usepackage{amsthm}
 \usepackage{amsfonts}
 \usepackage{amssymb}
 \begin{document}
 \begin{eqnarray*}
 N =&\frac{\theta _{1}-\theta _{2}}{f}\left( \left( \theta _{1}+\theta
 _{2}+t\right) x-fy\right) \frac{\theta _{1}-\theta _{3}}{f}\left( \left(
 \theta _{1}+\theta _{3}+t\right) x-fy\right) \frac{\theta _{2}-\theta _{3}}{f%
 }\left( \left( \theta _{2}+\theta _{3}+t\right) x-fy\right)  \\
=&\frac{\left( \theta _{1}-\theta _{2}\right) \left( \theta _{1}-\theta
_{3}\right) \left( \theta _{2}-\theta _{3}\right) }{f^{3}}\left( \left(
\theta _{1}+\theta _{2}+t\right) x-fy\right) \left( \left( \theta
_{1}+\theta _{3}+t\right) x-fy\right) \left( \left( \theta _{2}+\theta
_{3}+t\right) x-fy\right)  \\
=&\frac{\sqrt{discr\left( \phi \right) }}{f^{3}}\left( \left( \theta
_{1}+\theta _{2}+t\right) x-fy\right) \left( \left( \theta _{1}+\theta
_{3}+t\right) x-fy\right) \left( \left( \theta _{2}+\theta _{3}+t\right)
x-fy\right) \\
=&\sqrt{discr\left( \phi \right) }\left( \frac{t^{3}-2pt^{2}+\left(
p^{2}+q\right) t+\left( r-qp\right) }{f^{3}}x^{3}-\frac{3t^{2}-4pt+\left(
p^{2}+q\right) }{f^{2}}x^{2}y+\frac{3t-2p}{f}xy^{2}-y^{3}\right) 
\end{eqnarray*}

and the output

enter image description here

Using \begin{align*} the equation exceeds the margins

enter image description here

share|improve this question
1  
Use \begin{align*}...\end{align*} instead of eqnarray* and change =& into &=. –  egreg Aug 28 at 9:36
    
I did that, but then the second and the last line become too wide and I am unable to split them. Somehow \begin{eqnarray*} ''squeezes'' everything so it fits within the margins of the page. –  user124471 Aug 28 at 9:46
    
You should replace discr (five successive variables denoted by d, i, s, c, r) with \discr after you've added to the preamble \DeclareMathOperator\discr{discr}. –  Bernard Aug 28 at 9:58
    
Don't use eqnarray at all. See, e.g., Avoid eqnarray!. –  Svend Tveskæg Aug 28 at 9:58

3 Answers 3

up vote 5 down vote accepted

You have too many useless \left and \right. You also should be using split instead of eqnarray*. The fractions can be managed with \tfrac that makes them smaller.

\documentclass[11pt,a4paper,oneside]{report} 
\usepackage[T1]{fontenc}
\usepackage{fouriernc}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}

\begin{document}

\begin{equation*}
\begin{split}
N
&= \tfrac{\theta_{1}-\theta_{2}}{f}
     ((\theta_{1}+\theta_{2}+t) x-fy)\,
   \tfrac{\theta_{1}-\theta_{3}}{f}
     ((\theta_{1}+\theta_{3}+t) x-fy)\,
   \tfrac{\theta_{2}-\theta_{3}}{f}
     (( \theta_{2}+\theta_{3}+t) x-fy)
\\
&= \tfrac{(\theta_{1}-\theta_{2})(\theta_{1}-\theta_{3})(\theta_{2}-\theta_{3})}{f^{3}}
     ((\theta_{1}+\theta_{2}+t) x-fy)\,
     ((\theta_{1}+\theta_{3}+t) x-fy)\,
     ((\theta_{2}+\theta_{3}+t) x-fy)
\\
&= \tfrac{\sqrt{\mathit{discr}(\phi)}}{f^{3}}
     ((\theta_{1}+\theta_{2}+t) x-fy)\,
     ((\theta_{1}+\theta_{3}+t) x-fy)\,
     ((\theta_{2}+\theta_{3}+t)x-fy)
\\
&= \sqrt{\mathit{discr}(\phi)}
   \left(
     \tfrac{t^{3}-2pt^{2}+(p^{2}+q) t+(r-qp)}{f^{3}}x^{3}-
     \tfrac{3t^{2}-4pt+(p^{2}+q)}{f^{2}}x^{2}y+
     \tfrac{3t-2p}{f}xy^{2}-y^{3}
   \right)
\end{split}
\end{equation*}

\end{document}

enter image description here

share|improve this answer
    
Brilliant solution! Thank you very much. –  user124471 Aug 28 at 10:10

Here is how I would typeset it:

\documentclass{report}

\usepackage{amsmath}
\DeclareMathOperator{\discr}{discr}

\begin{document}

\noindent Let
\begin{equation*}
  g_{i,j}
  = (\theta_{i} + \theta_{j} + t)x - fy.
\end{equation*}
Then
\begin{align*}
  N
  &= \frac{\theta_{1} - \theta_{2}}{f}g_{1,2} \cdot
     \frac{\theta_{1} - \theta_{3}}{f}g_{1,3} \cdot
     \frac{\theta_{2} - \theta_{3}}{f}g_{2,3}\\
  &= \frac{(\theta_{1} - \theta_{2})
           (\theta_{1} - \theta_{3})
           (\theta_{2} - \theta_{3})}{f^{3}}
     \cdot g_{1,2} \, g_{1,3} \, g_{2,3}\\
  &= \frac{\sqrt{\discr(\phi)}}{f^{3}}
     \cdot g_{1,2} \, g_{1,3} \, g_{2,3}\\
  &= \sqrt{\discr(\phi)}
     \biggl(\frac{t^{3} - 2pt^{2} + (p^{2} + q)t + (r - qp)}{f^{3}}x^{3}\\
   &\hphantom{{}= \sqrt{\discr(\phi)}\biggl(}
    - \frac{3t^{2} - 4pt + (p^{2} + q)}{f^{2}}x^{2}y
    + \frac{3t - 2p}{f}xy^{2} - y^{3}\biggr)
\end{align*}

\end{document}

output

Notice that I don't use any \left/\right constructions at all. Also, the space before the underscore is unnecessary, discr should (probably) be a mathematical operator, and eqnarray is not a good environment.

share|improve this answer
    
thank you, but as I tried to explain, then the expression exceeds the margins of the page. I have edited my post. –  user124471 Aug 28 at 10:01
    
@user124471 That would have been nice to know before I did all the formatting! –  Svend Tveskæg Aug 28 at 10:02
    
Sorry but I wrote that above –  user124471 Aug 28 at 10:04

As suggested in the comment you code as shown below

\documentclass[11pt,a4paper,oneside]{report} 
\usepackage[T1]{fontenc}
\usepackage{fouriernc}
\usepackage{mathtools}
\usepackage{amsthm}
\usepackage{amsfonts}
\usepackage{amssymb}
\begin{document}

\begin{align*}
N &=\frac{\theta _{1}-\theta _{2}}{f}\left( \left( \theta _{1}+\theta
 _{2}+t\right) x-fy\right) \frac{\theta _{1}-\theta _{3}}{f}\left( \left(
 \theta _{1}+\theta _{3}+t\right) x-fy\right) \frac{\theta _{2}-\theta _{3}}{f%
 }\left( \left( \theta _{2}+\theta _{3}+t\right) x-fy\right)  \\
&=\frac{\left( \theta _{1}-\theta _{2}\right) \left( \theta _{1}-\theta
_{3}\right) \left( \theta _{2}-\theta _{3}\right) }{f^{3}}\left( \left(
\theta _{1}+\theta _{2}+t\right) x-fy\right) \left( \left( \theta
_{1}+\theta _{3}+t\right) x-fy\right) \left( \left( \theta _{2}+\theta
_{3}+t\right) x-fy\right)  \\
&=\frac{\sqrt{discr\left( \phi \right) }}{f^{3}}\left( \left( \theta
_{1}+\theta _{2}+t\right) x-fy\right) \left( \left( \theta _{1}+\theta
_{3}+t\right) x-fy\right) \left( \left( \theta _{2}+\theta _{3}+t\right)
x-fy\right) \\
&=\sqrt{discr\left( \phi \right) }\left( \frac{t^{3}-2pt^{2}+\left(
p^{2}+q\right) t+\left( r-qp\right) }{f^{3}}x^{3}-\frac{3t^{2}-4pt+\left(
p^{2}+q\right) }{f^{2}}x^{2}y+\frac{3t-2p}{f}xy^{2}-y^{3}\right) 
\end{align*}

\end{document}

Output:

leftadjusted

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.