Skip to main content

Questions tagged [math-mode]

{math-mode} is about typesetting mathematical content, e.g. tweaking the appearance of spacing and symbols in a formula, or producing specific mathematical constructs. For questions about "wrapper" environments like equation or align, consider the tag {equations}.

Filter by
Sorted by
Tagged with
767 votes
8 answers
268k views

Why is \[ ... \] preferable to $$ ... $$?

I've heard that you should use \[ ... \] for displayed equations instead of $$ ... $$, but why is that? I'd assumed that it's so that you can more easily tell which are starting and which are ending ...
Sophie Alpert's user avatar
646 votes
14 answers
1.8m views

How can I get bold math symbols?

To make Latin-letter variables bold I can use e.g. \mathbf{a}, but while putting Greek letters or symbols such as \nabla inside \mathbf doesn't cause any errors or warnings, it also doesn't do ...
Michael Underwood's user avatar
619 votes
6 answers
957k views

What are all the font styles I can use in math mode?

As can be seen in above picture, there are lots of fonts or font styles that can be used in math mode. What are all the fonts or font styles I can use in math mode, and which packages are required in ...
doncherry's user avatar
  • 55.3k
418 votes
13 answers
103k views

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

Along the lines of Why is \[ ... \] preferable to $$ ... $$?, what reasons are there (if any) to favor \( ... \) over $ ... $?
Mark Meckes's user avatar
  • 18.2k
357 votes
10 answers
1.4m views

How can I split an equation over two (or more) lines

I am having the following equation: \begin{equation} Q(\lambda,\hat{\lambda}) = -\frac{1}{2} P(O \mid \lambda ) \sum_s \sum_m \sum_t \gamma_m^{(s)} (t) \left( n \log(2 \pi ) + \log \left| C_m^{(s)} ...
Peter Smit's user avatar
  • 14.3k
328 votes
9 answers
1.6m views

Absolute Value Symbols

What is the "best LaTeX practices" for writing absolute value symbols? Are there any packages which provide good methods? Some options include |x| and \mid x \mid, but I'm not sure which is best...
jamaicanworm's user avatar
  • 29.6k
312 votes
9 answers
816k views

Command for argmin or argmax?

How can you get the argmin or argmax in Latex? Two solutions I found are: \underset{x}{\operatorname{argmax}} \DeclareMathOperator*{\argmin}{arg\,min} Any other ideas? [1] http://www.breakthru....
Alejandro's user avatar
  • 3,806
295 votes
4 answers
811k views

What is the "correct" way of embedding text into math mode?

Lets say I have something like: \[ Let x = number of cats \] (This is a contrived example, but pretend we are actually inside a long align environment block...) "Let" and "number of cats" need to ...
Billy ONeal's user avatar
  • 10.7k
279 votes
12 answers
227k views

How to typeset $:=$ correctly?

I like to use $:=$ for "is defined to be equal to", but this is never typeset with the symmetry one would like, as the colon is always too low relatively to the equals sign. Is there any way of ...
Oscar Randal-Williams's user avatar
264 votes
12 answers
568k views

What is the best symbol for vector/matrix transpose?

What is the best or most popular symbol for vector/matrix transpose? I have used simply ^T, for example $c^T x$. I think it is ugly, mainly because it is a little too big compared with vector ...
Chang's user avatar
  • 9,608
263 votes
3 answers
1.1m views

Big Parenthesis in an Equation

I have an equation contained inside \[...\], which automatically makes a \sum with sub- and superscripts turn big--so that the summation sign looks awkward inside parenthesis. Any idea how to make ...
jamaicanworm's user avatar
  • 29.6k
257 votes
4 answers
676k views

How to write ceil and floor in latex? [duplicate]

Is there a macro in latex to write ceil(x) and floor(x) in short form? The long form \left \lceil{x}\right \rceil is a bit lengthy to type every time it is used.
danny's user avatar
  • 2,777
256 votes
3 answers
178k 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 ...
Andy's user avatar
  • 2,675
255 votes
10 answers
652k views

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

I am trying to get the digit one printed the \mathbb{} font in math mode, however the command \mathbb{1} outputs some rubbish. I certainly saw the character I am after in some pdf's generated from ...
Grzenio's user avatar
  • 9,585
253 votes
4 answers
622k views

\mathbb{Z} yields undefined control sequence error

I am using WinEdt 6 for compiling my TeX documents. I am getting an error with contains the line $\mathbb{Z}$ showing that it is undefined control sequence. How should I rectify it? Should I include ...
Ramana Venkata's user avatar
244 votes
5 answers
548k views

Nice looking empty set?

I feel like the standard $\emptyset$ is ugly. By hand, my empty set symbol is a lot rounder, than this "slashed-zero"-type symbol. Two questions: Do people really use it (I mean people who ...
Jérémie's user avatar
  • 3,041
242 votes
2 answers
549k 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?
night owl's user avatar
  • 7,733
218 votes
3 answers
357k views

How do I put big brackets under different parts of an equation to attach text labels?

How do I put big brackets under different parts of an equation so that I can write, e.g., text specific to these parts? For example: f = x^3 + 2 |___| |__| | | text 1 text 2
user avatar
215 votes
4 answers
984k views

How to write a function (piecewise) with bracket outside?

How to write this Piecewise function using LaTeX? I tried $ \begin{array}{cc} \{ & \begin{array}{cc} 0 & x\leq 0 \\ \frac{100-x}{100} & 0\leq x\leq 100 \\ 0 & ...
GarouDan's user avatar
  • 3,301
213 votes
8 answers
519k views

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

What's the difference between the different vertical bars? $S = \{\, x \mid x \not= 17 \,\}$ $a \vert b$ implies $a \leq b$ when $b \ne 0$ $a|b$ implies $a \leq b$ when $b \ne 0$ $\lvert x \rvert$ is ...
Sophie Alpert's user avatar
212 votes
3 answers
388k views

How to color math symbols?

One can use the command such as \textcolor[rgb]{1.00,0.00,0.00}{boundary} to color the word "boundary" in a document. Here is my question: How to color the math symbols in $$? For example, can one ...
user avatar
206 votes
5 answers
177k 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 ...
niklasfi's user avatar
  • 2,293
204 votes
8 answers
867k views

How can I write cases with grouping braces on both left and right side, and split the condition into two lines in LaTeX?

The code I used to write is this one $$ X(m,n)= \begin{cases} x(n),\\ x(n-1)\\ x(n-1) \end{cases} $$ But I don't know how to write this one Also, what if I want to write this
Maryà's user avatar
  • 4,900
202 votes
4 answers
245k views

Show inline math as if it were display math (and vice versa)

I'm very familiar with how symbols display differently in inline mode (with $ ... $) vs. how display math shows them (with \[ ... \] or $$ ... $$). Two examples would be with limits $\lim_{n\...
akdom's user avatar
  • 2,345
199 votes
8 answers
151k views

Stop LaTeX from breaking an inline math equation

I hope this question was not asked before. At least I haven't found it. I have an inline math equation and LaTeX is breaking it into two parts. In this case I'd prefer to have the whole and short ...
quinmars's user avatar
  • 5,537
197 votes
7 answers
563k views

Math symbol question: Vertical bar for ''evaluated at ...''

How do I insert the line "|" after the equation in LaTeX (see image below)? I'm using LyX so if you can point me to the symbol of that line is also OK. I don't know if this line has a proper name so ...
cidadao's user avatar
  • 2,073
197 votes
1 answer
737k views

How to write N x N (with a multiplication symbol, for matrix dimensions)?

I need to write something like NxN in LaTeX but I do not get how... How to do such thing?
user avatar
184 votes
7 answers
27k views

Spacing around \left and \right

Why does the addition of a \left and \right introduces an extra space around the formula? Specifically, why do $\cos(\theta)$ and $\cos\left(\theta\right)$ render differently? Is there a way to use ...
Mateus Araújo's user avatar
184 votes
3 answers
101k views

How to get Beamer Math to look like Article Math

In a LaTeX article, the math characters are more "curvy" than the text characters: \documentclass[12pt]{article} \begin{document} $x^2 + y^2 = z^2$ \end{document} In a beamer presentation, the math ...
Tyson Williams's user avatar
179 votes
3 answers
359k views

What is the difference between \dfrac and \frac?

The title says it all, both \dfrac{a}{b} and \frac{a}{b} make fractions, so what is the difference between the two?
user93089's user avatar
  • 2,409
179 votes
6 answers
175k 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 ...
Chris's user avatar
  • 4,115
177 votes
5 answers
935k views

Real number symbol (UTF-8: ℝ) in XeTeX

How can I get the 'real number' sign (something like \mathbb{R} with the amssymb package in LaTeX) in XeTeX?
lvaneesbeeck's user avatar
  • 3,175
173 votes
2 answers
625k views

Displaying the binomial coefficient symbol in math mode

The problem is caused by the symbol of binomial coefficient (symbol of Newton), often used in math: {N}\choose{k} In my document I have formula: $$ P(A) = \sum P(\{ (e_1,...,e_N) \}) = {N}\choose{...
MC2DX's user avatar
  • 2,497
171 votes
2 answers
55k views

Which OpenType Math fonts are available?

What OpenType math fonts are there available for usage in TeX/LaTeX, e.g. with the unicode-math package? Here is a MWE which you can use to show off the font. \documentclass{article} \pagestyle{...
Henri Menke's user avatar
168 votes
1 answer
306k views

Expression under summation on multiple lines [duplicate]

Possible Duplicate: Separate long math text under sum symbol into different lines? I want to write expression \sum_{i=0}^n i with i\neq 4 under the summation symbol. How can I write this?
user12290's user avatar
  • 3,371
165 votes
2 answers
524k views

Is there a circle symbol?

Is there a circle symbol for the composition of two functions? Or do I have to resort to using other ways to represent that?
wrongusername's user avatar
164 votes
4 answers
126k views

Separate long math text under sum symbol into different lines?

I have the following equation, where there is a lot of stuff under the sum symbol: \begin{equation} d(\vec{x},\vec{y})= \sum_{Z_{xy}\in\vec{Z}_{xy},\forall x\in\vec{x},\forall y\in\vec{y}} f(...
Frank's user avatar
  • 7,365
162 votes
7 answers
100k views

Define additional math operators to be typeset in roman

Mathematical operators, such as function names, should be set in roman type, not italics. Latex already has commands for some operators, including \max, \min, and \log. How can I define additional ...
Vebjorn Ljosa's user avatar
162 votes
1 answer
492k views

tilde over a symbol Phi

Please suggest me a way to put tilde over a symbol phi. I can easily put it over a letter but coming to the case of symbols, it is giving problems. Thanks in advance.
user17404's user avatar
  • 1,621
154 votes
4 answers
490k views

How to place text as subscript under mathematical operator in equation?

I would like to put some text in math mode below a mathematical operator (or a symbol), similar to \substack in \sum, as the red text below the \max operator in the following image How to do this?
Yumyai's user avatar
  • 1,643
154 votes
6 answers
165k views

What is the advantage of using $f^\prime$ instead of $f'$?

Although the two outputs look quite similar, what is the advantage of using $f^\prime$ instead of $f'$? By the way, here is my code: \documentclass‎{article‎}‎ \begin{document}‎‎‎ \[‎ ‎f^‎\prime ‎(x)=...
Hadi Safi aghdam's user avatar
153 votes
6 answers
98k views

Allowing line break at ',' in inline math mode?

In the inline math mode ($...$), if the formula is too long, LaTeX will try to break it on operators, e.g. very long text followed by a very long equation like $a+b+c+d+e+f+g+h+i+j+k+l$ etc may be ...
kennytm's user avatar
  • 6,542
148 votes
1 answer
765k views

How to write two dot above a letter?

the two dots above a letter represents two derivative of varible t. My method: \documentclass[UTF8]{ctexart} \usepackage{amsmath} \usepackage{amssymb} \usepackage{graphicx} \usepackage{epstopdf} \...
mma's user avatar
  • 1,755
143 votes
4 answers
67k views

When not to use \ensuremath for math macro?

I have gotten into the habit of using \ensuremath around math components in every macro that I define, so that I can use the same macro inside and outside of math mode. But egreg's comments in \...
Peter Grill's user avatar
141 votes
7 answers
120k views

Should I \mathrm the d in my integrals?

When writing an integral, it seems like something should be done to separate the "d", as in \int f(x) dx, so as not to confuse it with a variable. I've seen it left as-is, bolded, and straightened. ...
Ray's user avatar
  • 1,513
138 votes
3 answers
84k views

Using \colon or : in formulas?

I noticed that in many documents you encounter $f: X \to Y$ instead of $f \colon X \to Y$. Another example are quantified expressions: $\forall x: P (x)$ versus $\forall x \colon P(x)$. I find the \...
blubb's user avatar
  • 1,711
136 votes
8 answers
118k views

How to make \left, \right pairs of delimiter work over multiple lines?

I have a very long equation that must be separated into two lines, and it has several pairs of nesting \left \right delimiters. Unfortunately, it seems that they need to be on the same line in order ...
sxu's user avatar
  • 1,550
136 votes
4 answers
259k views

"(" or "\left(" parentheses?

What is the difference between ( and \left( in LaTeX? Sometimes, when the content is small, it does not seem to matter which pair I use. What is the best practice when it comes to which parentheses ...
Tim N's user avatar
  • 10.3k
132 votes
3 answers
451k views

How do I add a line break in display math mode?

For instance, how do I add a break after the first line in \[ a + b = c // what should I add here? a = c - b \]
David Faux's user avatar
  • 4,147
127 votes
7 answers
241k views

How to add extra spaces between rows in tabular environment?

I couldn't find any option that lets me expand the vertical space between rows in tabular environment. For example, \begin{tabular}{c c} $f^{(n)}(x)$ & $f^{(n)}(0)$ \\ $-2xe^{-x^{x^{x^2}}}...
roxrook's user avatar
  • 9,977

1
2 3 4 5
196