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 have a long equation. I used multline and tried

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
\begin{multline*}
144V^2=a^2a_1^2(b^2+b_1^2+c^2+c_1^2-a^2-a_1)^2+\\
+b^2b_1^2(c^2+c_1^2+a^2+a_1^2-b^2-b_1)^2+c^2c_1^2(a^2+a_1^2+b^2+b_1^2-c^2-c_1)^2-\\
-(bca_1)^2-(cab_1)^2-(abc_1)^2-(a_1b_1c_1)^2.
\end{multline*}
\end{document}

enter image description here

Are there any way to align this equation?

share|improve this question

4 Answers 4

up vote 7 down vote accepted

You could (i) split the long right-hand side of the equation into four roughly equally-long components and (ii) use an align* environment to assemble the pieces:

enter image description here

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
\begin{align*}
144V^2
&=a^2a_1^2(b^2+b_1^2+c^2+c_1^2-a^2-a_1)^2\\
&\quad +b^2b_1^2(c^2+c_1^2+a^2+a_1^2-b^2-b_1)^2\\
&\quad +c^2c_1^2(a^2+a_1^2+b^2+b_1^2-c^2-c_1)^2\\
&\quad -(bca_1)^2-(cab_1)^2-(abc_1)^2-(a_1b_1c_1)^2.
\end{align*}
\end{document} 

Addendum: If you want to get this equation structure numbered, you have to choose whether the equation number -- I'm assuming you want only a single number for the entire structure, rather than a number for each line -- should be centered vertically or be placed on the last row. The following code snippets show how these two possibilities might be implemented. Further possibilities are demonstrated in some of the other answers to your posting.

% number placed at end of last line
\begin{align}
144V^2
&=a^2a_1^2(b^2+b_1^2+c^2+c_1^2-a^2-a_1)^2 \notag\\
&\quad +b^2b_1^2(c^2+c_1^2+a^2+a_1^2-b^2-b_1)^2 \notag\\
&\quad +c^2c_1^2(a^2+a_1^2+b^2+b_1^2-c^2-c_1)^2 \notag\\
&\quad -(bca_1)^2-(cab_1)^2-(abc_1)^2-(a_1b_1c_1)^2. \label{eq:long_one}
\end{align}

% number centered vertically -- use aligned env. nested inside equation env.
\begin{equation}\label{eq:long_two}
\begin{aligned}
144V^2
&=a^2a_1^2(b^2+b_1^2+c^2+c_1^2-a^2-a_1)^2 \\
&\quad +b^2b_1^2(c^2+c_1^2+a^2+a_1^2-b^2-b_1)^2 \\
&\quad +c^2c_1^2(a^2+a_1^2+b^2+b_1^2-c^2-c_1)^2 \\
&\quad -(bca_1)^2-(cab_1)^2-(abc_1)^2-(a_1b_1c_1)^2. 
\end{aligned}
\end{equation}
share|improve this answer
    
@ Mico How to Numbered equation? –  minthao_2011 Mar 14 at 5:58
    
@minthao_2011 - I've inserted an addendum to demonstrate two possibilities for numbering such an environment. –  Mico Mar 14 at 6:15
    
@ Mico Thank you for your update. –  minthao_2011 Mar 14 at 9:04

Since this is a single equation, it is recommended to use split inside equation.

MWE:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
\noindent Unnumbered equation
\begin{equation*}
\begin{split}
144V^2
&=a^2a_1^2(b^2+b_1^2+c^2+c_1^2-a^2-a_1)^2\\
&\quad +b^2b_1^2(c^2+c_1^2+a^2+a_1^2-b^2-b_1)^2\\
&\quad +c^2c_1^2(a^2+a_1^2+b^2+b_1^2-c^2-c_1)^2\\
&\quad -(bca_1)^2-(cab_1)^2-(abc_1)^2-(a_1b_1c_1)^2.
\end{split}
\end{equation*}

\noindent Numbered equation
\begin{equation}
\begin{split}
144V^2
&=a^2a_1^2(b^2+b_1^2+c^2+c_1^2-a^2-a_1)^2\\
&\quad +b^2b_1^2(c^2+c_1^2+a^2+a_1^2-b^2-b_1)^2\\
&\quad +c^2c_1^2(a^2+a_1^2+b^2+b_1^2-c^2-c_1)^2\\
&\quad -(bca_1)^2-(cab_1)^2-(abc_1)^2-(a_1b_1c_1)^2.
\end{split}
\end{equation}
\end{document} 

Output:

enter image description here

share|improve this answer

You mean like this?

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
\begin{align*}
144V^2 &=a^2a_1^2(b^2+b_1^2+c^2+c_1^2-a^2-a_1)^2\\
&\quad +b^2b_1^2(c^2+c_1^2+a^2+a_1^2-b^2-b_1)^2+c^2c_1^2(a^2+a_1^2+b^2+b_1^2-c^2-c_1)^2\\
&\quad -(bca_1)^2-(cab_1)^2-(abc_1)^2-(a_1b_1c_1)^2.
\end{align*}
\end{document}

enter image description here

Or like this?

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
\begin{align*}
144V^2 &=a^2a_1^2(b^2+b_1^2+c^2+c_1^2-a^2-a_1)^2\\
&\quad\begin{aligned}
{}+{} b^2b_1^2(c^2+c_1^2+a^2+a_1^2-b^2-b_1)^2+c^2c_1^2(a^2+a_1^2+b^2+b_1^2-c^2-c_1)^2\\
{}-{}(bca_1)^2-(cab_1)^2-(abc_1)^2-(a_1b_1c_1)^2.
\end{aligned}
\end{align*}
\end{document}

enter image description here

share|improve this answer
    
+1 for the \begin{align} <stuff> & <stuff> \\&\quad \begin{aligned} <stuff> \end{aligned}\end{align} construction! –  Niel de Beaudrap Mar 13 at 8:58
    
@Mico You are right. These were the artefacts of some experiment. I will edit. Thanks. –  Harish Kumar Mar 13 at 9:14

In this case, I would suggest using an environment such as align or aligned, as follows:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
\begin{equation}
\begin{aligned}[b]
        144V^2
    ={}&
        a^2 a_1^2 (b^2 + b_1^2 + c^2 + c_1^2 - a^2 - a_1)^2
    \\&
        + b^2 b_1^2 (c^2 + c_1^2 + a^2 + a_1^2 - b^2 - b_1)^2
    \\&
        +   c^2 c_1^2 (a^2 + a_1^2 + b^2 + b_1^2 - c^2 - c_1)^2
    \\&
        -(bca_1)^2 - (cab_1)^2 - (abc_1)^2 - (a_1b_1c_1)^2\,.
\end{aligned}
\end{equation}
\end{document}

The aligned environment belongs inside of another math environment (in this case, equation, which is responsible for the equation numbering). The [b] option positions the aligned environment vertically so that the equation number is at the bottom line. (The {} is to adjust the horizontal space around the =, because the & in the math environment would otherwise disrupt the correct spacing around binary relations.)

Sample equation

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.