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 ...
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 ...
Sandy G's user avatar
  • 39k
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....
Carlos Llosa's user avatar
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}...
Moriambar's user avatar
  • 11.3k
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} \...
Bernard's user avatar
  • 270k
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 ...
Sandy G's user avatar
  • 39k
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)
iamaziz's user avatar
  • 581
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} \...
Oleg Lobachev's user avatar
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 ...
Mico's user avatar
  • 496k
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 ...
Mico's user avatar
  • 496k
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 ...
David Carlisle's user avatar
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} ...
egreg's user avatar
  • 1.1m
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} \...
egreg's user avatar
  • 1.1m
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,
David Carlisle's user avatar
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 ...
Zarko's user avatar
  • 293k
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}
egreg's user avatar
  • 1.1m
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,...
egreg's user avatar
  • 1.1m
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 \...
Au101's user avatar
  • 10.3k
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 ...
Bernard's user avatar
  • 270k
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{...
Sandy G's user avatar
  • 39k
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}}} \...
Werner's user avatar
  • 598k
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 ...
barbara beeton's user avatar
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} ...
egreg's user avatar
  • 1.1m
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{\...
Bernard's user avatar
  • 270k
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 ...
egreg's user avatar
  • 1.1m
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{...
Arun Debray's user avatar
  • 7,096
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 ("...
Sebastiano's user avatar
  • 52.7k
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*...
egreg's user avatar
  • 1.1m
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)
David Carlisle's user avatar

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