{amsmath} is a package provided by AMS that enhances LaTeX's mathematical typesetting capabilities in various ways.

learn more… | top users | synonyms

15
votes
2answers
2k views

Extendible equals sign

I have a command that has been floating around in my standard preamble for a while: \newcommand{\xeq}[1]{\stackrel{\;#1}{\cleaders\hbox{=\!}\hfill}\:} It is meant to mimic the AMS-LaTeX extendible ...
15
votes
4answers
5k views

Intertext vertical spacing

How do I reduce the vertical spacing of \intertext?
15
votes
2answers
457 views

How to remove an unwanted white space at the last end of a horizontal curly brace?

You can see there is an unwanted white space at the last term below. \documentclass[border=12pt]{standalone} \usepackage{amsmath} \begin{document} $ ...
15
votes
1answer
5k views

Why does amsmath print a warning about a foreign command?

I was wondering what was the cause of the following warning message with the specific \usepackage used below: Using the following: Preamble \documentclass[amssymb,twocolumn,aps]{revtex4} ...
15
votes
3answers
917 views

Long Dashed Right Arrow

Is there a \dashrightarrow equivalent of: \xrightarrow{\hspace*{4mm}} or \longrightarrow or a similar way to fudge it?
15
votes
2answers
280 views

Strange behaviour of binomial coefficient's delimiters

While writing down my Combinatorics exercises I found that the binomial coefficient's delimiters weren't displayed as indicated inside the amsmath documentation. By subsequent trials and errors I was ...
15
votes
1answer
18k views

Text over/under implies arrow?

I'm currently trying to write over/under an implies arrow in LaTeX (in math mode): \implies_{text} This places the text lower, but next to the arrow, not below it. How can I get it below the ...
15
votes
4answers
1k views

Hyperref jumps to the wrong equation if the equation has a \tag and cleveref is used

The problem I'm writing a document where all of my equations are labeled, not by numbers, but by names, which I provide with amsmath's \tag command. I also use cleveref for ease of ...
15
votes
1answer
667 views

How does this macro for augmented matrices work?

I've used this code I found somewhere to typeset literally hundreds of augmented matrices, and it's been amazing: \documentclass[a4paper,12pt]{article} \usepackage{amsmath} \usepackage{arydshln} ...
15
votes
2answers
2k views

Multiset notation in LaTeX

Does anyone know how to make (nice looking) double bracket multiset notation in LaTeX. i.e something like (\binom{n}{k}) where there are two outer brackets instead of 1 as in binomial? You can see an ...
14
votes
3answers
1k views

mathop shifts the baseline, DeclareMathOperator doesn't

Here is a little example that illustrates this strange behaviour: \documentclass{article} \usepackage{amsmath} \DeclareMathOperator\foo{\mathbf{l}} \begin{document} ...
14
votes
7answers
1k views

Aligning polynomial terms

In LaTeX align, I'm struggling to align polynomial terms and assume there's an easy way to do it. But I cannot find the simple/elegant solution. What I would like is something like this: x1 + x2 ...
14
votes
5answers
2k views

Typesetting math: an optimisation problem (cost & constraints)

I really struggle to align a system of equation for an optimisation problem. It was all ok at the beginning until I started adding the constraint. I've got this code so far: \documentclass{article} ...
14
votes
3answers
673 views

Create \eqref* (\eqref without link, i.e. starred eqref)

I want to create a command \eqref*, which is the same like \eqref, but without a clickable link. There are similar commands for \ref (\ref*) and \autoref (\autoref*) which achieve this behaviour, but ...
14
votes
4answers
8k views

Diagonal dots spanning multiple lines/columns of a matrix

I'm filling in large sparse matrices, for example \begin{bmatrix} 0 & -2 & 1 & & -1 & 2 \\ 2 & \ddots & \ddots & \ddots & & -1 \\ ...
14
votes
2answers
2k views

What is the mandatory argument of alignedat for?

alignedat has a mandatory argument. But Herbert (in his mathmode.pdf) wrote as follows, I have made a trial and error, I noticed that the largest number that can be passed is 1073741823 and no ...
14
votes
3answers
6k views

Aligning across 'aligned' equation blocks

I'd like to format two groups of equations such that all their equal signs line up and such that I can put a big brace to the right of each block to annotate that block. The last part is easily ...
14
votes
1answer
260 views

align* environment left-aligned with LuaTeX and RTL math direction

When using LuaLaTeX, with the math direction set right-to-left, the contents of an align* environment is left-aligned instead of centered. Why does this happens? How can I fix it? ...
13
votes
3answers
7k views

Define pretty sets in LaTeX; esp., how to do the condition-separator?

E.g., I have this set: \{ \alpha \in \Sigma^\omega | \exists^\omega n : \alpha [0,n] \notin \Sigma^* a_1 \Sigma^* a_2 \dotsb a_n \Sigma^* \} Here, I use | as the separator for the condition part. ...
13
votes
2answers
519 views

Breaking a theorem between pages

I currently have this custom myexample theorem environment that is working absolutely great. \newtheoremstyle{myexamplestyle}{}{}{}{}{\bfseries}{.}{ }{} ...
13
votes
2answers
4k views

Split-like environment inside cases environment

I'd like to have a cases environment with some cases that are too long to fit on one line. I tried this: \begin{cases} \begin{split} long expression \\ second line of long expression ...
13
votes
3answers
435 views

Force latex to show a square matrix as square

How can i force latex to print out square matrix as a square matrix with equal width and height in math-mode? I also read amsmath documentation, but don't found any useful help on it. For example ...
13
votes
2answers
2k 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 ...
13
votes
1answer
425 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 ...
12
votes
2answers
7k views

Normal subgroups

To typeset that H is a normal subgroup of G, I would use H\unlhd G. However, the result doesn't satisfy myself, since the G seems too close to the triangle: Adding a space \ makes "too much ...
12
votes
3answers
1k views

Multiple letters without spacing in Math [duplicate]

Is there something I can add to the preamble of my document such that multiple letters without spacing in a Math environment (such as $NP$) do not have extra spacing between them and are not ...
12
votes
4answers
493 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
5answers
12k views

Real number symbol (UTF-8: ℝ) in XeTeX

How can I get the 'real number' sign (something like \mathbb{R} with the amssymb package in LaTeX) in XeTeX?
12
votes
2answers
263 views

Manually controlled size of delimiters in macros

I am using the amsmath package and I'd like to control the size of my delimiters manually, i.e. using the \bigl, \Bigl, ... , \Bigr, \bigr commands, instead of \left, \middle, \right. Now I want to ...
12
votes
2answers
2k views

inserting sentences between subequations

My apologies for asking so many questions here. I want to introduce a sentence in between 2 subequations which is not in math mode. Here is the code that I am using: ...
12
votes
3answers
7k views

How to increase the spacing between equations in “gather”?

Is there a way to consistently increase the vertical spacing between equation lines in a gather (or gather*) environment from amsmath? Specifically, I want to produce something like \begin{gather*} ...
12
votes
2answers
508 views

Inconsistent behavior of boxes in amsmath's `gather`.

Recently I was working on a package (ytableau) and had a strange experience with the gather environment in amsmath. Namely, it screws with \vtop and, seemingly, with boxes that I reserve before ...
12
votes
2answers
3k views

vertical dotted line in column vector / amsmath matrix

I would like to typeset the following set of equations: ... but with contiguous, vertical dotted lines in the column vectors, such that the top and bottom rows of the matrix and of the vectors are ...
12
votes
2answers
206 views

Input manually a number into \eqref

Often while writing papers I find the need to cite particular equations from other papers. For example, the landmark paper by Einstein, Newton, and White (2015) lays out the theory of everything in ...
12
votes
1answer
213 views

Why is the \underbrace off the line?

I have the following problem with \underbrace: As you can see, the third underbrace and its comment are not in the line with the first two. Here is my code: \documentclass[a4paper,12pt]{article} ...
12
votes
1answer
537 views

Lost labels using intertext with varioref and hyperref

I have a problem using \intertext together with \vref when hyperref is also used. Consider the following minimal example: \documentclass{article} \usepackage{amsmath, varioref} ...
12
votes
2answers
223 views

Why must \DeclareMathOperator be in the preamble?

What is the rationale for requiring \DeclareMathOperator to be in the preamble? Why are users not allowed to restrict the scope of an operator definition to a particular chapter or environment, like ...
12
votes
1answer
321 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\\ ...
12
votes
1answer
4k views

AMS align / Align multiple “=”, too much space

I asked this question at stackoverflow and have been kindly redirected here. I'd like to align some equations in Latex using the AMS packages. Each equation has two equal signs that need to be ...
12
votes
3answers
432 views

Displaymath environment that can align equations and squeezes math

I have a long equation to align. Without squeezing the math, it is just barely longer than \textwidth. However, the align environment doesn't squeeze the math at all, which results in a badbox. ...
11
votes
4answers
1k views

'Nudging' overset characters downwards

I am trying to make a vector-like symbol to use in a paper I'm writing. I am actually able to make almost exactly what I want in Mathematica, in which it looks like this: In TeX I am using ...
11
votes
6answers
14k views

\qed for theorems without proofs

It is common to place a \qed-Box at the end of a theorem statement (or lemma, corollary, ...) if we give no proof for that statement. How can I do this in LaTeX? If I place a qed-box at the end of ...
11
votes
2answers
594 views

How can I add clips above matrix?

\documentclass{mwrep} \usepackage{kbordermatrix} \usepackage{amsmath} \begin{document} \begin{equation} \bar{P}= \kbordermatrix{ \mathrm{state} & 1 & 2 & 4 & 3 & 6 & ...
11
votes
3answers
2k views

Why doesn't lineno number a paragraph when it is followed by an “align” equation environment without a space?

lineno skips the line numbering in this case: \documentclass[12pt]{article} \usepackage{amsmath} \usepackage{lineno} \linenumbers \begin{document} Lorem ipsum dolor sit amet, consectetur adipiscing ...
11
votes
4answers
187 views

Aligning the long equations

I have read all of the different solutions for fitting long formulas in a page, yet I am still not satisfied with the output I get. The formulas are right aligned which does not look good. Would you ...
11
votes
2answers
5k views

Difference between (split, align) and (gather, aligned)?

Here is an MWE which shows that they seem to do the same thing. Is there any reason to prefer one over the other for typesetting groups of equations? I would prefer the align syntax because it allows ...
11
votes
2answers
2k views

Too small space when using \DeclareMathOperator

Currenlty I'm writing a math script (ring theory, PDF). When I need a new math operator I use \DeclareMathOperator from the amsopn-package. However I noticed some strange behaviour when using an ...
11
votes
2answers
608 views

$\VDash$ Symbol in AMS math packages?

I'm trying to typeset some homework that deals with set theory and in particular I'm trying to write the "model-theoretic" notion of forcing. I put model-theoretic in quotes because I don't know the ...
11
votes
1answer
6k views

Span formula over multiple pages.

I've looked through the search but I couldn't find what I specifically want. I have the following \begin{equation} \begin{split} Very long equation \end{split} \end{equation} Now, I have half a ...
11
votes
2answers
3k views

Increase spacing in split environment

I'm writing long equations with the split environment: \begin{equation} \begin{split} ... \\ ... \\ ... \end{split} \end{equation} The problem is that the single lines are a bit high, and there is ...