{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

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 ...
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 ...
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
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} ...
10
votes
2answers
2k views

Nesting subequations within align

subequations seems to only work outside environments such as align and equation. What if I want to preserve the alignment of the equal signs using align while also would like subequations numbering ...
5
votes
3answers
7k views

Centering in the \align* environment

I'm using the \align* environment from the amsmath package. How can I center one of the lines inside the environment? In the following example, I want to the \vdots to be centered, instead of ...
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
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} ...
10
votes
5answers
9k 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} ...
8
votes
1answer
206 views

What's the right space to right the alignment of a right aligned align environment?

As Hilbert would have put it, had he lived in the TeX-era: No one shall expel us from the Paradise that AMS has created. and one aspect of that paradise is release from the tyranny of eqnarray ...
2
votes
1answer
184 views

Custom glossary environment improvement

This is a followup question about the code provided by Nicola Talbot in this question: Automated generation of equation key TL;DR: Defines new environment alignglos which can be used to wrap ...
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 ...
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
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. ...
10
votes
1answer
391 views

What would be the appropriate technique for typesetting a “where” list of variable specifications after an equation?

I'm often finding I need to lay out an equation in a manner resembling the following source: \begin{align*} x = y + z \end{align*} where $y = $ the value of $y$; $z = $ the value of $z$. ...
9
votes
2answers
255 views

Compute remaining horizontal space in align environment

I use align* often and sometimes it is preferable to add text to the right hand side of an equation instead of using \intertext, or \shortintertext, which tends to interrupt the math flow. This is ...
7
votes
1answer
906 views

Different space between \align and \equation

Why produce the align and the equation environment different space between the text. And what can I do, that it have the same? \documentclass{article} \usepackage{amsmath} \begin{document} Long ...
6
votes
3answers
2k views

\underbrace and align environment

I want to typeset a proof and want to emphasize what I do in each step e.g. by underbracing an equal-sign when I substitute a variable. In addition I also want to align equal-signs in every line. ...
6
votes
2answers
911 views

Highlight an equation within an align environment with color option

I'd really like to do exactly what's being asked for in this question: Highlight an equation within an align environment, but with the ability to change the color when I call it, so that I could have ...
5
votes
1answer
3k views

Different spacing around equation and align

In my document, I use align and equation, depending on the length of the equation. They are spaced differently, as you can see on the picture below. I read that comments in the empty lines would ...
2
votes
2answers
118 views

Align equations inside tabular

How can I align equations inside tabular? I want to place few lines of equation by side of the picture. But it turns out that I cannot use \& in order to shift equals signs to be one under ...
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 ...
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\\ ...
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 ...
10
votes
3answers
3k views

Defining a command for amsmath's align environment

I'd like to define a shorthand command for \begin{align*} and \end{align*}. When I write \newcommand{\ba}{\begin{align*}} it works fine. But when I write \newcommand{\ea}{\end{align*}} ...
7
votes
3answers
241 views

Center a column in align

I have the following type of code in my document: \begin{align*} (-m)+m & \stackrel{\mathrm{Ax 1.1 (i)}}{=} m+(-m)\\ &\stackrel{\mathrm{Ax 1.4}}{=} 0 \\ I want to align on the = ...
6
votes
2answers
294 views

Aberrant vertical spacing with {align} and friends?

Consider documents with the following preamble: \documentclass[12pt]{article} \usepackage{amsmath} Question #1. Why do we get bad alignment with the following code? \noindent ...
5
votes
1answer
3k views

Automatic equation numbering in LyX

I would like to create automatic numbering of equations in LyX. when I entered \renewcommand\[{\begin{equation}} \renewcommand\]{\end{equation}} for the "equation" environment it worked. However, ...
5
votes
1answer
6k views

aligning split equation

I am new to Latex ;) I split my equation like this: \begin{equation} \begin{split} \tilde{m}=P\tilde{M} \\ \quad = K(R^1R^2R^3t) \begin{pmatrix} X \\ Y \\ 0 \\ 1 \end{pmatrix} \\ \quad= ...
3
votes
1answer
242 views

In Lyx, align text inside a float caption

I'm trying to align a legend inside a table caption, so that the colons are vertically aligned. I can do it with the align ambient outside of the caption, but if I use the same code inside the caption ...
3
votes
1answer
188 views

Align all equal signs in the document

Is there a way to align all the equal signs in all equations all over the document? I write a theses (scrbook) and like all equal signs to line up. At least in a chapter if not possible for the whole ...
3
votes
2answers
3k views

AMS align: Left aligned text/math plus multicolumn align

This question is basically a combination of two previous posts: Adding left aligned text to an equation. and AMS align / Align multiple “=”, too much space (the latter being my own question). What I ...
2
votes
2answers
680 views

Break Large Equation Between Parenthesis Using Multline

I have a very large equation that I need to write in multiple lines, but multiline is not working between parenthesis. This is my LaTeX code: \begin{multline} e^{-y \lambda_n} \left( ...
2
votes
2answers
4k views

How can I use multline within an align environment?

I've been looking around and I know that there are possibilities to mimic the multline environment within the gather or align environments, or by using multlined but not in a way that I like, I think. ...
1
vote
1answer
191 views

Two columns of equations, aligned and just one number per column

I'm writing a two-column document, and I want to display two sets of large equations floating at the top. Each equation set should be aligned within the same column, and only the two top equations ...
0
votes
1answer
102 views

Error message because of eqnarray, footnotes, tables or caption?

I know this is not a minimal example, but I have to have this much code, in order to create my error. I had this error already several times and I cannot get rid of it?! I don't know where the problem ...
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 ...
8
votes
3answers
7k views

AMS Split inside AMS Align

I'd like to have multiple lines inside a single align cell like so: \begin{alignat*}{1} = & \begin{split}x+\\ y\end{split} \end{alignat*} But I get an error like: \end{alignat*} \An extra ...
4
votes
1answer
65 views

Specify number of columns in brqalign

Some time ago David Carlisle wrote an awesome brqalign function in this answer: http://tex.stackexchange.com/a/51543/4011. See the cited code below. How to modify the brqalign environment such that ...
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
10k views

columns/alignment with itemize

I'm trying to make alignment points in a list environment. The following code gives me an error, but it almost compiles to what I want, just missing the bullet points. I must be misunderstanding ...
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 ...
10
votes
2answers
2k views

In align environment, how can you label some (but not all) of the equations?

I know that the align environment labels all the lines, while the align* environment labels none of the lines. Is there a way to have the align environment label only some of the lines? For example, ...
6
votes
2answers
2k views

Alignment across nested aligned environments

I have a list of equations with annotations like the one below: \documentclass{scrartcl} \usepackage{amsmath} \begin{document} \begin{align} aaaa &= 1 &&\text{for $X$} \\ bbbb &= ...
6
votes
1answer
4k views

Using align in beamer with overlays

How can I get the align environment to play nicely with beamer overlays? As a simple example I would like \begin{align*} a = \frac{bc}{c} \end{align*} on the first overlay and then ...
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 ...
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 ...
7
votes
2answers
2k views

How to align terms in alignat environment

These are my math equations. To enhance readability, I'd like the third column to be aligned around the + sign; that is, I wish to place some horizontal blank in front of $n\mathbf{A}_0$ (not ...
7
votes
1answer
135 views

Ignoring specific ampersand formatting on a specific line of an align block

I want to typeset a number of equations with some alignment constraints, but I want to partially ignore them on certain lines. An example formatted text might look like the following when it's ...
6
votes
1answer
99 views

Aligning and centering a lstlisting with two columns on a page

Consider the following code taken from here to produce a fancy listing : % PACKAGES \documentclass[11pt,a4paper]{book} \usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry} ...