Hot answers tagged

9 votes

Align works well everywhere but at plus sign

Depending on your desired look, you can just align once at the = signs and let the natural math spacing of LaTeX take care of the rest: \[\left\{ \begin{aligned} a_{11}x_1 + a_{12}x_2 + ...
user avatar
  • 19.9k
6 votes
Accepted

Is it possible to align different lines according to a "waterfall" scheme

You can use alignat: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{alignat}{2} F\colon \mathcal{A} \to \mathcal{B} \\ & f\colon C \to D \\ && c \mapsto f(c) = \...
user avatar
  • 984k
6 votes

Problem with \end{align*}

The line that you show is not the error message, messages always start ! that is the final line which shows the line 656 TeX had reached. For technical reasons TeX always reads an entire alignment ...
user avatar
6 votes
Accepted

Problem with \end{align*}

The main problem, as I noted in an earlier comment, is the presence of an unmatched \left directive in line 4 of your code fragment. Do get rid of that instance of \left. A second, somewhat less ...
user avatar
  • 435k
6 votes
Accepted

When to use which alignment environment?

amsmath is derived from AMSTeX (amstex.tex) which does not have * forms but otherwise has mostly similar naming, including the x- variants. The environments that start math displays are documented in ...
user avatar
6 votes
Accepted

Align works well everywhere but at plus sign

No additional package is needed. The root of the issue is the way the columns are align in the aligned structure: rlrlrlr .... To synchronized the alignment two & are needed before the second + ...
user avatar
  • 24.5k
5 votes
Accepted

How to reduce space before the equal sign and right-align string before?

I suggest you employ an aligned environment inside the cases environment. In fact, since you're not really making use of the machinery of the cases environment, I would further like to suggest that ...
user avatar
  • 435k
5 votes
Accepted

Space between two columns in alignat environment is too wide

You could nest an aligned environment inside the align environment. \documentclass{article} \usepackage[letterpaper,margin=1in]{geometry} % set page parameters appropriately \usepackage{mathtools} % ...
user avatar
  • 435k
4 votes
Accepted

Keeping lines centered and a word left adjusted

Here is the solution: \documentclass{article} \usepackage{mathtools} % or \usepackage{amsmath} \begin{document} \begin{flalign*} && Z\cap W &= \{ y \in W: g_1(y) = 0, \...
user avatar
4 votes

Negative decimal numbers missing decimal point in table using siuntix to align by decimal point

Your numbers have a possible minus sign, one digit in the integer part and two in the decimal part, so the specifications would be S[table-format=-1.2] S[table-format=1.2] respectively. I would use ...
user avatar
  • 984k
4 votes

Multiline brackets around inner Minimization Problem for Maximin Optimization Problem

Welcome to TeX:SE! Try the following: \documentclass{article} \usepackage{amsmath} \DeclareMathOperator{\conv}{conv} \begin{document} \begin{equation} \max_{\lambda\ge0}\left( \begin{aligned} ...
user avatar
  • 250k
4 votes

Multiline brackets around inner Minimization Problem for Maximin Optimization Problem

I propose to do it with a simple pmatrix* environment: \documentclass{article} \usepackage{mathtools} \usepackage{booktabs} \DeclareMathOperator{\conv}{conv} \begin{document} \[ \max_{\lambda\ge0}\...
user avatar
  • 259k
3 votes
Accepted

Writing directly below an equation

Something like this? Addendum, prompted by a comment of @egreg: For the objects at hand, the underbrackets may well be excessively thick. One can override the default thickness by adding an optional ...
user avatar
  • 435k
3 votes

Some align mistake

As commented in the first comment under the question (before you posted the code that generated the error) you should use LaTeX constructs not \def so that you are warned if you are redefining TeX ...
user avatar
3 votes
Accepted

Some align mistake

Now you know why LaTeX has \newcommand and everybody recommends using it instead of \def. Inside amsmath.sty we find \def\measure@#1{% \begingroup [...code that's not of a concern] ...
user avatar
  • 984k
3 votes

Keeping lines centered and a word left adjusted

Here's a different solution idea: (a) place "and" on a line between the two equations (using the \shortintertext macro) and (b) employ an alignat*{2} to take care of aligning all = symbols ...
user avatar
  • 435k
3 votes

Align works well everywhere but at plus sign

You can use alignedat instead, or \systeme. \documentclass{article} \usepackage{amsmath} \usepackage{systeme}% for the second solution \begin{document} \[ \left\{ \begin{alignedat}{3} a_{11}x_1 &...
user avatar
  • 984k
3 votes

Align works well everywhere but at plus sign

I have worked out a solution with the array package. \documentclass{scrarticle} \usepackage{amsmath} \usepackage{array} \begin{document} \begin{equation*} \left\{ \begin{array}{...
user avatar
  • 119
2 votes
Accepted

How to properly align logic operator?

I think this is what you're looking for. alignat is more appropriate for this construction than align, so that's what I've used. There should be no blank lines in math, so I've made those lines &...
user avatar
2 votes

Align works well everywhere but at plus sign

As @daleif comments, the problem could be solved easily by add a {} before & which could protect the space around symbols near &. By the way the codes could be simplified and rewritten as ...
user avatar
  • 2,757
2 votes

Align works well everywhere but at plus sign

Here is a solution using the IEEEeqnarraybox environment from the IEEEtrantools (Appendix F of the documentation) package. This tutorial on typesetting equations also demonstrates the usage of the ...
user avatar
  • 2,732
2 votes

Aligning a Multi-line Expression in Table

It's not very clear what you want to achieve, you should provide a complete minimal example. Anyway, with tabularray: \documentclass{article} \usepackage{tabularray} \UseTblrLibrary{booktabs} \...
user avatar
  • 53.8k
2 votes

Writing directly below an equation

When you are using Unicode math then \underbracket is defined. For example in OpTeX: \fontfam[lm] $$ \underbracket{\pmatrix{a&b&c\cr d&e&f}}_{=a} \cdot \underbracket{\pmatrix{u&...
user avatar
  • 52k
2 votes

Keeping lines centered and a word left adjusted

Another possibility with the fleqn environment from nccmath: \documentclass{article} \usepackage{nccmath} % loads amsmath \usepackage{lipsum} \begin{document} \lipsum[11] \...
user avatar
  • 259k
2 votes
Accepted

Aligning equations with {}

I would use a cases environment for that, but I'm not 100% sure that what you're after, since you have a closing brace in your code (though not in the picture of how you want it to look). \...
user avatar
  • 35.7k
2 votes

How can I align 4 equations in a 2 by 2 layout while having them separately numbered?

You can do this with two minipages, each with its own align environment. I made the left minipage 40% of \textwidth and the right 60%, but you can adjust that how you like. For example, with .5\...
user avatar
  • 19.9k
2 votes
Accepted

Starred version of command does not compile

Your code is wrong. Use \newcommand\MTkillspecial[1]{% helper macro \bgroup \catcode`\&=9 \let\\\relax% \scantokens{#1}% \egroup } it is ` (ascii char) not ‘ which is some ...
user avatar
  • 49.2k
1 vote
Accepted

How to right align comments of an equation?

My first suggestion, without knowing more, would be to use a flalign* environment, which uses the maximum width available to it, and put the comments as the right aligned part of the next alignment ...
user avatar
  • 35.7k
1 vote
Accepted

How do I align text so it has equal left and right indentation in overleaf?

Simply stop using the ragged2e package. By using it, you are asking LaTeX not to justify the lines.
user avatar
1 vote

How do I align mapsto arrows in latex

Welcome to TeX:SE! By use of the cases environment defined in amsmath package: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} \sigma = \begin{cases} \sqrt[8]{2} ...
user avatar
  • 250k

Only top scored, non community-wiki answers of a minimum length are eligible