{align} is an environment provided by math packages that permits multiple related equations to be aligned at a common reference point, usually a sign of relation. For general question about aligning document elements, use {horizontal-alignment} or {vertical-alignment} instead.

learn more… | top users | synonyms

58
votes
5answers
53k views

eqnarray vs align

I want to include a list of related equations, say, for a proof, in my LaTeX document. As far as I know, I have two good options, eqnarray and align. What is the difference between them, and how do I ...
33
votes
4answers
2k views

What does a double ampersand (&&) mean in LaTeX?

I've seen several answers that use the double ampersand, but I can't figure out exactly what it does. I tried this out: \begin{align*} \frac{3x + y}{7} &= 9 & \text{given} \\ 3x + y ...
33
votes
3answers
10k views

How to get only one vertically centered equation number in align environment with two equations

sorry if this has been answered before, I couldn't find anything through search. I'm sure its a common problem though. What I have are two equations with align and I want one single equation number ...
28
votes
3answers
14k views

align* but show one equation number at the end

I am using align*, but I still need an equation number. I know one solution is to use align and add \nonumber to all lines but the last. Is there a 'lazy' way to do it? I searched a little and found ...
24
votes
3answers
4k views

Centering \vdots in a system of many equations

I have a system of equations with an arbitrary number of equations (k). I'd like to use \vdots to compactly describe the system, like so: \begin{align*} R(-1) &= \sum_{i=1}^m A(i)R(i-1) \\ ...
20
votes
4answers
842 views

How can I break an align environment for a paragraph?

I would like to have two displayed equations, broken by a short paragraph, but with aligned equal signs (as if using the align environment). Is there some way to "break" the align environment ...
18
votes
2answers
5k views

Highlight an equation within an align environment

I would like to define a command that puts a red box around an equation with yellow highlighting. I have the basics working pretty well. What I am unable to figure out is: How to keep the alignment ...
18
votes
1answer
4k views

Flexible equation, align, multline environment

I'm looking for a command (say \foo{}) or pair of commands (say \foos, \fooe) that behave like: equation environment if there is no \\ nor & multline if there is a single \\ align if there are ...
17
votes
1answer
8k views

How can I add left aligned text to an equation?

I have a document I am trying to copy to learn TeX. Here is what I have encountered: How can I have the "or" in the equation. This is what I have right now: \[ f = ma; \] But $a$ is the change in ...
16
votes
3answers
20k views

Show equation number only once in align environment

I want the equation number to be shown only at the last line, or better, somewhere in the middle of all. So instead of (1), (2), ... only (1). I use \begin{align} ... \end{align}
16
votes
1answer
1k views

Automatic line break in alignat

Consider the following example from http://tex.stackexchange.com/a/12782/4011 \documentclass{article} \usepackage{amsmath} \newcounter{eqn} \renewcommand*{\theeqn}{\alph{eqn})} ...
16
votes
2answers
671 views

How to align nested cases?

Please consider the code bellow: \begin{align*} function = \begin{cases} case1 &\mbox{if } n = 0 \\ \begin{cases} case2 &\mbox{if } n = 1 \\ ...
16
votes
2answers
5k views

Alignment of equals sign in multiple align environments

I have multiple align environments in my document, separated by a small paragraph of text: \begin{align*} foo &= something very very long compared to the other align \end{align*} explanation ...
15
votes
3answers
18k views

Use flalign or alignat or align or similar environment to align to the left

The following is a small example to use flalign environment to generate equation. \documentclass{article} \usepackage{amsmath} \usepackage{txfonts} \begin{document} The formula is: \begin{flalign*} ...
15
votes
1answer
2k views

What is the difference between \notag and \nonumber in align environment?

I use \notag or \nonumber in align environment but there seems no any difference when display. What is the difference between these two commands?
14
votes
3answers
955 views

How to make formulae take equal vertical space in the align environment?

Consider the following code: \begin{align} f_1(x) &= \frac{15x}{3} \\ f_2(x) &= 3x + 5 \\ f_3(x) &= 4x + 13 \end{align} This produces three lines where the first line takes up more ...
14
votes
3answers
5k views

Aligning across 'aligned' equation blocks

I'd like to format two groups of equations such that all their equal signs line up and such that I can put a big brace to the right of each block to annotate that block. The last part is easily ...
14
votes
1answer
943 views

How can I typeset LaTeX math proofs with long lines?

I usually typeset math proofs in LaTeX by using the align environment. For instance, \documentclass{article} \usepackage{amsmath,mathtools} \begin{document} \begin{align} & x^2 \\ &= x*x \\ ...
14
votes
1answer
220 views

align* environment left-aligned with LuaTeX and RTL math direction

When using LuaLaTeX, with the math direction set right-to-left, the contents of an align* environment is left-aligned instead of centered. Why does this happens? How can I fix it? ...
13
votes
4answers
1k views

Make align* number the last equation

I am using the align* environment to write equations expanding several lines. I would like to define a command sequence in the preamble, such that the last equation of this block will always be ...
13
votes
7answers
928 views

Aligning polynomial terms

In LaTeX align, I'm struggling to align polynomial terms and assume there's an easy way to do it. But I cannot find the simple/elegant solution. What I would like is something like this: x1 + x2 ...
13
votes
3answers
9k views

Aligned equations in LaTeX

I have a long equation in LaTeX, which I need to break up into more lines. I've done this, although its not quite what I was looking for. Here is a MWE showing my problem: ...
13
votes
1answer
15k views

Aligning equations with text with alignat

I'm trying to add this expression to my work: I understand that the best way to achieve this is using the alignat environment within the amsmath package, so I tried the following: ...
13
votes
4answers
1k views

Best Pattern For Adding Commentary in align Environment? [duplicate]

I've been using the align environment to line up equations in proofs/explanations/etc and I like to place parenthetical commentary for each step, similar to the code below: \documentclass{article} ...
13
votes
2answers
1k views

Align Equations Over Multiple Tabular Rows

I'm trying to set up a table with some equations in it, however I would like the equations on multiple rows to be aligned properly. So far I have \begin{tabular}{cc} \hline \multicolumn{1}{l}{Header ...
12
votes
4answers
413 views

How do I get this strange alignment?

I would like to get a nonstandard alignment in the following code: \begin{align} \text{First left hand side} & = \text{First right hand side} \\ \text{Second left hand side} & = ...
12
votes
6answers
3k views

Multiline equation with LHS alone on first line?

I would like my multiline equations to look like this: Left-hand-side of my equation = right-hand-side number 1 = right-hand-side number 2 = etc. I know there is a simple way to do ...
12
votes
4answers
3k views

Align left-aligned formula at two points

I would like to get this WITHOUT using tables, because in my real equations there are fractions included that are scaled down in tables a+b+c=1 y =2 My code looks as follows: \begin{align*} ...
12
votes
4answers
5k views

Problem with beamer's \pause in alignments

I have the following code, (edit:) now without aligned. \documentclass{beamer} \mode<presentation> { \setbeamercovered{transparent} } \begin{document} \begin{frame} \[ \begin{cases} ...
12
votes
2answers
148 views

Align*, & and \futurelet

can somebody explain futurelet within align-environments? Example: The command \A should give an "A" if the next char is a {, a "B" if it is & and "C" in any other case. ...
12
votes
1answer
314 views

Correct usage of \ifmmode

Seems that there is some subtlety in using \ifmmode that I am not aware of. For some reason, using: \newcommand{\hlcodeA}[1]{\ifmmode\else\small\fi\texttt{\hilight{#1}}}% is not quite identical ...
12
votes
1answer
251 views

Align to center

I want to align some equations to the equal signs, so I wrote this: \begin{align} -3z &=-9\\ z &= 3\\ -3y-3*3 &= 3\\ y &=-4\\ ...
12
votes
2answers
3k views

Two column align environment with one line spanning both columns

Is there a good/correct way of making an align environment with one line spanning multiple columns? At the moment I'm using a hack like the following, but I feel that it's probably not the best way. ...
11
votes
6answers
598 views

Suppressing = on a line in the align environment

How do I produce the following in align environment? \begin{eqnarray*}& & abcd \\ &=& defg\\ &=& hijk \end{eqnarray*} I try \begin{align*}& abcd \\ &= defg\\ ...
11
votes
5answers
4k views

Vertical alignment of align* in enumerate

Related (but not the same): Align number from enumerate with equation Displaying an equation in a list Earlier today I asked a question about aligning equations in an enumerate environment ...
11
votes
2answers
3k views

How do I put a side brace around several lines in the align* environment?

I would like to put a side brace around several lines in the align* environment, as shown in the comments in the code below: \begin{align*} left side & = right side \\ left side & = ...
11
votes
5answers
35k views

How to align a set of multiline equations

I am trying to align a set of long equations, that are themselves align environments as most of them are spreading on multiple lines. Currently I just have a sequence of align environments, with ...
11
votes
4answers
4k views

Aligning plain `align` and `cases`?

The cases environment works very well for enumerating cases within a large left bracket. I'd like to be able to combine it with the align environment so that equals-signs and conditions also line up: ...
11
votes
3answers
3k views

Left-justify with align on “=” in align environment

I searched the tex.stackexchange archives for an answer to this question but couldn't find one. I assume it's a common question, however. I often want to align text similar to the poly environment in ...
11
votes
2answers
650 views

Problems with alignment of sequences

I want to align two sequences: a_1, b_1, c_1, d_1, e_1 etc. a_2, b_2, c_2, d_2, e_2 etc. here's what I wrote \begin{align} \notag &a_1,\ &b_1,\ &c_1,\ &d_1,\ &e_1\ ...
11
votes
2answers
2k views

inserting sentences between subequations

My apologies for asking so many questions here. I want to introduce a sentence in between 2 subequations which is not in math mode. Here is the code that I am using: ...
11
votes
1answer
6k views

Change font size of an align environment

In a document, I'd like to change the font size of a single align environment (not globally throughout the document). What is the proper way to do this? I've been using Preceding paragraph. {\tiny ...
11
votes
1answer
427 views

Adding multiple paragraphs between aligned equations

Some people have asked about how to add multiple paragraphs (when \intertext and \shortintertext no longer work), a fix was proposed by Peter Grill here: He wrote: My first thought was to hack ...
11
votes
1answer
109 views

Aligning two fractions in the split environment

I have two equations: \begin{equation} \begin{split} d_1 & =\frac{aaaaaaaaaa}{b}\\ d_2 & =\frac{aaaaaa}{b} \end{split} \end{equation} I want the fraction lines to ...
11
votes
1answer
5k views

Multiple Alignment in equations

The following equations need to be aligned in two spots. If I use the align* environment then the second column of alignment is pushed to the right edge of the page. I googled this and saw that ...
10
votes
4answers
209 views

How to vertically align each comma in the following 2 identical sequences?

The following output seems to be difficult to look up an item in the upper sequence with its corresponding item in the lower sequence as the commas are not vertically aligned. ...
10
votes
5answers
1k views

How to align the equal signs in this equation such that the first line and last 2 lines align

so I have an equation below. My latex code for it is: \begin{align*} CoJPoD_{ \{I_1, \cdots, I_{k-1}, I_{k+1}, \cdots, I_{n}\} | I_{k} } = CoJPoD_{ \{system \backslash I_{k}\} | I_k} \\ = ...
10
votes
5answers
355 views

How to make a multiply equation?

I need to make a equation like this 1011 (this is 11 in decimal) x 1110 (this is 14 in decimal) ====== 0000 (this is 1011 x 0) 1011 (this is 1011 x 1, shifted one ...
10
votes
3answers
277 views

Alignment in math equations

How can I align my equations as in the image below? I know \begin{equation} \begin{split} x_1'(t) &= x_1(t)+2 x_2(t) \\ x_2'(t) &= 3 x_1(t) \end{split} ...
10
votes
5answers
8k views

problem using option fleqn in amsmath package

I'm using the following code. What should I do if I don't want the fixed indent from the left margin of my page? ‎ \documentclass[‎fleqn,oneside‎]{article}‎ ‎\usepackage{amsmath}‎ .... \begin{align} ...