Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

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.

2
votes
2answers
68 views

align optimization problem with multiple conditions

I am using the following environment to align optimization problem statements from Typesetting an optimisation problem \documentclass{report} \usepackage{amsmath} \newcommand{\norm}[1]{\lVert#1\...
0
votes
0answers
22 views

How to align right flushed text?

I am using the overleaf template https://www.overleaf.com/latex/templates/cv-template/gsztvcrdvvbj and would like to know how I could rewrite the function in the class without changing overall ...
2
votes
2answers
39 views

Center tabular in align

I'm trying to place a tabular containing some values for x and y inside an align statement. \begin{align*} 0 &= 0 \\ \begin{tabular} {|c|c|c|} %table content \end{tabular} \\ ...
0
votes
0answers
25 views

Problems aligning table in 2-column format from journal template

I am having a lot of trouble aligning a table (see attachment) in a single column of a 2-column format from a template provided by the MBE journal: https://academic.oup.com/mbe/pages/...
2
votes
1answer
40 views

\begin{align*} … \end{align*} is not working

I am getting an error in the following code on my LaTeX template. But the same code is running on MathJax. \begin{align*} 1. {\log_{a}a} = 1\ \mbox{log of a number to the same base is 1} \end{...
3
votes
1answer
75 views

xcolor breaking \[ and align environments inside tabu

I'm having trouble with a "Bad math environment delimiter" when using certain math environments inside tabu. Minimal example: \documentclass[a4paper,12pt]{scrreprt} \usepackage{xcolor} \usepackage{...
2
votes
2answers
48 views

How do you make an align environment use letters instead of numbers?

For the amsmath package, begin{align}...\end{align} will automatically number each line. But, what if you want it to letter each line instead? How do you make it use letters instead?
2
votes
1answer
106 views

What is the vertical spacing caused by the \intertext or \shortintertext command?

\documentclass[letterpaper,10pt]{article} \usepackage{amsmath} \usepackage{nccmath} \begin{document} \begin{align*} \intertext{what is the vertical spacing here?} \\[-30pt] 1+2 \\ =3 \end{align*} \...
1
vote
1answer
46 views

How do align intertext with math instead of an awkward space? [duplicate]

When you use the \intertext in the \align* environment with the amsmath package, it has a small vertical space between the displayed text and equation even though it is still coded on the same line as ...
0
votes
1answer
69 views

How to use multiple \label across multiple \align* environments?

For long calculations, I have two align* environments for two equations. I have as an example \documentclass{article} \usepackage{amsmath} \usepackage{nccmath} \begin{document} \begin{align*} \...
0
votes
0answers
40 views

Colouring aligned math text with macros

I would like to have coloured text-generating macros that i can use inside an align* environment. However, the two seem conflicting. Here's a MWE describing the issue. \documentclass{article} \...
1
vote
1answer
45 views

How to keep alignment across multiple align environments?

\documentclass[letterpaper,10pt]{article} \usepackage{amsmath} \begin{document} \begin{align} w &z &t \end{align} \begin{align} w+w+w+w &z+z+z+z &t+t+t+t \end{align} \end{document} On ...
2
votes
2answers
116 views

intertext / shortintertext with revtex gives large spurious spacing

I am in the situation of using \intertext/\shortintertext with the Revtex document class, but it seems there are some spacing issues. Consider: \documentclass[aps,prl,reprint]{revtex4-1} % \...
5
votes
3answers
88 views

Alignment of implication arrows with text on top

My proofs often look like this: \documentclass{article} \usepackage{mathtools} \begin{document} \begin{align} &\text{First Statement}\\ &\implies \text{Second Statement}\\ ...
0
votes
2answers
38 views

How do I fix the alignment on these equations?

I wish to align these equation by their respective equals sign or arrow so it looks like a table (3 rows, 2 columns). How can I get the second expression to move to the right more so that it looks ...
9
votes
1answer
56 views

align* has extra leading vertical space in mdframed

The problem Inside an mdframed environment, placing align* at the start of the environment produces extra vertical space above, whereas using \[\] instead does not create as much vertical space. ...
1
vote
2answers
38 views

Shifting one equation to the height of two others

Assume the following MWE \documentclass[12pt]{scrartcl} \usepackage{amsmath} \begin{document} \begin{equation} \begin{aligned} y_{it} = \beta_0 + \beta_1 \times X \times W + \alpha_i + \epsilon_{it} ...
6
votes
4answers
307 views

Problems with align* environment

I had some problems while trying to align some equations in an align* environment. The output should be something like this: As you can see, all the + symbols are vertically aligned, and so are the ...
1
vote
2answers
37 views

let aligned blocks float left in align*

I'm using align* to comment some equations: \begin{align*} &loooooooooooooooooooooooooooooooong \\ &short, &comment 1 \\ &not\; so\; short, &comment 2 \\ \end{align*} It produces ...
0
votes
0answers
23 views

Choose size of text inside a framed box and align it with the text width

I am using a framed box to put forward some texts. I have two problems: First, I would like to minimize the text size; as we can do for the legend of a figure: \captionsetup{width=0.95\textwidth, ...
0
votes
2answers
23 views

Missing bracket [duplicate]

I'm having a hard time to figure out what is wrong with the follwoing MWE \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} \langle n,l',l_s',m',m_s'\vert H_{\rm SO}\vert n,...
1
vote
2answers
25 views

how can I align matrices side by side and adjust width with the sheet?

I have these matrices and I want to align them side by side, two matrices in the first row and the other two in the second row (see an example in the picture). I also want to put the name of the ...
0
votes
0answers
15 views

align followed by pagebreak causes align in the middle of the page [duplicate]

MWE \documentclass[12pt,a4paper,twoside]{article} \usepackage[a4paper,tmargin=2cm,bmargin=2cm,lmargin=3cm,rmargin=2cm,twoside]{geometry} \usepackage[utf8]{inputenc} \usepackage{graphicx} \usepackage[...
0
votes
1answer
17 views

Aligning figure under flushright text

I've a text inserted into a quoting section, set as flushright. I'm trying to add a figure under the text, but it seems not to be able to stay aligned to the right part of the text. Here it is an ...
4
votes
3answers
56 views

alignat align two sums under each other

This \begin{alignat*}{2} f(a) &= \lim_{s} \frac{1}{2 z} \int_{-w}^{+e}\int_{-r}^{+t} g(q)\cdot h(q) d x d y &\\ &= \lim_{s} \frac{1}{3s} &\Bigg\{ \sum_{w} \int_{-r}^{+t} g(q+e)\...
5
votes
2answers
67 views

equations with alignement and with centering between alignement

I have the following code: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align} &\begin{bmatrix} a'_{1,1} & a'_{1,2}\\ a'_{2,1} & a'_{2,2} \end{bmatrix} &&=...
0
votes
0answers
20 views

Why \begin{align} redefinition does not work [duplicate]

I am redefining the \begin{align} and \end{align} commands into a shortcut, however it does not work. Can anyone tell me what is the problem? \newcommand{\bal}{\begin{align}} \newcommand{\bal}{\begin{...
3
votes
1answer
87 views

Make the equation in the center

I'm facing difficulties in compilation \documentclass[12pt,a4paper]{report} \usepackage{amssymb,amsmath,amsthm,mathrsfs} \usepackage{mathtools, nccmath} \begin{document} Let $\...
2
votes
3answers
426 views

Add a bracket in mathematical equation

\documentclass[12pt,a4paper]{report} \usepackage{amssymb,amsmath,amsthm,latexsym,mathrsfs,amsfonts,dsfont} \usepackage{mathtools, nccmath} \begin{document} Let $\sigma_H(\mathbf{T})...
1
vote
2answers
21 views

Syntax (equations) in align environment [duplicate]

i have a problem with syntax in the align environment: \documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{...
4
votes
4answers
65 views

Aligned equations with comments/explanations

In many cases I want to write some aligned equation that goes through multiple lines and add a comment for some of the lines (I think if the comments are short enough then it's clearer than explaining ...
6
votes
1answer
114 views

How to align authors in book title page?

I have the following \author declaration in a book document: \author{ Lorem Ipsum \and Dolor Sit \and Amet Whatever \and Bozo Clown \and Donald Trump \and John Smith \and ...
3
votes
4answers
120 views

Syntax in align environment

Take a look at this here: \documentclass[10pt,a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \begin{document} \begin{align*} \...
6
votes
2answers
171 views

Nested cases, alignment and numbering

I have tried all different sorts of solutions including align, aligned, cases and equation to have the result I get with this code except that I want numbering for the three lines in the aligned ...
2
votes
2answers
35 views

Changing the spacing in align environment

I want to change the spacing when using \align. My current code is: \documentclass{article} \usepackage{amsmath} \begin{document} These are defined as: \begin{align} &\text{(Identity)} &d(p,...
5
votes
3answers
136 views

Aligning formula problem

\documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} y ={}& \frac{1}{n!} \left\lbrace \int + f(a) \right. \\ &\left. \vphantom{\int} + [h(u)+\phi(x)] + C \right\...
0
votes
1answer
33 views

Using the `stackrel` package with `&` within the `align` environment

It appears that the stackrel package and the align environment are incompatible. The following example illustrates: \documentclass{amsart} \usepackage{scalerel} \begin{document} \...
1
vote
1answer
40 views

Aligning with Tikzmark

I am trying to get my arrows straight and wondering whether I am going about this properly? \documentclass{article} \usepackage{tikz,amsmath,mathtools} \usetikzlibrary{tikzmark} %%% Derivative ...
6
votes
2answers
175 views

Substitute for eqnarray?

Firstly, sorry for my english level, I'm French. Secondly, I've read eqnarray environment becomes obsolete, and we have to replace this by align. Ok, but it's not satisfying for me. I explain : \...
3
votes
2answers
19 views

Conditional within align environment not resolving

I try to use a shortcut for setting matrices with different brackets. My solution works fine in displaymath and equation environments. However, as soon as I try to use it within align, there is an ...
3
votes
1answer
42 views

How to write an Equation with the Units aligned off right and adapted Bracket Heights around the Unit?

Assumed I have this MWE to align the units off right: \documentclass{article} \usepackage{amsmath} \usepackage{siunitx} \makeatletter \providecommand\add@text{} \newcommand\tagaddtext[1]{% \gdef\...
2
votes
1answer
37 views

Braces and alignment

\begin{align} \begin{cases} 2x + y &= 5 \\ 2x - 3y &= 1 \end{cases} \\ \hline 0x + 4y &= 4 \end{align} Is there any way to keep all equal signs aligned both inside and outside the cases?
1
vote
2answers
43 views

Aligned and enumerated equations

How can I align these equations \documentclass{article} \usepackage{amsmath,physics,enumitem} \begin{document} \begin{enumerate}[label=\textbf{\roman*)}] \item $\displaystyle \comm{P_i}{R_k}=\frac{\...
2
votes
1answer
59 views

How to align an equation with equations inside of a begin{case}

I have the following code \documentclass{article} \usepackage{amsmath} \usepackage{mathtools} \begin{document} \begin{align*} \Omega &= \begin{cases} X &= Y\\ W &= X \...
2
votes
0answers
32 views

Unaligned Subfigures blocking each other

I have the following piecharts in two subfigures, however: One of them is blocking the legend as shown in the picture. Is there any workaround? I tried modifying pgf-pie (thanks Xu Yuan!)but to no ...
3
votes
2answers
134 views

How can I get this format of an optimization problem?

How can I reproduce this format of an optimization problem? Ive been trying to use align but then I can produce the P only on the right side (using \tag). With alignat I couldn't produce the P at all. ...
3
votes
1answer
42 views

align \sim like equal signs in equation modus

I want to align a \sim like an equal sign in an equation environment. Is there an easy way to make Latex recognize the \sim like an equal sign? \begin{equation} \begin{aligned} Z \sim ...
3
votes
3answers
73 views

TikZ diagram and align side-by-side

I have a solution to a problem regarding a solid of revolution. On my computer, TikZ is not shading the region between the graphs. The code provided by marmot at the following link does shade the ...
1
vote
1answer
27 views

Using \tag in \aligned embedded within \equation environment

I want to tag my equations with parallel aligned environments. The code is shown below \begin{equation*} \begin{aligned} & \bold{H}_1^\top\bold{x}_1^*+\bold{K}_1^\top\bold{y}+\bold{U}(\omega_t)= \...
3
votes
2answers
43 views

Equations are not aligning properly

I would like write my equations as shown in the figure. I have tried with align environment. But can't able to achieve it. Here is what i have tried. \begin{align} min \quad c^T x \nonumber \\ s....