{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
1answer
391 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
143 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 ...
7
votes
2answers
4k views

\mbox does not draw a box inside align*

\mbox doesn't work inside align*: \begin{document} \usepackage{mhchem} \begin{align*} \ce{K_w} &= \ce{[H3O+][OH^-]} \\ -\log \ce{K_w} &= -\log ( \ce{[H3O+][OH^-]} ) \\ -\log ...
6
votes
1answer
109 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} ...
4
votes
2answers
97 views

How to number two equations as one

\begin{align} ...
3
votes
1answer
97 views

Aligned equation which can break through pages [duplicate]

I'm writing long sequences of aligned math equations, and LaTeX interprete them as single, unbreakable objects... which is Ok if the equation is nowhere near the end of the page. Q: Is there a way to ...
3
votes
2answers
265 views

Aligning tikz picture within text

I want to align my tikz within a text. A sample can be seen at the second picture in the following link: Image courtesy from http://www.echoecho.com/htmlimages08.htm This is my trial: ...
3
votes
2answers
4k views

alignat problem

Whenever I try to use the alignat environment, it doesn't seem to work on my computer! I tried the following simple code (my file had \usepackage{amsmath}): \begin{alignat}{3} \min \quad x_1 ...
11
votes
1answer
2k 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 ...
10
votes
4answers
197 views

Aligning numbering in a system of equation so it's centered

In the following code ... $\begin{cases} 2y+4x=9 & \text{(I)} \\ 3x-2x=10 & \text{(II)} \end{cases}$ ... I want the (I) to be centered above (II). Right now they are aligned above each ...
10
votes
2answers
681 views

Horizontal alignment within an equation using Tikz

I am trying to center horizontally the first terms of a system of equations inside the alignat environment. I don't know if Tikz is the right way to go, but as I might have to add some other ...
10
votes
1answer
3k views

How can I write multi line equations with alignment in inline math mode?

Is there any way to override the fact that certain environments in LaTeX are automatically "displayed"? One such example is the align* environment. I want to keep my aligned equations inline. So ...
9
votes
5answers
2k views

How to subtract two equations?

I am trying to subtract one equation from another but I can't get it to display the way that I want. This is what I have right now. \begin{align*} &y&=2x+5\\ -&&\\ ...
9
votes
1answer
9k views

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 ...
8
votes
3answers
187 views

Align matrices problem

I have an equation of matrices and I want to align the dimensions of the matrices below the equation of matrices. However, I produce something very ugly. Can someone advise how to make it look better ...
8
votes
2answers
189 views

Glossaries in Align Environment

Using glossaries commands in align environment seems to screw up the tag alignment. How can I use gls{...} commands in align environments without the tag position being altered? Consider the ...
8
votes
1answer
138 views

How to avoid this undesired horizontal space?

In the following output, why do I get the undesired space before the (, and how to get rid of it globally? Here is my code: \documentclass{article} \usepackage{amsmath} \begin{document} ...
8
votes
2answers
2k views

Label one line in a begin align*

I have the following block of TeX: \begin{align*} m_n^+ = \dfrac{1}{n}\sum\limits_{k=N+1}^{n} =& \dfrac{1}{n}\sum\limits_{k=N+1}^{n}\left(a_k-L+L\right) \\ ...
7
votes
3answers
5k views

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

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? ...
6
votes
2answers
69 views

Place table based on position of column break

I have a table with two columns of different widths. I want to place my table in my page such that the line between the two columns falls on the center of the page. If the columns were the same size ...
6
votes
2answers
748 views

Why does aligning equations not work here?

\documentclass{minimal} \usepackage{amsmath} \newcommand*{\op}[1]{\operatorname{#1}} \begin{document} \begin{align*} \noalign{$\quad \op{f} * \op{r} = \op{c}_{\op{f}*\op{r}} (x_1,...,x_k) = ...
6
votes
3answers
310 views

How can I align two split environments at the equal signs?

\documentclass{scrartcl} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} \usepackage{amsmath, amsthm, amssymb} \usepackage{mathtools} \begin{document} ...
5
votes
1answer
88 views

Equation alignment creating unwanted space

I am defining some text in a align, but no matter how i place the & symbol to create the alignment i get a space between the first chars. \begin{align*} H_0:& \text{Something.}\\ H_1:& ...
5
votes
2answers
298 views

Equation tags for parts of alignments

Consider the following example: \documentclass{article} \usepackage{amsmath} \begin{document} \[ 1+2=3 \implies \left\{ \begin{aligned} &a+b=c, \\ &x=y+z. ...
4
votes
2answers
474 views

proof format 2 columns [duplicate]

Possible Duplicate: How to correctly format (and align) a LaTeX proof? In my proofs I would like to have justifications of each step to the side of the numerical manipulation. For instance ...
4
votes
3answers
357 views

Alignment in multiple locations of a single equation based on first line

I want to align a multi-line equation so that it basically looks like this: a = (b + c + d + e) f = g The requirements of this alignment are: The equal signs should be aligned. The beginning ...
3
votes
2answers
88 views

Problem in alignment of equation using \begin{align} and \begin{split}

I was trying to align these equation but they are stretching out of the document. Even though I used \begin{split} it didn't work. I don't know why this is so? \documentclass{article} ...
3
votes
1answer
178 views

Placing a tikzpicture next to an align

I have a tikzpicture with an accompanying explanation in a math align environment. The tikzpicture is small enough that I'd like the explanation to appear next to (specifically, to the right) the ...
3
votes
1answer
2k views

How can I create a multi line split inside of a radical inside of an array environment?

I have an align like this: \begin{align*} \sigma &= \sqrt{\sum_x \left[ (x-\mu_x)^2\mathbf{f}(x) \right] } = \sqrt{\frac{1}{10}\sum_x (x-\mu_x)^2 } \\ &= \sqrt{\frac{1}{10}( (0-.45)^2 + ...
2
votes
1answer
113 views

Equation Number Positioning in Align Environment

How do I control the space between the equation number and the right margin in the align environment?
1
vote
2answers
69 views

Alignment in aligned and aligned[t] environments

The following code instructs LaTeX to typeset two different expressions for the square of the absolute value of a certain sum. I have three alignments - one of them is "almost" correct and two of ...
0
votes
0answers
35 views

Multi-line brackets in align [duplicate]

Possible Duplicate: How to make \left, \right pairs of delimiter work over multiple lines? The following code (from the official User's Guide for the amsmath Package) works: ...
11
votes
2answers
832 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\ ...
10
votes
2answers
928 views

How to format Maxwell equations?

Is there a variant of split environment from amsmath package which would allow for two aligned equations in a row? I want to format two pairs of Maxwell equations in two rows and put single equation ...
9
votes
2answers
190 views

how can I align limits at “lim”?

I am trying to align several limit expressions at varying x-values. It seems that align treats the "limit" portion together with its subscript as an entire object, then aligns these limits, which ...
8
votes
1answer
125 views

Underbrace multiple math lines

I have to underbrace multiple lines in an align-environment with one brace. Meaning something like \begin{align*} A ={}& B + \underbracemultiline{C + D + E \\ & + F + G \\ & ...
8
votes
1answer
142 views

Why does the `&` reset grouping?

In this answer, I used \tikzmark to mark the extent of a typeset piece of text, so I could draw changebars next to it. But it initially seemed that the changebars "disappear" with math-mode content. ...
8
votes
2answers
12k views

Big \sum instead of small \sum in array environment

\begin{align*} \begin{array}{c} \min \: A = \min \: \sum_{i\in B} C_i \\ \\ \min \: D = \min \: \sum_{i\in B} \pi_i \cdot F_i \end{array} \end{align*} See http://i.stack.imgur.com/TFIfY.png for an ...
7
votes
1answer
118 views

Formula label outside of formula

I want to label a block of equations like that: The "AB" should not inflict the central alignment of the formula. I saw it a lot, but do not succeed on my own. Do I need to build boxes? I used the ...
7
votes
1answer
748 views

alignment problem

I have the following: \documentclass{article} \usepackage{nicefrac} \usepackage{amsmath,amssymb} \begin{document} \begin{align*} f_X(x)&=\frac{1}{2 \pi} \exp ( -x^2/2 ) &\forall x \in ...
7
votes
2answers
271 views

How to stop fractions in display equations from running into each other?

Is there some standard way to create multiple display equations like the following without having to use: \renewcommand*{\arraystretch}{2} (so that the two rows in the second equation don't get ...
6
votes
1answer
108 views

Long formula in align environment

Usually, if I have a very long formula, I will use two lines in the align environment and \qquad to space things out nicely. For example, \begin{align*} % First line \rho\left(\frac{\partial ...
6
votes
2answers
1k views

How to edit the length of a color box?

I've typed my Resume and Im using a color box, with a line underneath it. However the grey colored box doesn't reach the full length of the page width. \documentclass[letterpaper,11pt]{article} ...
6
votes
1answer
359 views

\marginpar and \begin{align}

I want to use \marginpar directly beside a formula within a \begin{align} statement. I tried: \begin{align} E^2 \end{align} \marginpar{Not correct} but the 'Not correct' statement is written ...
6
votes
2answers
1k views

Underlining an equation in an align block

I'm trying to set up a system of equations and want to underline the last equation, but can't figure it out. Here's what I have: \begin{alignat*}{4} &F_n &- mg &- F_a\sin 32^\circ &= ...
5
votes
1answer
57 views

how to use conditional to define different \begin and \end environment at compile time

I just need little help on the syntax for this. I am using tex4ht, and I get an error when I use empheq for the align environment. I want to build this TeX file both in pdflatex and htlatex. I ...
5
votes
1answer
536 views

Automatic linebreak in align environment in macros

I have given a selfdefined command like \newcommand{\AND}[2]{\left(#1 \vee #2 \right)} which makes sure that I always give the correct number of parameters to my formula and which handles the ...