Claus Jørgensen
Claus Jørgensen

Reputation: 26347

Left align block of equations

I want to left align a block of equations. The equations in the block itself are aligned, but that's not related at all to my question! I want to left align the equations rather than have them centered all the time, because it looks dumb with narrow centered equations.

Example, I want to left align this

\begin{align*}
    |\vec a| &= \sqrt{3^{2}+1^{2}} = \sqrt{10} \\
    |\vec b| &= \sqrt{1^{2}+23^{2}} = \sqrt{530} \\ 
    \cos v &= \frac{26}{\sqrt{10} \cdot \sqrt{530}} \\
    v &= \cos^{-1} \left(\frac{26}{\sqrt{10} \cdot \sqrt{530}}\right) \\
    v &= \uuline{69.08...\degree}
\end{align*}    

but also this

\begin{align*}
    f(x) = -1.25x^{2} + 1.5x
\end{align*}

How is this done? If it's even possible.

Upvotes: 61

Views: 318305

Answers (5)

user16118981
user16118981

Reputation: 199

Another potential option is to use alignat and then use ampersands (& for left, && for right) to designate where you want your alignment:

This method seems to be more Wikipedia-friendly too:

\begin{alignat*}{1}
    & |\vec a| = \sqrt{3^{2}+1^{2}} = \sqrt{10} \\
    & |\vec b| = \sqrt{1^{2}+23^{2}} = \sqrt{530} \\ 
    & \cos v = \frac{26}{\sqrt{10} \cdot \sqrt{530}} \\
    & v = \cos^{-1} \left(\frac{26}{\sqrt{10} \cdot \sqrt{530}}\right) \\
    & v = \uuline{69.08...\degree} \\
\end{alignat*}  

Upvotes: 0

Bloodmoon
Bloodmoon

Reputation: 1338

Try this:

\begin{flalign*}
    &|\vec a| = \sqrt{3^{2}+1^{2}} = \sqrt{10} & \\
    &|\vec b| = \sqrt{1^{2}+23^{2}} = \sqrt{530} &\\ 
    &\cos v = \frac{26}{\sqrt{10} \cdot \sqrt{530}} &\\
    &v = \cos^{-1} \left(\frac{26}{\sqrt{10} \cdot \sqrt{530}}\right) &\\
\end{flalign*}

The & sign separates two columns, so an & at the beginning of a line means that the line starts with a blank column.

Upvotes: 33

Maryam
Maryam

Reputation: 487

You can use \begin{flalign}, like the example bellow:

\begin{flalign}
    &f(x) = -1.25x^{2} + 1.5x&
\end{flalign}

Upvotes: 47

Yeissone
Yeissone

Reputation: 151

The fleqn option in the document class will apply left aligning setting in all equations of the document. You can instead use \begin{flalign}. This will align only the desired equations.

Upvotes: 15

kennytm
kennytm

Reputation: 523264

Try to use the fleqn document class option.

\documentclass[fleqn]{article}

(See also http://en.wikibooks.org/wiki/LaTeX/Basics for a list of other options.)

Upvotes: 50

Related Questions