170
votes
Command for argmin or argmax?
Summary
In the sequel, LaTeX is assumed.
Preliminary questions
1. Should a thin space separate “arg” from “min”?
This is a matter of personal preference. The default definition for \limsup has a thin ...
Community wiki
70
votes
Accepted
How do you make your own symbol when Detexify fails?
If it's really not in Detexify, check the Comprehensive LaTeX Symbol List to see if your symbol can be found in an existing package. Note, The Comprehensive List is long! Over 300 pages. But it is ...
48
votes
double perpendicular symbol (for independence)
One can also use
\newcommand{\ind}{\perp\!\!\!\!\perp}
It basically makes two orthogonal symbols very close to each other. The number of \! controls the space between each of the orthogonal symbols....
48
votes
Accepted
Position the limits of Sum
The problem is that you're trying to use displaystyle limits in text mode. Which is not that good, as I explain below.
I don't know if it's typographically correct but the code is
$\sum\limits_{i=0}...
46
votes
Accepted
Is there a short hand command to write derivatives?
You can use the esdiff package, which has handy macros for derivatives and partial derivatives, taking care of indices. Here is a demo;
\documentclass{article}%
\usepackage[utf8]{inputenc}
\...
40
votes
How to create a new math operator?
A simple solution would be to use the \DeclareMathOperator* command from the amsmath package. The unstarred version places sub- and superscript limits to the right of the operator; the starred version ...
39
votes
Command for argmin or argmax?
Use \usepackage{amsmath} and then:
\operatorname*{argmin}_\theta f(x)
Or similarly (for adding a space),
\operatorname*{arg\,max}_\theta f(x)
33
votes
Is there a short hand command to write derivatives?
Oh, you mean not symbol, but operator. There is physics, as stated by @Zarko.
\differential produces the variants of d: \dd x
\derivative yields the $df/dx$ in variants: \dv{x}, \dv{f}{x}
\...
29
votes
Re-define "mu" in "$\mu$m" for units (upright \mu instead of italic \mu)
Per your comments, you are using "mu" to denote "micro", as in one millionth of some scientific unit. Given this situation, you need to get out of the business of attempting to ...
28
votes
Accepted
What does "rel" in `\mathrel` and `\stackrel` stands for?
You asked,
What does rel in \mathrel and \stackrel stand for?
The meaning of rel in mathrel quickly becomes fairly obvious if one considers the entire list of 13 types of math atoms; see also p. 158 ...
26
votes
Accepted
About the use of curly braces
Note that the braces are not just not required, they should not be used as \cos does not take an argument the braces form a group and force the term to lose any special math class that it would ...
24
votes
How can I write something above and below the signs?
I propose using \gtrless of amssymb, to begin with.
The “official” way would be
\underset{H_0}{\overset{H_1}{\gtrless}}
but the effect is the same with more efficient code:
\documentclass{article}
...
24
votes
Accepted
How do I make customized $\sum$ operator?
Here's a possibility. Only text and display style, I hope you don't need them in subscripts, superscripts or small fractions.
\documentclass{article}
\usepackage{amsmath,amssymb,graphicx}
\...
24
votes
Accepted
Symbol for m by n matrix
You could use $m{\times}n$ so that you get mathord spacing (i.e. no extra space) rather than the default mathbin spacing,
24
votes
Accepted
Build this formula in LaTeX
This should be a part of basic knowledge about LaTeX ... For example:
\[
PR_i = \frac{1-d}{n} + d \sum_{j\in\{1,\dots,n\}}} \frac{PR_i}{c_j}
\]
I strongly encourage you to read No so short ...
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
How to change color of operators (lim, log, etc.)?
Here's a possibility; I wouldn't hack into \mathop, which is a primitive also used in several other situations (in \overset, for instance).
\documentclass{article}
\usepackage{xcolor,amsmath,xpatch,...
22
votes
Accepted
Making the product operator (pi caps) with the extremes above and below the symbol
Please be aware that the default behaviour in displaymath mode is for the limits to appear above and below the symbol:
\[
\prod_{i = 1}^{n} a_{i} \quad \sum_{i = 1}^{n} a_{i} \quad \lim_{n
\to \...
22
votes
Accepted
Rounding to nearest integer symbol in Latex
The mathtools package has a \DeclarePairedDelimiter command which lets you define such macros. I defined a \nint command which encloses its argument between \lfloor and \rceil. The starred version ...
21
votes
Accepted
Partial tensor product sign
Here is an easy "design-your-own" TikZ solution.
Advantages: Easy. Nicer corners compared to clipping.
Disadvantage: Not truly the exact spacing of \otimes. But close.
Code:
\documentclass{...
20
votes
Accepted
How to change color of operators (lim, log, etc.)?
You could tap into the primitive \mathop:
\documentclass{article}
\usepackage{xcolor,amsmath}
\DeclareMathOperator{\abc}{abc}
\let\oldmathop\mathop
\def\mathop#1{\oldmathop{\textcolor{red}{#1}}}
\...
20
votes
About the use of curly braces
operators like \cos or \sin don't require curly braces, because they don't
take arguments; they're simply substitutions.
any command that takes an argument is best fed that argument in braces.
even ...
20
votes
Accepted
Why is this weird space appearing after my minus sign
You're using “mod” as a math operator like “exp” or “sin”. The command \mod is for notation such as
5 \equiv 2 \mod{3}
and the inserted space is obviously wanted here.
Use \operatorname{mod} ...
20
votes
How do you make your own symbol when Detexify fails?
Another possibility with the \stackinset command, from stackengine:
\documentclass[border = 2pt]{standalone}
\usepackage{stackengine, graphicx} %
\newcommand{\simtimes}{\stackMath\mathbin{\...
19
votes
Accepted
Spacing using operators
You get different spacing because of the rules of TeX.
With $f=\mathop{\rm id}_Y\circ f$ we have
Ord Rel Op Bin Ord
Looking at the table at page 170 of the TeXbook, we can add the spacing between ...
19
votes
Accepted
Defining \tg so it behaves exactly like \sin and \cos?
All you need to do is write \DeclareMathOperator{\tg}{tg}; this defines the command \tg to use the normal math font. Then, you can define \tgx to just be \tg x:
\documentclass{article}
\usepackage{...
19
votes
Is there a short hand command to write derivatives?
There is also another important and easy package to write
ordinary derivate and partial derivatives named derivative. I have added only some simple examples how to use this package where the d ("...
19
votes
Accepted
How to make a vertical \iff?
\Updownarrow is an extensible symbol, so you can use \Big in front of it.
\documentclass{article}
\usepackage{amsmath}
\newcommand{\Longupdownarrow}{\Big\Updownarrow}
\begin{document}
\begin{align*...
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)
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
math-operators × 966math-mode × 374
symbols × 158
amsmath × 126
spacing × 82
macros × 66
fonts × 45
mathtools × 33
subscripts × 32
unicode-math × 24
equations × 23
relation-symbols × 19
logic × 18
superscripts × 15
horizontal-alignment × 14
typography × 14
brackets × 14
tikz-pgf × 13
formatting × 13
vertical-alignment × 12
delimiters × 11
xetex × 10
align × 10
packages × 10
mathjax × 10