{amsmath} is a package provided by AMS that enhances LaTeX's mathematical typesetting capabilities in various ways.
38
votes
3answers
3k views
Is there a preference of when to use \text and \mathrm?
I'm unsure of when it is preferable to use \text versus \mathrm, is there some unwritten rule about the use of these?
For example, I saw the following code in a math post:
...
37
votes
3answers
8k views
What's the difference between \mathrm and \operatorname?
I apparently can't see the difference in a compilation (pdflatex) between \mathrm and \operatorname. So, as in the title the question is: is there a difference? Which one is preferable in what ...
34
votes
3answers
1k views
Which command should I use for displayed equations?
A number of related questions have already been asked about this issue:
align vs equation
which is preferable to
what to do with this hyperref note on amsmath
and even eqnarray vs align
But I'm ...
33
votes
2answers
3k views
align vs equation
I always use align in my documents, and avoid equation. Is there anything wrong with that? My reasoning behind this: align > equation, so why not use it?
27
votes
2answers
310 views
Why is there a \, space at the beginning of the “aligned” environment?
Near the beginning of the definition of the amsmath environments aligned and gathered (and also mathtools' multlined) there's an explicit thin space \,. This often has to be cancelled with \!, as ...
24
votes
1answer
225 views
Please explain a strange interaction between bytefield, unicode-math, and mathtools
bytefield gives me different results when used in association with mathtools and unicode-math when used together. Here's my 'good' MWE:
% !TEX TS-program = XeLaTeX
\documentclass[a4paper]{article}
...
23
votes
5answers
4k views
A MiKTeX update removed amsmath as obsolete – can I use another package or get it back?
I have a problem with amsmath package. After an update this package was removed because it was obsolete. But what package can use instead of amsmath?
23
votes
2answers
2k views
What does each AMS package do?
In my view, any document with a substantial amount of mathematics should load the packages from AMS-TeX. Hence, most of my document's preambles contain
\usepackage{amsmath, amsthm, amssymb, amsfonts}
...
22
votes
3answers
2k views
What are the differences between $$, \[, align, equation and displaymath?
I once learnt, that it is uncool to use $$, but why is that? Why does \[ not act as a abbreviation to \begin{align}? I noticed, that there is a difference, since one cannot use & and \\ inside a ...
22
votes
4answers
667 views
Why do arguments to nested \tilde or \breve commands reappear when amsmath is used?
On LaTeX-Community.org I've noticed a strange problem with nested \tilde and \breve commands, when amsmath is used.
In this code the X appears also in the output of the second and the third formula:
...
22
votes
1answer
4k views
Vertical Spacing within align environment accounting for fractions
The default vertical spacing within an align environment seems very tight when there are fractions in the lines.
I am aware of three manual tweaks that can be applied:
Adjust the value \jot.
...
20
votes
5answers
4k views
How can I write multiple lines in a subscript?
Is there a way to force a line break inside a math mode text?
My example:
\[
\underbrace{....}_\text{Some long text that should be multiline}
\]
Trying
\text{Some long text that\\ should be ...
19
votes
4answers
598 views
How to break a long expression in the denominator of a fraction?
I used the split command to break my equation but I receive the error:
! Missing } inserted.
<inserted text>
}
l. \end {split}
The code in .tex file is as follows:
...
18
votes
6answers
12k views
Mathematical symbol for disjoint set union
In our lecture script, we use the notion of disjoint set union. It uses a special symbol to differentiate the disjoint from the usual set union, where we add an extra dot inside of the \cup symbol. Is ...
18
votes
4answers
2k views
Using display style fraction in a matrix environment
I'd like use the \dfrac command in a bmatrix environment as follows:
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\[
\begin{bmatrix}
\dfrac{\partial f}{\partial x}
\\
...
18
votes
2answers
992 views
\boxed{}, TikZ and colored equation background
I wonder if someone could provide me with a simple MWE for using TikZ together with \boxed to produce a colored equation background. If possible with rounded corners.
I am using \boxed{} inside the ...
18
votes
1answer
3k views
Problem with qedhere
In a paper I'm writing, I end a proof with a displayed equation that has some cases in it. The relevant code looks something like the following:
\[f(x) = \begin{cases}
2x & \text{if $x<0$}\\
...
17
votes
4answers
796 views
What to do with this hyperref note on amsmath?
http://www.ctan.org/tex-archive/macros/latex/contrib/hyperref/ has this note copied below:
amsmath
-------------
The environments equation and eqnarray are not supported too well.
For ...
17
votes
3answers
2k views
Dot Derivative Discrepancy
I am trying to typeset some higher-order time derivatives using the dot notation, and I've noticed something strange. The expressions
$\dot y + y = \cos(\dot y)$
$\ddot y + y = \cos(\dot y)$
give ...
17
votes
3answers
2k views
Centering \vdots in a system of many equations
I have a system of equations with an arbitrary number of equations (k). I'd like to use \vdots to compactly describe the system, like so:
\begin{align*}
R(-1) &= \sum_{i=1}^m A(i)R(i-1) \\
...
16
votes
2answers
5k views
align* but show one equation number at the end
I am using align*, but I still need an equation number. I know one solution is to use align and add \nonumber to all lines but the last. Is there a 'lazy' way to do it?
I searched a little and found ...
16
votes
2answers
2k views
Is there a difference between the `displaymath` and `equation*` environments?
The amsmath documentation says
Basic LaTeX doesn’t provide an equation* environment, but rather a functionally equivalent environment named displaymath.
Are they really the same or is there a ...
16
votes
1answer
859 views
Changing the apperance of equation numbers with amsmath
For equations in my document, I use the facilities of the amsmath package. In order to make the equation numbers more eye-catching, I want them to be in boldface and a little bit indented to the ...
15
votes
3answers
335 views
Typesetting the square of a mathematical operator
Assume I want to typeset the square of some mathematical operator A. Using \operatorname (amsmath package), there are basically two ways to do that:
\(\operatorname{A^{2}}\) (i.e., the exponent is ...
15
votes
2answers
230 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
211 views
Why is \global\let not always global?
As an LaTeX environment opens a local group, it is normally necessary to use a global definition if changes in the environment should be available after the environment:
\documentclass{minimal}
...
15
votes
1answer
431 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
1answer
2k views
mathtools vs amsmath
I read on http://en.wikibooks.org/wiki/LaTeX/Mathematics:
The mathtools package fixes some amsmath quirks and adds some useful
settings, symbols, and environments to amsmath.
It sounds like ...
14
votes
2answers
10k views
How can I get text underneath an underbrace?
I am looking to do something of the following:
To get text underneath the underbrace. Is it involving \stackrel or some sort of similar command?
14
votes
2answers
1k 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 ...
14
votes
4answers
292 views
Conflict: onlyamsmath and TikZ
To force myself and collaborators to only use AMS-Math commands, I laod this package in the preamble:
\usepackage[all,warning]{onlyamsmath}
However, when this is combined with TikZ, I get into ...
13
votes
7answers
621 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 ...
13
votes
5answers
235 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}
...
13
votes
4answers
931 views
Underbrace under sqrt content
I am trying to use underbrace to clarify the arguments to a sqrt. However this causes the square root sign to reach all the way down to the bottom of the text under the brace(s), which is not what I ...
13
votes
2answers
333 views
Breaking a theorem between pages
I currently have this custom myexample theorem environment that is working absolutely great.
\newtheoremstyle{myexamplestyle}{}{}{}{}{\bfseries}{.}{ }{}
...
13
votes
4answers
474 views
How can I break an align environment for a paragraph?
I would like to have two displayed equations, broken by a short paragraph, but with aligned equal signs (as if using the align environment). Is there some way to "break" the align environment ...
13
votes
2answers
2k views
How do I do a one-shot MathOperator?
The amsmath packages helpfully define a macro \DeclareMathOperator which does what it says on the tin: it declares a mathematical operator such as \sin or \Null or whatever and typesets it all nice ...
13
votes
2answers
2k 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
1answer
11k 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 ...
13
votes
3answers
4k 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 ...
12
votes
3answers
802 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}
...
12
votes
4answers
304 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
3answers
2k views
\DeclareMathOperator won't take arguments
I'd like to define a family of math operators that have the same superscript, but different subscripts. My first attempt was:
\DeclareMathOperator{\Upd}[1]{U^M_{#1}}
But the log tells me that:
l.3 ...
12
votes
1answer
4k views
About big parenthesis larger than Bigg
Do any one know how to type a very big parenthesis in LaTeX. Since the formula is very big, I used multline environment, in one line, there are many pair of parenthesis by using \left and \right which ...
12
votes
2answers
64 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
77 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
2answers
250 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 ...
12
votes
3answers
1k views
How do magic \dots work in amsmath?
The amsmath package redefines the \dots command so that it "guesses" the correct height of the dots with respect to its context. For example
$x, \dots, y$
will produce three lowered dots, aligned ...
12
votes
1answer
160 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
3answers
549 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 ...
