{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 questions about aligning document elements, use {horizontal-alignment} or {vertical-alignment} instead.

learn more… | top users | synonyms

79
votes
5answers
88k 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 ...
40
votes
3answers
15k 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 ...
37
votes
3answers
26k 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 ...
34
votes
4answers
3k 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
2answers
770 views

How to number the letters of a sentence?

I need to number the letters of a sentence consecutively. Every letter should have the corresponding small number centered below it (see image below). Does anybody know how to do this? I tried ...
29
votes
3answers
6k 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) \\ ...
23
votes
1answer
5k 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 ...
22
votes
3answers
33k 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}
20
votes
4answers
1k 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 ...
20
votes
4answers
21k 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: ...
19
votes
2answers
6k 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 ...
19
votes
1answer
3k 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?
18
votes
6answers
5k 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 ...
18
votes
2answers
6k 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 ...
17
votes
5answers
51k 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 ...
17
votes
2answers
462 views

Stacked symbol doesn't align properly. Why?

A modified equals sign used represent use of L'Hopital's Rule isn't aligning well with other equals signs. How would I fix that? I'd prefer to do so without manually fiddling with spaces, if possible. ...
17
votes
1answer
21k 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: ...
17
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})} ...
17
votes
1answer
11k 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
23k 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*} ...
16
votes
2answers
909 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
1answer
8k 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 ...
15
votes
5answers
6k 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 ...
15
votes
3answers
1k 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
7answers
1k 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 ...
14
votes
2answers
2k 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 ...
14
votes
3answers
6k 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
1k 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
261 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
2k 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
4answers
4k 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*} ...
13
votes
4answers
2k 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
1answer
8k 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 ...
13
votes
2answers
2k views

Equations inside enumerate aligned on item's number

If I type \begin{enumerate} \item \begin{align*} eqn 1 eqn 2 \end{align*} \end{enumerate} the label will appear on the first lines and the equations will ...
13
votes
1answer
427 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 ...
13
votes
1answer
4k views

Uncover lines of an align environment with beamer

Is there any way to uncover equation-lines of an align* environment line per line in a frame conveniently? somethink like \begin{align*}[<+->] a &= b \\ b &= c \\ ...
13
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. ...
12
votes
4answers
17k views

How to correctly format (and align) a LaTeX proof?

I'm new to LaTeX and I'm trying to figure out how to correctly format a proof. Can someone show me a basic template for how to do this? The part I am having the most trouble with is creating new ...
12
votes
4answers
496 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
4answers
5k 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: ...
12
votes
2answers
4k 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 & = ...
12
votes
4answers
6k 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
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: ...
12
votes
2answers
5k views

Multiple alignment

In the following piece of code \begin{align*} [x \mapsto s]x &= s \\ [x \mapsto s]y &= y \qquad \text{als } y\neq x \\ [x \mapsto s](\la{y}t_1) &= \la{y}[x \mapsto s]t_1 \qquad \text{als ...
12
votes
2answers
193 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
613 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 ...
12
votes
1answer
3k views

Split expressions with parentheses in align environment

I am writing down a rather long expression, which has to be splitted in a align environment. The thing is that this expression has parentheses which have to be splitted too. I don't want to use ...
12
votes
1answer
325 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
1answer
4k views

AMS align / Align multiple “=”, too much space

I asked this question at stackoverflow and have been kindly redirected here. I'd like to align some equations in Latex using the AMS packages. Each equation has two equal signs that need to be ...
11
votes
6answers
605 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\\ ...