{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)

9
votes
2answers
28k views

Dot notation for derivative of a vector [closed]

If I want to use the dot notation for the time derivative of a vector is better (more common) to put the dot over the vector, or the other way around \dot{\vec{v}} \vec{\dot{v}} The first says ...
56
votes
5answers
90k views

How to add a matrix to a LaTeX document

How do we add a matrix to a LaTeX document?
20
votes
1answer
358 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 ...
21
votes
3answers
15k 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} ...
19
votes
3answers
740 views

How can I create a new extensible symbol?

Given an arbitrary thin vertical symbol, can I create a new math delimiter from it (and if so, how)? Edit: Ideally, I would like to be able to create an extensible symbol, either built out an ...
36
votes
4answers
3k views

What is the Necessity of $…$ Around Numbers?

I typed up an assignment with a lot of numbers in LaTeX and turned it in to my adviser. When he returned it to me with some corrections, one of which was a lot of $ around my numbers. I understand ...
28
votes
3answers
4k views

How to have overlapping under-braces and over-braces

I am trying to typeset an equation that has overlapping over and under braces as per the image below: I have managed to typeset it using a sort of a hack, by typing the equation twice, once using ...
12
votes
1answer
1k views

Which version of LaTeX permits more than 16 alphabets?

Sometimes I receive a message: ! LaTeX Error: Too many math alphabets used in version normal. I know that there is a limit of 16 alphabets at most allowed to one article. However this message ...
16
votes
2answers
790 views

How to align nested cases?

Please consider the code bellow: \begin{align*} function = \begin{cases} case1 &\mbox{if } n = 0 \\ \begin{cases} case2 &\mbox{if } n = 1 \\ ...
15
votes
3answers
8k views

How to stack limits for maths operators?

I have a question on how is it possible to create a \sum with two lower limits directly positioned right underneath each other. I have tried hard and cant seem to get anywhere with it.
29
votes
1answer
45k 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 ...
20
votes
2answers
2k views

Typesetting Right-to-Left math

UPDATE: I've managed to produce something that is aesthetically correct, however with a lot of "hardcoding" and trial and error to manually measure my spaces. Not to mention that I have to write my ...
16
votes
1answer
605 views

Which command should I use for textual subscripts in math mode?

Textual subscripts like in W_{total} should be typeset in an upright text font (so that code isn't good practice), as has been discussed in various questions here. Now there are several ways to ...
16
votes
2answers
7k views

double perpendicular symbol (for independence)

I found from http://jblevins.org/notes/latex that I could use the independence symbol: \newcommand\independent{\protect\mathpalette{\protect\independenT}{\perp}} ...
14
votes
3answers
1k views

How can I illustrate decimal to binary conversion?

As part of my homework for discrete math I need to convert different decimal values, both positive and negative, to 8-bit binary representations using signed magnitude, 1's complement, and 2's ...
27
votes
6answers
17k views

Typesetting of negative versus minus?

I've occasionally seen a negative (when a number is simply negative, not a subtraction), typeset as negative sign that's slightly skinnier and above the centre line of text. Is this proper notation ...
22
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 ...
16
votes
3answers
2k views

Typesetting a Row Vector

In the question typesetting a column vector, a very nice solution was given for typesetting a column vector with an arbitrary number of rows. I am attempting to modify the code to produce row vectors ...
15
votes
4answers
8k views

Evaluation of Differentiation and Integration

I was having some thought about what would be the syntax to make the end point evaluation of derivatives or integrals. Such as making the | with the two end points of evaluation on the top an bottom ...
9
votes
3answers
2k views

Arrow between parts of equation in LaTeX

I want to make an arrow under an equation pointing from one part of the equation to another. A bit like an underbrace, but with an arrow. How can I do this?
8
votes
3answers
24k views

How to make math symbols bigger?

Is there a way to make math symbols bigger? Reason: I've used \sfrac{q}{m}, and those symbols appear far to small, so I would like to make them a bit bigger. edit: I just thought that \sfrac{q}{m} ...
7
votes
1answer
284 views

Looking for a smarter \left … \right

I'm looking for an automatic fence-resizing macro like the traditional \left and \right, but I need some more features (not to mention \left and \right are quite "buggy" and poorly spaced as the ...
16
votes
3answers
4k views

\DeclareMathOperator won't take arguments

I'd like to define a family of math operators that have the same superscript, but different subscripts. My first attempt was: \DeclareMathOperator{\Upd}[1]{U^M_{#1}} But the log tells me that: l.3 ...
13
votes
2answers
2k views

How can I change the whitespace above and below math displays?

I'm looking to squeeze an article written in LaTeX with amsmath to a set number of pages. In the text, I have a number of numbered math displays which I refer to throughout. However, they take up ...
12
votes
3answers
291 views

How could LaTeX replace the tokens <= by the command \leq?

How could LaTeX replace the tokens <= by the command \leq efficiently? Example 1: I have this code: \[ 2x <= 4x - 2 \] And I want to get after the compilation this: Example 2: \[ ...
11
votes
2answers
6k views

Is there an “underscript” command?

Is there a way to do underscripts? By "underscript" I mean a small font underneath the text object like limits or sums have. I don't want it to behave like a math operator though, where it is typeset ...
9
votes
2answers
618 views

Preventing \MakeUppercase from affecting mathematics

Is there a way to prevent \MakeUppercase from affecting in-text equations? In this example, abc should change to ABC, but n should be left as it is. \documentclass{article} \begin{document} ...
7
votes
1answer
2k views

Punctuation in equations

My document will contain a lot of equations, and as usual in that case I would like to use "punctuation" in the equations, like commas, colons, periods/full stops, semicolons, etc. Is there a special ...
14
votes
2answers
4k views

\star vs. \ast in formulas. Which one to use?

When you read a formula aloud you say "r and r-star are related by this formula". If you write this formula down you normally write an r with a six-handed star, which would actually be an asterisk and ...
14
votes
3answers
3k views

Can I insert an image into an equation?

I would like to use a small image in an equation, where a symbol like \alpha might otherwise be. Is there a nice way to do this?
13
votes
4answers
2k views

Draw a line through one column of a matrix

I'd like to "cancel" (draw a line through) a column of a matrix (using \begin{pmatrix}..\end{pmatrix}). How can I do this?
13
votes
4answers
4k views

Intertext vertical spacing

How do I reduce the vertical spacing of \intertext?
11
votes
2answers
2k views

Oversized \underbrace's label causes unwanted spacing

Consider this: \left( x-1 \right) \underbrace{ \left( ? \right) }_{ \text{what is this?} } The label is longer than the braced portion, which causes unwanted space between the parentheses. Is ...
11
votes
3answers
1k views

Define particle names to use upright greek letters in math mode

Currently I have my electron neutrino & beta particle marco defined as \newcommand{\eneutrino}{\ensuremath{\nu_e}} \newcommand{\belectron}{\ensuremath{\beta^{-}}} ...
10
votes
2answers
735 views

Defining scalable “white curly brackets” {| and |} (⦃ and ⦄)

I would like to construct what Unicode calls "white curly brackets" that are in addition scalable. They look like ⦃ (≈{|) and ⦄ (≈|}) and have Unicode codepoints U+2983 and U+2984. unicode-math has ...
10
votes
3answers
2k views

How can I manually choose the size of a wide accent? (math mode)

I would like to replace the usual \hat in maths with a larger one, but I do not want it to stretch. The size I want is "the smallest \widehat" (as in $\widehat{.}$). Is there a way to put that one ...
9
votes
1answer
497 views

Can I change all math output to use monospaced text?

Is there any way of modifying the preamble, so instead of typing $\mathtt{x}$ ... \begin{eqnarray} \mathtt{y} & \mathtt{=} & \mathtt{z^\pi} \end{eqnarray} I can omit the \mathtt{...} ...
8
votes
2answers
276 views

How can I use color in a mathematical expression without losing horizontal spacing?

How can I use color in a mathematical expression without losing horizontal spacing? \documentclass{article} \usepackage{xcolor} \definecolor{red}{HTML}{dd0000} \begin{document} \[3+(-5)-2+3\] ...
8
votes
3answers
750 views

Align \sqrt with baseline of other mathematical input

The following mathmatical expression is not being displayed the way I expect it to be. \documentclass{article} \usepackage{amsmath,amssymb} \begin{document} $3x\sqrt{y}-4-2\sqrt{y}+6x$ \end{document} ...
8
votes
2answers
2k views

How to get a vertical bar which is longer than \mid ?

sometimes when writing mathematical expression with partial derivatives, one needs to write a vertical bar afterwards and write the value at the which the partial derivatives are being computed as ...
7
votes
1answer
181 views

How to automatically add \! in subscripts?

This code \documentclass{article} \usepackage{fouriernc} \begin{document} $a_1$ $a_{\!1}$ \end{document} produces this output: I like the spacing on the lower one much more. Is there a way to ...
6
votes
1answer
798 views

Using \leftroot{}, \uproot{} with closed square root symbol

As mentioned in this answer to Nice-looking p-th roots the amsmath package provides \leftroot{} and \uproot{} which allow you to move the position of the root to the left, and up in small increments. ...
6
votes
2answers
5k views

overset text over equal sign in in an Align environment

Look at the following example \begin{align} & x \\ \overset{\text{some long explanation}}= & foo \\ & = bar \end{align} what is the best way to get the equal signs ...
4
votes
4answers
219 views

Incorrect delimiter size in math mode

The following code \documentclass{article} \begin{document} \[ \left|\tilde{\theta}\right| \] \[ \left|\theta\right| \] \end{document} produces the following output using pdfLaTeX (TeXLive 2012 ...
25
votes
3answers
1k 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 ...
22
votes
1answer
14k 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?
13
votes
1answer
3k views

A Matrix with labels, dashed lines

I'm trying to TeX the following matrix, from Guillemin and Pollack (1.4 #13) The best I've been able to do is get the dashed lines with \[ \left( \begin{array}{c:c} B & C \\ \hdashline D ...
12
votes
3answers
703 views

Replace the `$$ … $$` macro with the `\[ … \]` macros? - Prefer the way LaTeX lays it out, but `$` are faster to write

Is there a way to replace the $$ ... $$ macro with the \[ ... \] macros? (and replace inline mathmode as well) I realised the only way I can write the \sum_{i=1}^{10} t_i is between the \[ ... \] ...
11
votes
1answer
341 views

Which packages/practices are relevant for writing Structured Derivations? (similar to Dijkstra's calculational style of proofs)

Does anyone know of any packages that support this style of writing proofs? The only things that I've found are: tex-ewd, a bunch of plain TeX macros on CTAN written specifically with Dijkstra in ...
10
votes
2answers
927 views

Exchange meaning of : and \colon

I usually use the colon symbol : to denote maps. For set syntax there is the braket package. So as the spacing of : is not appropriate, I want it to behave like \colon. I tried ...