Skip to main content
Share Your Experience: Take the 2024 Developer Survey
201 votes
Accepted

Which OpenType Math fonts are available?

The TeX Gyre Fonts Latin Modern This is the default font family loaded by unicode-math, but can also be set up explicitly. It is an OpenType version of Latin Modern, a clone of DEK’s Computer Modern, ...
112 votes
Accepted

Is the effect of dollar sign the same as textit?

No Really, no! $ ... $ is the TeX way of entering math mode - specifically, inline math mode. What this means is that it puts you in a mode configured perfectly for mathematics - not italic text. ...
Au101's user avatar
  • 10.3k
78 votes
Accepted

Bizarre spacing with 4 $\star$s

Math symbols have different classifications and \star like - is a classed as binary operator. TeX assigns different space between symbols of each type, but also binary operators if not appearing in &...
David Carlisle's user avatar
71 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
  • 44.4k
65 votes
Accepted

avoid space after commas used as thousands separator in math mode

There are different classes of mathematical symbols in LaTeX, as discussed in this question: What is the difference between \mathbin vs. \mathrel? Depending on the class of a math symbol, surrounding ...
Steven B. Segletes's user avatar
60 votes

How do you get \mathbb{1} to work (characteristic function of a set)?

Playing some necromancy here, the answer looks very different in 2021. I especially advise against using bbm, as the accepted answer suggests, since the old-fashioned font format it loads will come ...
Davislor's user avatar
  • 44.6k
60 votes

How can I prevent inline math formulas from overflowing into the margin?

If your formular is not too long for a line in the first place, you can use \sloppy in the begining of your paragraph: The lineshape of the imaginary part of the susceptibility (e.g. $\mathrm{\...
Walter Lars Lee's user avatar
60 votes

Making a thicker \cdot for dot product (that is thinner than \bullet)

Here is a simple trick which needs the amsmath package. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation*} a \boldsymbol{\cdot} b = 0 \end{equation*} \end{document} ...
Hosein Rahnama's user avatar
58 votes

A short hyphen in a math formula

I think this is simpler. $r{\text -}number(5)=120$
Passenger's user avatar
  • 579
56 votes

Absolute Value Symbols

The physics LaTeX package also implements abs and norm: \documentclass{article} \usepackage{physics} \begin{document} \[ c = \abs{-c} \] \[ \vu{a} = \frac{\vb{a}}{\norm{\vb{a}}} \] \end{...
NauticalMile's user avatar
54 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....
Car Loz's user avatar
  • 641
53 votes

Symbol for Gaussian distribution

From Wikipedia: where code for the displayed equation is: \[ X \sim \mathcal{N}(\mu,\,\sigma^{2})\,. \]
Zarko's user avatar
  • 298k
51 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.5k
47 votes

Are \( and \) preferable to dollar signs for math mode?

It is instructive to examine the exact definitions of \( and \) that are provided by the LaTeX kernel (contained in the file latex.ltx), version early 2016: \DeclareRobustCommand\({% \relax\ifmmode\...
Mico's user avatar
  • 511k
47 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
  • 272k
47 votes
Accepted

What does \smash do, and where is it documented?

As the name implies, \smash takes its contents and prints it as if its height and depth were zero. The definition in LaTeX is carried over from the one in plain TeX, with a slight difference; I'll ...
egreg's user avatar
  • 1.1m
46 votes

\mid, | (vertical bar), \vert, \lvert, \rvert, \divides

Another option which was not mentioned in any of the comments above is: F=\left.\frac{\partial f}{\partial x}\right|_{\hat x_{k-1}} I hope this helps someone else.
desmond13's user avatar
  • 1,034
46 votes

Why would I need to put a $?

Alternative: Don't worry yourself about such things or risk running in such errors, simply let the siunitx package do it for you: \documentclass{article} \usepackage{siunitx} \begin{document} the ...
samcarter_is_at_topanswers.xyz's user avatar
43 votes
Accepted

Are ^ and _ the only commands in LaTeX not preceded by a backslash?

In TeX and LaTeX, it is vital to distinguish between "commands" or "control sequences" on the one hand and TeX-special characters on the other. Only the former begin, in general, with a backslash (\) ...
Mico's user avatar
  • 511k
43 votes
Accepted

Latex vs Groff for mathematics formatting

Equations in roff roff (or groff or any other implementation) doesn't actually support mathematics typesetting. To this end you have to use a preprocessor which transforms equations in your document ...
Henri Menke's user avatar
42 votes

What is the meaning of $$$ in LaTex?

The markup is completely wrong and should be removed, but to answer the question of what it means \begin{equation} $$$ \notag \displaystyle\int_{-1}^{2} x^3\:dx-\displaystyle \int_{-1}^{2} 2x\:dx \\ ...
David Carlisle's user avatar
40 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
  • 601
40 votes
Accepted

How to make an old school "much less/greater" (<< and >>) symbol?

The mathabx package provides this glyph as \lll (and correspondingly \ggg). However, mathabx changes a lot of symbols. If you want only these two you may easily adapt the code from Importing a Single ...
39 votes

Braket notation in LaTeX

You can use the \langle and \rangle commands. For example, to do <0|0>, you would do: \langle 0 | 0 \rangle Result: If you have things which use vertical space (like fractions), you can use \...
Donald Duck's user avatar
38 votes

How to create this gamma symbol

A Gamma is an upside down L: \documentclass{article} \usepackage{amssymb,graphicx} \newcommand{\bbGamma}{{\mathpalette\makebbGamma\relax}} \newcommand{\makebbGamma}[2]{% \raisebox{\depth}{\...
egreg's user avatar
  • 1.1m
37 votes
Accepted

How to properly typeset math intervals

In the TeXbook, Knuth refers to people using “]a,b[” notation for open intervals as “perverse mathematicians” (page 171, exercise 18.14). I don't fully agree with the adjective, but I find the ...
egreg's user avatar
  • 1.1m
36 votes

How do I use AMS Euler?

Euler in Modern Toolchains Euler Math As of 2024, there is an OpenType version of Euler available on CTAN, Euler Math. It is a fork of Khaled Hosny and Hermann Zapf’s Neo Euler. This is the simplest ...
Davislor's user avatar
  • 44.6k
35 votes
Accepted

Why do \sqrt{1} and \sqrt{-1} have different heights?

You can see that in the case of \sqrt{-1} the radical sign is a bit lower; if you do \sqrt{\smash{-}1}, the result will be the same. This happens because the - character has a depth (equal to that of ...
egreg's user avatar
  • 1.1m
35 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
34 votes

Define a star "*" - to become a dot

\documentclass{article} % \DeclareMathSymbol{\cdot}{\mathbin}{symbols}{"01} % from fontmath.ltx \DeclareMathSymbol{*}{\mathbin}{symbols}{"01} \begin{document} $ x * y $ \end{document}
David Carlisle's user avatar

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