37
votes
What is the Latex convention for sign function?
The question of whether to use "sgn" or "sign" is not entirely subjective: the ISO 80000-2 standard says it should be "sgn".
34
votes
Accepted
Real Number Symbol \R not working
\R is not a predefined command, you need to define it yourself if you want to use it as a shortcut.
\newcommand{\R}{\mathbb{R}}
Thus:
\documentclass{article}
\usepackage{amsmath}
\usepackage{...
33
votes
Accepted
Why "p" in pmatrix?
The amsmath package provides a number of options. The leading letter before matrix indicates the delimiter that is used:
p for parens, b for brackets, v for verts, B for braces, V for double verts.
...
30
votes
Accepted
Big O notation - visual difference related to document configurations
Just revert \mathcal to using Computer Modern Symbols:
\documentclass{article}
\usepackage{fourier}
% add these two lines to your long preamble
\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}
\...
27
votes
Spacing of math symbols to the left of a letter and between two letters
You ask,
Is there a reason for these spacing[s] to be different?
Indeed there is! What you've (re-)discovered is the difference between - (and + too) being employed as either a unary or a binary ...
25
votes
Accepted
How to use lineno with amsmath align?
The lineno package is not compatible with the amsmath environments, but the two can be made to work together.
Without the mathlines option to lineno (which turns on line numbering inside equations) ...
23
votes
Interior of a set notation
The latex kernel contains the \mathring accent for that:
Edit :
You might prefer to use the \ring command from mathabx. Here is a code to use it without replacing all maths fonts: it defines the \...
23
votes
Accepted
How the `\alignat` works in ams package
I've always found the description of alignat based on the number of & tokens confusing. It's simpler than that: first you decide how many parts your alignment consists of, then adjust the number ...
23
votes
Math: overwrite \int command
Use the relevant option in amsmath:
\documentclass{article}
\usepackage[intlimits]{amsmath}
\begin{document}
\[
\int_{a}^{b} f(x)\,dx
\]
\end{document}
22
votes
Why doesn't lineno number a paragraph when it is followed by an indented equation?
Mathematics environments need to be wrapped by \begin{linenomath*} and \end{linenomath*} as mentioned in Bamzi's answer.
A quick way to change all your equations is to renew the equation environment ...
22
votes
Accepted
Is there any way to speed up typing a math symbol which has an argument, symbol^(variable)?
If \s isn't already defined as a macro, you could define it via
\providecommand{\s}[1]{s^{(#1)}}
and then write
$\s1, \s5, \s P, \s{L-1}$
in the body of the document to generate
21
votes
Accepted
Is eqnarray really obsolete?
The output of eqnarray is wrong anyway and there's little to do about it. Consider also that it doesn't work with cross-references if hyperref or cleveref are involved.
No, there's no reason for ...
21
votes
Accepted
How to avoid page breaks locally in aligned equations, with \allowdisplaybreaks enabled
\documentclass{article}
\usepackage{amsmath}
\allowdisplaybreaks
\begin{document}
Text
\vspace{52em}
\begin{align*}
& a long formula \\* % the \\* command prohibit a page break after a given ...
21
votes
How to make the matrices look constant throughout?
The package nicematrix can compute for you the width of the widest entry of all the matrices in a portion of your document and give that width to all the columns.
For that, you have to use the ...
21
votes
Accepted
Interesting recursive behaviour with \frac error
To understand what is going on, let us consider an example that is a bit simpler. Define \macro to be a macro taking one argument
\newcommand\macro[1]{abc}
The argument is ignored and the expansion ...
20
votes
What is wrong with the $f$ symbol?
The cmmi10 font (and this is followed by lmmi10) has specifically a kerning between d and f:
(CHARACTER C d
(CHARWD R 0.520488)
(CHARHT R 0.694445)
(COMMENT
(KRN C Y R 0.055555)
(...
19
votes
How to neatly space the equals sign when using probabilities?
I turn my comment to an answer since I think it is an adequate solution, in particular in this situation, and it is simpler than the other approaches. I also find no flaw in its visual appearance. It ...
19
votes
Accepted
Combinatorial notation (\choose) not working with \frac
This is one of the reasons why using the \choose method is not the best.
What happens? When \frac is expanded, it looks for two arguments, which in your case are determined to be
{200 \choose 11}{ 200 ...
19
votes
Accepted
What is the difference between \cdots and \dotsm?
\cdots is defined in the LaTeX format. \dotsm is an alias in amsmath, defined as
\let\dotsm\cdots
So, \cdots and \dotsm are identical.
18
votes
Writing math formula in LaTeX, 'undefined control sequence'
You have
\nablaf
which is probably undefined, I guess you wanted
\nabla f
(Please always post a complete document that generates the error, it is much easier to debug then)
17
votes
Square version of \cdot (small black square)?
There are several ways for doing this. One idea could be \centerdot from amssymb, but this has the defect of sitting on the baseline, despite its name.
One can fix this by observing that the apparent ...
17
votes
How to convert all fractions from the form m/n into the form\dfrac{m}{n}?
If the supplied file is saved as f.tex
\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\begin{document}
\[ m/n + p/q = 2/3 . \]
I want
\[\dfrac{m}{n} + \dfrac{...
17
votes
Ugly matrices to fix
The package nicematrix has a feature dedicated to that problem. In an environment {NiceMatrixBlock}, all the matrices created by nicematrix (with {bNiceMatrix} but this environment will create the ...
16
votes
Square version of \cdot (small black square)?
Handcraft it.
\documentclass{scrartcl}
\newcommand*\sq{\mathbin{\vcenter{\hbox{\rule{.3ex}{.3ex}}}}}
\begin{document}
$f$ by $\bar f$ gives $\bar f \sq f \simeq c$ for $c$ the constant\dots
\end{...
16
votes
Accepted
amsmath is now latex-amsmath: what does this mean for me?
No difference at all, you may not have noticed but earlier in the year the latex graphics package catalogue entry similarly changed to latex-graphics.
This is simply a matter of organising the ...
16
votes
Accepted
\dots plus \left
UPDATE this is fixed in release 2.15d (sent to ctan today, 2016-06-28, so will be reaching distributions is a few days.)
This is a bug (sorry ask @egreg who did it:-) until a fix is made available ...
16
votes
Accepted
reading through the definition of `\cfrac` in AMSMath
\newcommand{\cfrac}[3][c]{...
defines a command with two mandatory arguments and one optional so the use is \cfrac{a}{b} or \cfrac[r]{a}{b} with the former being equivalent to \cfrac[c]{a}{b}.
\ifx ...
16
votes
Accepted
How to neatly space the equals sign when using probabilities?
It's straightforward to define a macro such as \newcommand\myeq{\mkern1.5mu{=}\mkern1.5mu} -- choose the argument of \mkern to suit your personal preferences -- and thus to rewrite your equation as
\...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
amsmath × 3383math-mode × 967
equations × 667
align × 593
spacing × 211
horizontal-alignment × 193
symbols × 152
matrices × 151
math-operators × 126
mathtools × 124
numbering × 102
vertical-alignment × 83
fonts × 82
cross-referencing × 80
cases × 75
errors × 71
macros × 67
theorems × 64
tikz-pgf × 59
arrays × 59
formatting × 55
environments × 54
alignat × 53
line-breaking × 50
alignment × 48