{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

70
votes
5answers
69k 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 ...
35
votes
3answers
12k 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 ...
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
2answers
738 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 ...
32
votes
3answers
19k 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 ...
27
votes
3answers
5k 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
973 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 ...
19
votes
3answers
26k 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}
19
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 ...
18
votes
6answers
4k 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

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
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?
17
votes
3answers
14k 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: ...
17
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
1answer
9k 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
2answers
427 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. ...
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
812 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 \\ ...
15
votes
3answers
20k 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
18k 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: ...
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
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
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
238 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
5answers
5k 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 ...
13
votes
5answers
44k 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 ...
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
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 ...
13
votes
1answer
378 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
7k 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 ...
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
14k 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
454 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
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
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 & = ...
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
172 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
7k 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 ...
12
votes
1answer
293 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
3k 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
602 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
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: ...
11
votes
3answers
4k 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
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
2answers
786 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
126 views

Need to use \pageref to a page that has *-equations

I am sure that this has been asked before, but I don't seem to be able to find the answer. I need to make a reference to a page. That is, I would like to use \pageref{}. I specifically need to make a ...
11
votes
2answers
1k 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 ...
11
votes
1answer
510 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 ...