As of May 31, 2023, we have updated our Code of Conduct.

Questions tagged [align]

{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.

Filter by
Sorted by
Tagged with
268 votes
4 answers

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}
Bogdan Lataianu's user avatar
239 votes
5 answers

eqnarray vs align

Motivation 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. Question What is the difference ...
Larry Wang's user avatar
  • 3,425
196 votes
5 answers

What are the differences between $$, \[, align, equation and displaymath?

I once learnt, that it is uncool to use $$, but why is that? Why does \[ not act as a abbreviation to \begin{align}? I noticed, that there is a difference, since one cannot use & and \\ inside a ...
niklasfi's user avatar
  • 2,193
186 votes
4 answers

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

What I have are two equations with align and I want one single equation number to refer to this system of equations. To illustrate, I have \begin{align} dr_t &= \kappa ( \theta - r_t ) dt + \...
Paul Koer's user avatar
  • 3,365
171 votes
6 answers

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 ...
digit plumber's user avatar
128 votes
8 answers

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 ...
SeismicVibrations's user avatar
123 votes
7 answers

Align equation left

Here is my split equation: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation} \begin{split} a_{ijk} =& \frac {Pr(M_{I} =2 \& M_J=1 \& M_K =1 | I=i , J=j , K=...
user35571's user avatar
  • 2,067
104 votes
4 answers

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 &...
Gordon Gustafson's user avatar
88 votes
3 answers

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 }...
codd's user avatar
  • 1,199
82 votes
4 answers

Referencing within an align environment

The following LaTeX document: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} E=mc^2 \\ \nonumber E=mc^2 \label{eq1} \end{align} ref \ref{eq1} \end{document} Does ...
Yotam's user avatar
  • 6,829
73 votes
1 answer

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: \begin{alignat*}{3}...
Sergio S.'s user avatar
  • 895
68 votes
1 answer

What is the difference between split, multline, align, breqn for breaking an equation into multiple lines?

Sorry, if this question sounds a bit amateurish, but I haven't been able to find a good summary about the differences between these four environments for multi-lining an equation. Where do they differ ...
xji's user avatar
  • 1,215
64 votes
1 answer

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 ...
gsgx's user avatar
  • 1,229
60 votes
4 answers

side-by-side equations, with equation numbers for each

The align command from amsmath allows me to put two equations side-by-side: \begin{align} x = y && a = b \end{align} Unfortunately for my purposes, this shows both equations under one ...
SuperElectric's user avatar
60 votes
3 answers

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) \\ R(-...
mbauman's user avatar
  • 1,302
59 votes
1 answer

amsmath align environment: row spacing

How can I stretch the spacing between consecutive lines in an align* environment? I have a few lines with \fracs in which both the numerator and the denominator consist of textual phrases, not math ...
Thomas's user avatar
  • 1,937
52 votes
3 answers

Align multiline equation with expression after equal sign

I am trying to align a multiline equation using array within the equation but it turns out it doesn't do very well. The code I am using is as follows: \begin{equation} \begin{array}{lcl} \mathcal{...
Jdbaba's user avatar
  • 2,503
51 votes
4 answers

Remove vertical space around align

I need to display math in my report, but is it possible to remove the vertical space around align*? A little example is the following (where I just want the align* to have the same vertical space as ...
The87Boy's user avatar
  • 1,513
50 votes
1 answer

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 ...
cbd's user avatar
  • 603
48 votes
4 answers

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: \documentclass[10pt]{...
BillyJean's user avatar
  • 1,713
47 votes
3 answers

How can I use an align environment flush left?

Is there a way possible to imitate the align environment for math mode commands, without having all writing being placed toward the center on the output page? MWE: \documentclass{article} \...
night owl's user avatar
  • 7,333
47 votes
1 answer

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 ...
masfenix's user avatar
  • 1,419
45 votes
1 answer

Getting arguments underneath \min in an align environment

I am wondering how can I ensure that an argument gets placed underneath \min when I use an align environment. When I use math mode and write \[ min_{x_1,\dots x_T} \] the {x_1,\dots x_T} is ...
Berk U.'s user avatar
  • 952
44 votes
1 answer

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?
Yun Huang's user avatar
  • 859
43 votes
1 answer

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 \\ \...
IARI's user avatar
  • 1,435
41 votes
5 answers

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 ...
Alex Lockwood's user avatar
41 votes
2 answers

How to put the QED symbol of a proof at the right place inside align?

When a proof ends with a formula in equation or equation* environment, putting \qedhere after the equation would cause the QED symbol to appear in the right place. I.e. at the end of the line in which ...
MikeL's user avatar
  • 991
38 votes
3 answers

Two sets of aligned equations in two columns?

Say I have a set of equations: (1) \begin{align} wx&=u\\ wy&=v\\ w&=10 \end{align} (2) \begin{align} x&=u/w\\ y&=v/w\\ \end{align} How can I do the following: put (1) and (2) ...
Ivan Xiao's user avatar
  • 565
37 votes
1 answer

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 ...
Thanos's user avatar
  • 12.3k
36 votes
5 answers

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} %\...
Hendrik Vogt's user avatar
  • 37.3k
35 votes
4 answers

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 ...
Kristen's user avatar
  • 4,933
35 votes
7 answers

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 and ...
Sophie Alpert's user avatar
35 votes
3 answers

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*} ...
warem's user avatar
  • 3,179
35 votes
5 answers

What is the difference between aligned in displayed mode and starred align?

I am confused in choosing one of the following approaches. \documentclass{article} \usepackage{siunitx} %\sisetup{detect-all} \usepackage{amsmath} \parindent=0pt\relax \begin{document} The following ...
kiss my armpit's user avatar
34 votes
2 answers

align inside of tabular

Today I failed using an align-environment inside of a tabular-environment. Consider the following example: \documentclass[12pt]{scrbook} \usepackage[english]{babel} \usepackage[utf8]{inputenc} \...
MrD's user avatar
  • 2,676
33 votes
2 answers

What's the difference between align and align*?

After some brief searching I can't find the difference between align and align*. Google summarily ignoring the * is making it harder I think. Can you tell me the difference between these two? ...
Harold's user avatar
  • 1,519
32 votes
3 answers

aligned environment of amsmath vs array environment

Today I found out the existence of the aligned environment of the amsmath package. However, I can't see the advantage of using it instead of the array environment from the example provided in amsldoc....
jjdb's user avatar
  • 2,228
32 votes
2 answers

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 \...
MartinB's user avatar
  • 321
31 votes
1 answer

Multiple labels in aligned environment

I would like to format an optimization problem by \documentclass{article} \usepackage{amsmath} \begin{document} We want to label each line separately. The inserted text and formulas have to be ...
Robinaut's user avatar
  • 1,031
30 votes
3 answers

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 ...
andri's user avatar
  • 535
29 votes
2 answers

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 ...
richtera's user avatar
  • 1,501
28 votes
6 answers

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 this, ...
thecommexokid's user avatar
28 votes
1 answer

Aligning the right parts in multiple \begin{cases}

Is there an intelligent way to left-align the parts right of & of the two cases environments shown below (if x >= 0, otherwise, if y < 0, otherwise). I wonder if there is a better way than ...
u17's user avatar
  • 4,956
27 votes
2 answers

Are \choose and \align incompatible?

I ran across a strange warning when trying to use the math command \choose inside the amsmath package's \align* environment: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*...
jamaicanworm's user avatar
  • 28.4k
27 votes
3 answers

Putting equations in \intertext to annotate a proof

I'm trying to typeset a proof with Latex. When I do proofs, I like to alternate between a line of text, to explain each step, and the resulting equation. I also like to have the equations align at the ...
Shane's user avatar
  • 815
27 votes
2 answers

Too much white space when using the align-environment

Consider the following example: \documentclass{article} \usepackage{amsmath,amssymb} \begin{document} \begin{align} \prod a+bm && \text{is a square in} && \mathbb{R}\\ ...
Phil-ZXX's user avatar
  • 1,707
27 votes
1 answer

How to left align a set of equations

I wanted to left align a set of equations. I've tried the solution provided in aligning to the left. It worked. But, I wanted to have a single equation number for the entire flalign in order to refer ...
user492884's user avatar
26 votes
3 answers

How can I center an equation inside an align environment?

This is basically the setup: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} a &= b + c\\ a &= b + c\\ \center{a = b + c \quad a = b + c} \end{align} \end{document}...
Lenar Hoyt's user avatar
  • 1,559
26 votes
5 answers

Basic: How can I stop centering a text?

I'm starting with LaTeX and have a basic question regarding formatting of paragraphs. I wanted to caption an equation mid text, but I couldn't find any convenient way without the equation floating ...
Álvaro's user avatar
  • 375
25 votes
2 answers

Aligning using flushleft and flushright

I am trying to create one column to the left side by side with another column to the right. The column to the left is labeled "Examples of like terms:" and the column to the right is labeled "Examples ...
guest's user avatar
  • 281

2 3 4 5