{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}.

learn more… | top users | synonyms (2)

25
votes
1answer
63k 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?
25
votes
3answers
4k views

German language: use of comma in numbers

In German the comma rather than the period is used as a decimal separator and the dot is used as a thousands separator: 12.345,67. The comma creates some unwanted space when used as in $12.345,67$. Is ...
25
votes
3answers
2k views

Why are so many symbols restricted to math mode?

A common beginner's mistake is to forget \(...\)/$...$ around symbols that require math mode. Why doesn't (La)TeX let people use isolated symbols in text mode by default? I am sure there are at ...
25
votes
1answer
17k views

Difference between \textrm{} and \mathrm{}

Can you explain me what is the difference between \textrm{} and \mathrm{} when they are used in math mode. In what context one is preferred over the other?
25
votes
4answers
11k views

Prevent line breaking in inline math, but allow flexible spacing

How can I easily tell Latex to prevent line-breaks inside a part of an inline formula, without affecting inter-word spacing? Writing something like $ab(c+d)$ in Latex is bad: Latex might put a line ...
25
votes
1answer
622 views

What exactly is a “single character” or “symbol” in math mode?

There are at least three instances where single symbols in math mode receive a special treatment by the TeX engine: 1. when accents are placed, 2. when a math operator is created with ...
25
votes
5answers
22k views

Lowercase \mathcal

The standard font used for \mathcal does not include any lowercase characters. The Comprehensive LaTeX Symbols List suggests redefining \mathcal to use Zapf Chancery. However I do not particularly ...
24
votes
4answers
1k views

A rather difficult ring like picture to be drawn

I desire a figure similar to the following: \documentclass[tikz,margin=10pt]{standalone} \usepackage{mathtools,amssymb} \begin{document} \begin{tikzpicture}[scale=2,transform shape] \draw (1,0) ...
24
votes
5answers
2k views

Macro for \left( and \right)

I know there has been discussion about this topic, but I haven't seen a working solution. Is it possible to define a macro within LaTeX, such that inside math mode, ( would produce \left( and ) would ...
24
votes
5answers
7k views

Faster way of writing \mathbf

Is there a quicker way of doing boldface in math mode instead of typing out \mathbf{} each time? (It gets cumbersome when you denote simple vectors with boldface...)
24
votes
3answers
724 views

Strange default exponent positioning?

Why is this red exponent so far away from the right parenthesis? To my eye it is too far away. \documentclass{article} \usepackage{xcolor} \begin{document} ...
24
votes
3answers
38k 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?
24
votes
6answers
2k views

Bad positioning of math accents for the beamer standard font

With a recent TeX distribution, the easy answer to this question is "load the sansmathaccent package" (which is Ariel's implementation of my answer). Actually, the corrected font should be loaded ...
24
votes
4answers
4k views

Numbers outside Math environment

Should numbers inside the text be placed inside a math environment? For example, if I am writing ...indent code by 4 spaces..., should I write it this way or ...indent code by $4$ spaces...? ...
23
votes
5answers
10k views

What's the best way make an “augmented” coefficient matrix?

When studying systems of linear equations, it's nice to remind people that the last column of the coefficient matrix holds the constants. This is often done in books by putting a vertical line ...
23
votes
3answers
6k views

Overlay symbol with another

Is it possible to overlay a symbol with another? I want to write an equal sign with a question mark overlayed (or the other way around). Note I don't want \stackrel{?}{=} I want the question ...
23
votes
3answers
1k views

maths nested superscripts and subscripts displayed incorrectly inline

I am having a strange bug when using nested superscripts and subscripts in inline math (displaystyle works fine). This behaviour is the same independently of the font used or the compiler (orginally ...
23
votes
3answers
3k views

Beamer: Uncover underbrace

I've got an underbrace (\underbrace{foo}_{bar}) which I want to uncover (i.e. foo should be there from the beginning, while the underbrace and the bar should be uncovered on the next slide. I've tried ...
23
votes
2answers
2k views

Getting a tikz picture to have an equation number

I make a lot of commutative diagrams and am trying to switch to Tikz from amcd,diagrams, etc. I often have to refer to these diagrams in the text and would rather have them as equations (i.e. with and ...
23
votes
3answers
524 views

How to capture the current math style?

\mathchoice helps to distinguish between math styles: \mathchoice {<something in \displaystyle>} {<something in \textstyle>} {<something in \scriptstyle>} {<something in ...
23
votes
2answers
7k views

Upper triangular matrix with big zero in lower triangular?

I can represent an upper trapezoidal matrix say as shown below. I would like to replace all those zeros with a single big zero that spans across the low triangle rows and columns, and maybe also add a ...
23
votes
2answers
2k views

How to get a \mid binary relation that grows

This question relates to one about getting a vertical bar longer than \mid. How to get a vertical bar which is longer than \mid ? However while the given \middle| solution works for me, it no longer ...
23
votes
1answer
5k views

Is there a difference between \ge and \geq (or equivalentely between \le and leq)?

I have always used \geq, but recently saw a document where the person uses \ge. Once compiled, they look the same, but I searched to see if there was any difference between the two or a guideline as ...
22
votes
3answers
16k views

Differences between \stackrel and \stackbin

What are the differences between \stackrel and \stackbin? In what situations is it better to use one or the other?
22
votes
5answers
4k views

Is it possible to use Linux Libertine as a mathematical font?

I recently heard that there is a package called unicode-math that makes it possible to use an ordinary TTF/OTF font for mathematic typesetting. To what degree is that possible with Linux Libertine? I ...
22
votes
5answers
10k views

Equations in section heading/title

For reasons that are beyond me, the following MWE \documentclass{scrreprt} \usepackage{classicthesis-ldpkg} \usepackage{bm} \usepackage{amsmath} \begin{document} \section{The values of $\beta$ for ...
22
votes
2answers
2k views

Difference of the \dots*

I came to wonder, what is the difference between the following? \dotsc \dotso As well as between: \dotsb \dotsi \dotsm
22
votes
2answers
2k views

The mysteries of \mathpalette

I would like to make a macro, \vfrac, which output would look like: $$\displaylines{ \displaystyle\raise.25ex\hbox{$\displaystyle1$}\!/\!\lower.5ex\hbox{$\displaystyle2$} \cr ...
22
votes
3answers
17k views

Bold math: Automatic choice between \mathbf and \boldsymbol for Latin and Greek symbols?

This is a follow-up to this question. Suppose you want to denote vectors by upright bold letters; then \mathbf{u} works fine, except that if it's a Greek letter you have to use \boldsymbol{\omega} ...
22
votes
1answer
384 views

Sloppy \left and \right?

The \left and \right commands often produce improvidently large delimiters. It almost always looks better to use delimiters that are just slightly too small than delimiters that are too large. With ...
22
votes
1answer
586 views

is there a “size-independent” method for overlaying two symbols to form a composite?

in this question a composite symbol "diamond plus" is requested for use with plain TeX. a good-looking version was provided, but it works in only one size. if the same symbol is needed for a title or ...
21
votes
5answers
2k views

Huge matrix in my document. Possible ways to make it look better?

The following is the source for a matrix I'm using in my document: \documentclass{scrartcl} \usepackage[english]{babel} \usepackage[T1]{fontenc} \usepackage[latin1]{inputenc} \usepackage{amsmath} ...
21
votes
3answers
49k views

How to do the 'curvy L' for Lagrangian or Laplace Transforms?

I am new to TeX, working on it for about 2 months. Have not yet figured out how to script the 'curvy L' for Lagrangian and/or for Laplace Transforms. As of now I am using the 'L' - which is not good! ...
21
votes
3answers
14k views

Dot Derivative Discrepancy

I am trying to typeset some higher-order time derivatives using the dot notation, and I've noticed something strange. The expressions $\dot y + y = \cos(\dot y)$ $\ddot y + y = \cos(\dot y)$ give ...
21
votes
2answers
18k views

What do the pieces of LaTeX, \left and \right, respectively mean?

What are their uses and are they even standard?
21
votes
2answers
889 views

Percent sign in a box

Is it possible to make a symbol which is a % inside a square box? I would like to use it to represent the function f(n,m) = n-(n % m). As in n symbol m. Or... is there a better idea for this ...
21
votes
2answers
32k 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 ...
21
votes
1answer
29k views

Symbol for Gaussian distribution

What is the symbol for the normal density function in LaTeX?
21
votes
2answers
3k views

Automatic thousands separators?

I want to typeset big numbers with a separator (e.g a space or a ",") between hundreds and thousands, etc... For example 1 Million = 1 000 000. I know the package siunitx which does it very well, but ...
21
votes
3answers
5k views

Nice-looking p-th roots

When I take the pth root, the bottom of the p comes very close to the \sqrt symbol. In the New Century Schoolbook font (which I am using), the p actually intersects the \sqrt symbol, which looks even ...
21
votes
1answer
1k views

Symbol for cube

I've searched the Internet, but got nothing. In LaTeX, we can use \square for square, but how can we get a cube, I want to use it in an equation. Here is the picture:
21
votes
4answers
898 views

How to turn a figure into a symbol?

I have some figures, for e.g., finite graphs, lattices or knots, that I have drawn in eps (or pdf) format. I would ideally love to have maps indexed by these figures. However, these figures are not ...
21
votes
1answer
20k views

Square brackets in math mode without the bracket symbols

Is there a way to typeset a square bracket without using the symbols [ and ]? What I am looking for is like \vert instead of |. Motivation is a need for a workaround in using LaTeX formulas inside ...
20
votes
2answers
3k views

How to change default for spacing around binary relations?

In TeX and LaTeX, the math binary relations (like =, \parallel, <, \le ...) have a default (rubber-length) spacing to either side, which is too large for my liking. How can reduce it?
20
votes
3answers
9k views

How to put a brace on the right, not left, to group cases?

How can I get a brace on the right, not the left, to group cases, using cases? (I know actual cases look better with the brace on the left, but the items I need to group are not literally cases. They ...
20
votes
3answers
330 views

Why does \[…\] do the wrong thing at the top of a page?

Upon reading What are the differences between $$, [, align, equation and displaymath?, I decided I really wanted to understand what was going on inside \[...\] and so I devised some tests. What I ...
20
votes
4answers
171k views

Not equal sign (≠) with a vertical bar

Is it possible to get a \neq but with a vertical bar instead of a slanted one? There are inequality operators like AMS's \gvertneqq that feature this kind of "not equal" but not without mixing it with ...
20
votes
2answers
5k views

\boxed{}, TikZ and colored equation background

I wonder if someone could provide me with a simple MWE for using TikZ together with \boxed to produce a colored equation background. If possible with rounded corners. I am using \boxed{} inside the ...
20
votes
2answers
3k views

How can I prevent LaTeX from breaking inline formulas globally?

I am using the acmsmall template and my inline formulas are being broken at equal signs and arrows; how can I prevent them from being typeset like that globally (i.e. without having to put tildes ...
20
votes
2answers
9k views

how to select math font in document

I want to show in one document different font examples of math fonts, for example Latin Modern, Times and Charter. I know the command \usefont{T1}{lmr}{m}{n}, but have no idea how to combine that ...