Quantcast
  • Register
PhysicsOverflow is a next-generation academic platform for physicists and astronomers, including a community peer review system and a postgraduate-level discussion forum analogous to MathOverflow.

Welcome to PhysicsOverflow! PhysicsOverflow is an open platform for community peer review and graduate-level Physics discussion.

Please help promote PhysicsOverflow ads elsewhere if you like it.

News

PO is now at the Physics Department of Bielefeld University!

New printer friendly PO pages!

Migration to Bielefeld University was successful!

Please vote for this year's PhysicsOverflow ads!

Please do help out in categorising submissions. Submit a paper to PhysicsOverflow!

... see more

Tools for paper authors

Submit paper
Claim Paper Authorship

Tools for SE users

Search User
Reclaim SE Account
Request Account Merger
Nativise imported posts
Claim post (deleted users)
Import SE post

Users whose questions have been imported from Physics Stack Exchange, Theoretical Physics Stack Exchange, or any other Stack Exchange site are kindly requested to reclaim their account and not to register as a new user.

Public \(\beta\) tools

Report a bug with a feature
Request a new functionality
404 page design
Send feedback

Attributions

(propose a free ad)

Site Statistics

206 submissions , 164 unreviewed
5,103 questions , 2,249 unanswered
5,355 answers , 22,794 comments
1,470 users with positive rep
820 active unimported users
More ...

  MathJax basic tutorial and quick reference

+ 30 like - 0 dislike
52898 views
  1. To see how any of the formulas were made in any question or answer, including this one, use the "edit" link to view the complete source. To quickly see the source of a single expression, right-click on it and choose "Show Math As > TeX Commands".

    (Note that in some browsers, such as Firefox, the MathJax right-click menu that contains this command will be obscured by the browser's own right-click menu. Click somewhere outside the main browser canvas -- such as in the address bar -- to dismiss the browser menu and reveal the MathJax one behind it).

  2. For inline formulas, enclose the formula in $...$. For displayed formulas, use $$...$$. These render differently: $\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$ (inline) or $$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}\tag{displayed}$$

  3. For Greek letters, use \alpha, \beta, …, \omega: $\alpha, \beta, … \omega$. For uppercase, use \Gamma, \Delta, …, \Omega: $\Gamma, \Delta, …, \Omega$.

  4. For superscripts and subscripts, use ^ and _. For example, x_i^2: $x_i^2$.

  5. By default, superscripts, subscripts, and other operations apply only to the next "group". A "group" is either a single symbol, or any formula surrounded by curly braces {}. If you do 10^10, you will get a surprise: $10^10$. But 10^{10} gives what you probably wanted: $10^{10}$. Use curly braces to delimit a formula to which a superscript or subscript applies: x^5^6 is an error; {x^y}^z is ${x^y}^z$, and x^{y^z} is $x^{y^z}$. Observe the difference between x_i^2 $x_i^2$ and x_{i^2} $x_{i^2}$.

  6. Parentheses Ordinary symbols ()[] make parentheses and brackets $(2+3)[4+4]$. Use \{ and \} for curly braces $\{\}$.

    These do not scale with the formula in between, so if you write (\frac12) the parentheses will be too small: $(\frac12)$. Using \left(\right) will make the sizes adjust automatically to the formula they enclose: \left(\frac12\right) is $\left(\frac12\right)$.

    \left and\right apply to all the following sorts of parentheses: ( and ) $(x)$, [ and ] $[x]$, \{ and \} $\lbrace x \rbrace$, | $|x|$, \langle and \rangle $\langle x \rangle$, \lceil and \rceil $\lceil x \rceil$, and \lfloor and \rfloor $\lfloor x \rfloor$. There are also invisible parentheses, denoted by .: \left.\frac12\right\rbrace is $\left.\frac12\right\rbrace$.

  7. Sums and integrals \sum and \int; the subscript is the lower limit and the superscript is the upper limit, so for example \sum_1^n $\sum_1^n$. Don't forget {} if the limits are more than a single symbol. For example, \sum_{i=0}^\infty i^2 is $\sum_{i=0}^\infty i^2$. Similarly, \prod $\prod$, \int $\int$, \bigcup $\bigcup$, \bigcap $\bigcap$, \iint $\iint$.

  8. Fractions There are two ways to make these. \frac ab applies to the next two groups, and produces $\frac ab$; for more complicated numerators and denominators use {}: \frac{a+1}{b+1} is $\frac{a+1}{b+1}$. If the numerator and denominator are complicated, you may prefer \over, which splits up the group that it is in: {a+1\over b+1} is ${a+1\over b+1}$.

  9. Fonts

    • Use \mathbb or \Bbb for "blackboard bold": $\mathbb{CHNQRZ}$.
    • Use \mathbf for boldface: $\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$ $\mathbf{abcdefghijklmnopqrstuvwxyz}$.
    • Use \mathtt for "typewriter" font: $\mathtt{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$ $\mathtt{abcdefghijklmnopqrstuvwxyz}$.
    • Use \mathrm for roman font: $\mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$ $\mathrm{abcdefghijklmnopqrstuvwxyz}$.
    • Use \mathcal for "calligraphic" letters: $\mathcal{ ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
    • Use \mathscr for script letters: $\mathscr{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$
    • Use \mathfrak for "Fraktur" (old German style) letters: $\mathfrak{ABCDEFGHIJKLMNOPQRSTUVWXYZ} \mathfrak{abcdefghijklmnopqrstuvwxyz}$.
  10. Radical signs Use sqrt, which adjusts to the size of its argument: \sqrt{x^3} $\sqrt{x^3}$; \sqrt[3]{\frac xy} $\sqrt[3]{\frac xy}$. For complicated expressions, consider using {...}^{1/2} instead.

  11. Some special functions such as "lim", "sin", "max", "ln", and so on are normally set in roman font instead of italic font. Use \lim, \sin, etc. to make these: \sin x $\sin x$, not sin x $sin x$. Use subscripts to attach a notation to \lim: \lim_{x\to 0} $$\lim_{x\to 0}$$

  12. There are a very large number of special symbols and notations, too many to list here; see this shorter listing, or this exhaustive listing. Some of the most common include:

    • \lt \gt \le \ge \neq $\lt\, \gt\, \le\, \ge\, \neq$. You can use \not to put a slash through almost anything: \not\lt $\not\lt$ but it often looks bad.
    • \times \div \pm \mp $\times\, \div\, \pm\, \mp$. \cdot is a centered dot: $x\cdot y$
    • \cup \cap \setminus \subset \subseteq \subsetneq \supset \in \notin \emptyset \varnothing $\cup\, \cap\, \setminus\, \subset\, \subseteq \,\subsetneq \,\supset\, \in\, \notin\, \emptyset\, \varnothing$
    • {n+1 \choose 2k} or \binom{n+1}{2k} ${n+1 \choose 2k}$
    • \to \rightarrow \leftarrow \Rightarrow \Leftarrow \mapsto $\to\, \rightarrow\, \leftarrow\, \Rightarrow\, \Leftarrow\, \mapsto$
    • \land \lor \lnot \forall \exists \top \bot \vdash \vDash $\land\, \lor\, \lnot\, \forall\, \exists\, \top\, \bot\, \vdash\, \vDash$
    • \star \ast \oplus \circ \bullet $\star\, \ast\, \oplus\, \circ\, \bullet$
    • \approx \sim \cong \equiv \prec $\approx\, \sim \, \cong\, \equiv\, \prec$.
    • \infty \aleph_0 $\infty\, \aleph_0$ \nabla \partial $\nabla\, \partial$ \Im \Re $\Im\, \Re$
    • For modular equivalence, use \pmod like this: a\equiv b\pmod n $a\equiv b\pmod n$.
    • \ldots is the dots in $a_1, a_2, \ldots ,a_n$ \cdots is the dots in $a_1+a_2+\cdots+a_n$
    • Some Greek letters have variant forms: \epsilon \varepsilon $\epsilon\, \varepsilon$, \phi \varphi $\phi\, \varphi$, and others. Script lowercase l is \ell $\ell$.

    Detexify lets you draw a symbol on a web page and then lists the $\TeX$ symbols that seem to resemble it. These are not guaranteed to work in MathJax but are a good place to start. To check that a command is supported, note that MathJax.org maintains a list of currently supported $\LaTeX$ commands, and one can also check Dr. Carol JVF Burns's page of $\TeX$ Commands Available in MathJax.

  13. Spaces MathJax usually decides for itself how to space formulas, using a complex set of rules. Putting extra literal spaces into formulas will not change the amount of space MathJax puts in: a␣b and a␣␣␣␣b are both $a b$. To add more space, use \, for a thin space $a\,b$; \; for a wider space $a\;b$. \quad and \qquad are large spaces: $a\quad b$, $a\qquad b$.

    To set plain text, use \text{…}: $\{x\in s\mid x\text{ is extra large}\}$. You can nest $…$ inside of \text{…}.

  14. Accents and diacritical marks Use \hat for a single symbol $\hat x$, \widehat for a larger formula $\widehat{xy}$. If you make it too wide, it will look silly. Similarly, there are \bar $\bar x$ and \overline $\overline{xyz}$, and \vec $\vec x$ and \overrightarrow $\overrightarrow{xy}$. For dots, as in $\frac d{dx}x\dot x = \dot x^2 + x\ddot x$, use \dot and \ddot.

  15. Special characters used for MathJax interpreting can be escaped using the \ character: \$ $\$$, \{ $\{$, \_ $\_$, etc.

(Tutorial ends here.)


It is important that this note be reasonably short and not suffer from too much bloat. To include more topics, please create short addenda and post them as answers instead of inserting them into this post.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:07 (UCT), posted by SE-user MJD
asked Aug 27, 2012 in Public Official Posts by MJD (0 points) [ no revision ]
retagged Apr 19, 2014 by dimension10
Some capital Greek letters are the same as the Roman equivalents, so they are not separated in $\LaTeX$. For a capital beta, one must use something like \mathrm{B}: $\mathrm{B}$

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user robjohn
for a beginner I find this site very helpful

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Monkey D. Luffy
Thanks for putting this all together!

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user J. M.
Two related questions: How do I insert a table when asking a question? and How to show the integral symbol on this site?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Martin Sleziak
@Henning When I ranked features in my mind to decide whether to include them, \varphi and \varepsilon were very close to the threshhold for inclusion. Martin Sleziak has since added them, which I agree is a good idea.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
A quick addition to point 11: If you want to use a $\sin$-like symbol that is not already defined, the command is \operatorname: e.g., \operatorname{Spec} A gives $\operatorname{Spec} A$.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Charles Staats
@CharlesStaats I considered putting that in, but I wasn't sure it met the threshold for frequently-usedness. Suppose someone wanted it, but didn't know about it. Then in the "worst" case their operator would appear in italics, which did not seem to me to be a serious problem, or one that would impede the person from completing their post.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
I can't speak for others, but I use it all the time (far more often than negative spaces, for instance), and found it extremely annoying to want it before I knew the command. Another point is that this is much more useful in MathJax than in Latex (where one would typically define the new operator in the preamble), so it may be hard to find when looking up resources for latex commands.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Charles Staats
It might be useful to mention hanging subscripts for things like _5C_3 $_5C_3$. You could also mention \frac vs \dfrac.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user axblount
@axblount I wonder if a more generally useful thing would be to point out that empty groups {} count as formulas and can appear anywhere that any other formula can. I think \dfrac is a refinement that doesn't need to be mentioned in the main post.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
@MJD I agree on both. I guess it's best to avoid the technicalities of typesetting or this will quickly cease to be a "basic tutorial."

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user axblount
My basic idea is that if a beginner can express a formula clearly, then someone else can come in and clean up the typesetting afterwards. I am considering getting rid of the section about \big, \left, and \right for this reason, and trimming the section on spacing.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
Most of the references to TeX or LaTeX in this and the answers ought to be to MathJaX (the exception that I can see being the output of Detexify). I know this is a bit pedantic, but would it be alright to correct this?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Andrew Stacey
@AndrewStacey Thanks for pointing this out. Let's by all means be as correct as possible, particularly when there's no extra cost.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
@MJD Okay, I've had a go (also the answer about arrays). I wonder also whether or not it is worth a sentence at the end pointing out that whilst MathJaX does its best to emulate TeX, it isn't TeX and so while knowing how something is done in TeX gives you a starting point, it isn't a guarantee that the same thing works in MathJaX. (As a case in point, questions about MathJaX are generally off-topic over on TeX-SX.)

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Andrew Stacey
@AndrewStacey I wouldn't. They are close enough that it seems to me to be a needless refinement. I might even argue that MathJax is $\TeX$, although an alternative implementation. We're willing to accept that other programming languages (JavaScript, for example) that have slightly incompatible implementations are nevertheless the same language; why not in this case as well?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
@MJD Except that this is meant as a tutorial for those who aren't familiar with the distinction (and there really is a distinction: "slightly incompatible implementations" doesn't really fit the bill here). One thing tutorials often include is a "Where to find out more" section. This doesn't. Someone who doesn't know the distinction might be tempted to search for help on TeX or LaTeX instead and wonder why it doesn't work.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Andrew Stacey
@AndrewStacey All the tips given here would work in any $\TeX$/$\LaTeX$ environment with the proper packages. MathJax is just the service used to render it. You wouldn't say "Miktex tutorial" or "texlive tutorial".

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user axblount
@axblount But that's precisely the wrong way around to think about it! The likelihood is that someone will look at this tutorial to figure out how to write something on the Maths-SX site: i.e., to use MathJaX. If they can't find help here, where do they go? If they have the idea that MathJaX is "just a javascript implementation of TeX" then they might think to look for help with TeX, but that is quite possibly not going to be helpful.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Andrew Stacey
@AndrewStacey Honest question because I have no idea: What sorts of LaTeX math expressions is MathJaX incapable of rendering?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user axblount
@axblount For a start, you've changed the goalposts: "LaTeX math expressions". LaTeX is so much more than just a way of typesetting maths! Second, I don't really know but it wouldn't take me long to cook one up. I don't use MathJaX so I haven't explored it. But I know, for example, that it can't handle catcode changes. Which means that I can't make ( and ) automatically resizeable. I can in LaTeX.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Andrew Stacey
@axblount Anything that requires loading an additional package which MathJax doesn't load (either by default, on our configuration, or impossible to load b/c an implementation hasn't been coded yet). Some random examples include those of stmaryrd like \inplus, \boxast, \owedge.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Willie Wong
A not-just-random-symbols example of something that works in LaTeX but not in MathJax: LaTeX has the empheq package (Link) whose functions are, best as I can tell, not replicated in MathJax. And just for fun I give a MathJax expression that won't render in LaTeX: try $$ \begin{align} ... \end{align} $$.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Willie Wong
Shoot, the "click the edit link" advice is not very good because users don't get an edit link until they have some reputation. It's unfortunate that new users don't even get a "view source" link. I wonder if that advice should be demoted?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
@WillieWong That's cheating. The alignat environment is for when aligning stuff when you are already in a mathematical environment and would have been a better choice for MathJaX to use here. But it's an important example of the limitations of MathJaX: it is only for mathematical formatting.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Andrew Stacey
I don't really mind \over being mentioned in item 8, but I had to replace it with \frac in the first two examples of fractions. What is the difference between \over and \frac? // By the way, I think this post should be tagged (faq) but it's stuck on (faq-proposed).

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user user53153
@5PM Okay, but why do you care so much, and why should we care that you care so much? Is there a reason to prefer \frac to \over?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
@MJD The TeX.SE thread to which I linked gives some reasons for preferring \frac. The simplest reason is to maintain consistent format of LaTeX commands, which is the prefix form \command{argument}{maybe more arguments}. For example, the LaTeX way is \textit{something} while the old TeX way was {\it something}. Same with \frac and \over. // Someone who is used to TeX in one or another way can happily proceed without worrying about what I or anyone else thinks. But someone who's just beginning to learn may well begin with the modern approach.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user user53153
All those reasons seem to apply to $\TeX/\LaTeX$, but not to MathJax, and not to anything we would likely be doing in MathJax or on this site. For example, the fact that the existence of \over complicates the design of macros is completely irrelevant to us here.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
Finally, here it all is.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user James Graham
Is there a way to do a serif font?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Double AA
I wish I saw this post when I first joined. This post should be a main link on the home page. There should be a button under each box: NEW TO LATEX, CLICK HERE FOR EXAMPLES. This is extremely useful, concise.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user user1527227
@robjohn I never use \mathrm. I can see the value of mentioning \text, because beginners often write things like $\{ x | x is hyperellipically constrained \}$, but \mathrm doesn't help here, and I'm not sure why it is a good use of space in the tutorial. Is it important for some reason I don't appreciate?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
@MJD: I use \mathrm in many places; e.g. $\mathrm{d}x$ in integrals and derivatives and for operator names that don't need the full force of \operatorname. \mathrm was intended for roman symbols in math mode; \text was intended for text because of the way it spaces things. See this TEX thread. Since I don't believe we can use preambles in MathJax, we can't use \DeclareMathOperator, though we can use \newcommand, but that is orthogonal to the use of \mathrm vs \text for math symbols.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user robjohn
This is great. Why is this guide not linked on the main page?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user user84059
What is the sign of nearest integer to x or round of x?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Mahdi Khosravi
There isn't a standard notation for that, as far as I know. You could use \left\lfloor x+\frac12 \right\rfloor: $\left\lfloor x+\frac12 \right\rfloor$.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
Is the very first example meant to be a joke? $\sum_{i=0}^n i^2 = \frac{2n^3+3n^2+n}{6}$, while it is $\sum_{i=0}^n i$ that equals $\frac{n^2+n}{2}$.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Donkey_2009
How do you symbolize the cross product?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Lanae
I usually use \times ($\times$).

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
What is the question?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Peter Mortensen

20 Answers

+ 21 like - 0 dislike

Matrices

  1. Use $$\begin{matrix}…\end{matrix}$$ In between the \begin and \end, put the matrix elements. End each matrix row with \\, and separate matrix elements with &. For example,

    $$
            \begin{matrix}
            1 & x & x^2 \\
            1 & y & y^2 \\
            1 & z & z^2 \\
            \end{matrix}
    $$
    

    produces:

    $$ \begin{matrix} 1 & x & x^2 \\ 1 & y & y^2 \\ 1 & z & z^2 \\ \end{matrix} $$

    MathJax will adjust the sizes of the rows and columns so that everything fits.

  2. To add brackets, either use \left…\right as in section 6 of the tutorial, or replace matrix with pmatrix $\begin{pmatrix}1&2\\3&4\\ \end{pmatrix}$, bmatrix $\begin{bmatrix}1&2\\3&4\\ \end{bmatrix}$, Bmatrix $\begin{Bmatrix}1&2\\3&4\\ \end{Bmatrix}$, vmatrix $\begin{vmatrix}1&2\\3&4\\ \end{vmatrix}$, Vmatrix $\begin{Vmatrix}1&2\\3&4\\ \end{Vmatrix}$.

  3. Use \cdots $\cdots$ \ddots $\ddots$ vdots $\vdots$ when you want to omit some of the entries:

    $$\begin{pmatrix} 1 & a_1 & a_1^2 & \cdots & a_1^n \\ 1 & a_2 & a_2^2 & \cdots & a_2^n \\ \vdots & \vdots& \vdots & \ddots & \vdots \\ 1 & a_m & a_m^2 & \cdots & a_m^n \end{pmatrix}$$

  4. For "augmented" matrices, put parentheses or brackets around a suitably-formatted table; see arrays above for details. Here is an example:

$$ \left[\begin{array}{cc|c} 1&2&3\\ 4&5&6 \end{array}\right]$$

is produced by:

$$ \left[
      \begin{array}{cc|c}
        1&2&3\\
        4&5&6
      \end{array}
    \right]$$

The cc|c is the crucial part here; it says that there are three centered columns with a vertical bar between the second and third.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
answered Aug 28, 2012 by MJD (0 points) [ no revision ]
What about augmented matrices?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Michael Albanese
Added instructions for that.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
Thanks, that's excellent.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Michael Albanese
+ 18 like - 0 dislike

Aligned equations

Often people want a series of equations where the equals signs are aligned. To get this, use \begin{align}…\end{align}. Each line should end with \\, and should contain an ampersand at the point to align at, typically immediately before the equals sign.

For example,

$$\begin{align} \sqrt{37} & = \sqrt{\frac{73^2-1}{12^2}} \\ & = \sqrt{\frac{73^2}{12^2}\cdot\frac{73^2-1}{73^2}} \\ & = \sqrt{\frac{73^2}{12^2}}\sqrt{\frac{73^2-1}{73^2}} \\ & = \frac{73}{12}\sqrt{1 - \frac{1}{73^2}} \\ & \approx \frac{73}{12}\left(1 - \frac{1}{2\cdot73^2}\right) \end{align}$$

is produced by

$$\begin{align}
\sqrt{37} & = \sqrt{\frac{73^2-1}{12^2}} \\
 & = \sqrt{\frac{73^2}{12^2}\cdot\frac{73^2-1}{73^2}} \\ 
 & = \sqrt{\frac{73^2}{12^2}}\sqrt{\frac{73^2-1}{73^2}} \\
 & = \frac{73}{12}\sqrt{1 - \frac{1}{73^2}} \\ 
 & \approx \frac{73}{12}\left(1 - \frac{1}{2\cdot73^2}\right)
\end{align}$$
This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
answered Aug 28, 2012 by MJD (0 points) [ no revision ]
The AMS's Short Math Guide recommends the align environment over eqnarray in LaTeX. In MathJax the spacing seems to be the same , but align requires one less ampersand per line.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Rahul
Thanks. I was not sure whether to discuss that. A detailed argument against eqnarray is in this article.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
Would you mind if I changed your example to use align then?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Rahul
@Rahul: Please go ahead and change anything that seems good to change. This is all CW.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
Also, if you think you have a better example, please use it; I used the first one I found.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
+ 16 like - 0 dislike

Definitions by cases

Use \begin{cases}…\end{cases}. End each case with a \\, and use & before parts that should be aligned.

For example, you get this:

$$f(n) = \begin{cases} n/2, & \text{if $n$ is even} \\ 3n+1, & \text{if $n$ is odd} \\ \end{cases}$$

by writing this:

  f(n) =
\begin{cases}
n/2,  & \text{if $n$ is even} \\
3n+1, & \text{if $n$ is odd}  \\
\end{cases}

The brace can be moved to the right: $$ \left. \begin{array}{l} \text{if $n$ is even:}&n/2\\ \text{if $n$ is odd:}&3n+1 \end{array} \right\} =f(n) $$ by writing this:

\left.
\begin{array}{l}
\text{if $n$ is even:}&n/2\\
\text{if $n$ is odd:}&3n+1
\end{array}
\right\}
=f(n)

To get a larger vertical space between cases we can use \\[2ex] instead of \\. For example, you get this:

$$f(n) = \begin{cases} \frac{n}{2}, & \text{if $n$ is even} \\[2ex] 3n+1, & \text{if $n$ is odd} \\ \end{cases}$$

by writing this:

f(n) =
\begin{cases}
\frac{n}{2},  & \text{if $n$ is even} \\[2ex]
3n+1, & \text{if $n$ is odd}  \\
\end{cases}

(An ‘ex’ is a length equal to the height of the letter x; 2ex here means the space should be two exes high.)

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
answered Aug 28, 2012 by MJD (0 points) [ no revision ]
How to put only a $\}$ on the right ?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Mahdi Khosravi
+ 14 like - 0 dislike

Arrays

It is often easier to read tables formatted in MathJax rather than plain text or a fixed width font. Arrays and tables are created with the array environment. Just after \begin{array} the format of each column should be listed, use c for a center aligned column, r for right aligned, l for left aligned and a | for a vertical line. Just as with matrices, cells are separated with & and rows are broken using \\. A horizontal line spanning the array can be placed before the current line with \hline.

For example, $$\begin{array}{c|lcr} n & \text{Left} & \text{Center} & \text{Right} \\ \hline 1 & 0.24 & 1 & 125 \\ 2 & -1 & 189 & -8 \\ 3 & -20 & 2000 & 1+10i \\ \end{array} $$

$$
\begin{array}{c|lcr}
n & \text{Left} & \text{Center} & \text{Right} \\
\hline
1 & 0.24 & 1 & 125 \\
2 & -1 & 189 & -8 \\
3 & -20 & 2000 & 1+10i \\
\end{array}
$$

Arrays can be nested to make an array of tables.

For example, $$ % outer vertical array of arrays \begin{array}{c} % inner horizontal array of arrays \begin{array}{cc} % inner array of minimum values \begin{array}{c|cccc} \text{min} & 0 & 1 & 2 & 3\\ \hline 0 & 0 & 0 & 0 & 0\\ 1 & 0 & 1 & 1 & 1\\ 2 & 0 & 1 & 2 & 2\\ 3 & 0 & 1 & 2 & 3 \end{array} & % inner array of maximum values \begin{array}{c|cccc} \text{max}&0&1&2&3\\ \hline 0 & 0 & 1 & 2 & 3\\ 1 & 1 & 1 & 2 & 3\\ 2 & 2 & 2 & 2 & 3\\ 3 & 3 & 3 & 3 & 3 \end{array} \end{array} \\ % inner array of delta values \begin{array}{c|cccc} \Delta&0&1&2&3\\ \hline 0 & 0 & 1 & 2 & 3\\ 1 & 1 & 0 & 1 & 2\\ 2 & 2 & 1 & 0 & 1\\ 3 & 3 & 2 & 1 & 0 \end{array} \end{array} $$

As the source for the preceding array is long, please right-click on one of the tables and choose $\mathsf{Show\ Math\ As\ }\blacktriangleright\mathsf{\ TeX\ Commands}$.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user axblount
answered Aug 29, 2012 by axblount (0 points) [ no revision ]
You'll have to wrap the contents of each cell in \text if you don't want $all italics, weird-looking spacing, an' odd apostrophes$.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Rahul
@RahulNarain: True. I used words just for illustration, but I guess the example was slightly misleading. If you'd like to modify it please go ahead.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user axblount
Thanks! I like your numeric example better, since the widths of the entries are different enough that the alignment differences are visually clear.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
@robjohn how do you use | while typing , i don't find it in my keyboard......

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Mr.ØØ7
@exploringnet: on my keyboard, it is the shifted backslash. It may be in different places (or absent) depending on your keyboard. On my mobile device (iPhone), it is in the shifted numerics, to the right of the backslash. In mathmode, \vert gives $\vert$ and \mid gives $\mid$, but neither works in the column spec for an array. If you cannot type it on your keyboard, you can alwaays copy and paste it from another document.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user robjohn
It should perhaps be mentioned, that in nested arrays there seems to be no option to synchronize column-widths and/or row-heights over the top-level. I didn't find a solution such that if two arrays are stacked vertically one could make their column-widths matching/fit.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Gottfried Helms
+ 12 like - 0 dislike

Fussy spacing issues

These are issues that won't affect the correctness of formulas, but might make them look significantly better or worse. Beginners should feel free to ignore this advice; someone else will correct it for them, or more likely nobody will care.

Don't use \frac in exponents or limits of integrals; it looks bad and can be confusing, which is why it is rarely done in professional mathematical typesetting. Write the fraction horizontally, with a slash:

$$\begin{array}{cc} \mathrm{Bad} & \mathrm{Better} \\ \hline \\ e^{i\frac{\pi}2} \quad e^{\frac{i\pi}2}& e^{i\pi/2} \\ \int_{-\frac\pi2}^\frac\pi2 \sin x\,dx & \int_{-\pi/2}^{\pi/2}\sin x\,dx \\ \end{array}$$

The | symbol has the wrong spacing when it is used as a divider, for example in set comprehensions. Use \mid instead:

$$\begin{array}{cc} \mathrm{Bad} & \mathrm{Better} \\ \hline \\ \{x|x^2\in\Bbb Z\} & \{x\mid x^2\in\Bbb Z\} \\ \end{array}$$

For double and triple integrals, don't use \int\int or \int\int\int. Instead use the special forms \iint and \iiint: $$\begin{array}{cc} \mathrm{Bad} & \mathrm{Better} \\ \hline \\ \int\int_S f(x)\,dy\,dx & \iint_S f(x)\,dy\,dx \\ \int\int\int_V f(x)\,dz\,dy\,dx & \iiint_V f(x)\,dz\,dy\,dx \end{array}$$

Use \, to insert a thin space before differentials; without this $\TeX$ will mash them together:

$$\begin{array}{cc} \mathrm{Bad} & \mathrm{Better} \\ \hline \\ \iiint_V f(x)dz dy dx & \iiint_V f(x)\,dz\,dy\,dx \end{array}$$

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
answered Aug 31, 2012 by MJD (0 points) [ no revision ]
I think the first adjusted fraction looks better than the original, but I don't like the second. In any case, this minor spacing imbalance is too peripheral to belong in a basic MathJax tutorial IMO. Too likely to scare people away rather than make them feel helped.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Henning Makholm
@Henning Do you mean that the fraction example is too unimportant even to appear in an addendum on fussy spacing, or that the fussy spacing article is too unimportant to appear as an addendum to the tutorial?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
I was talking specifically about the fraction example. Mostly I'm concerned that somebody will come away thinking, Eeek! Do I have to worry about THAT to use the site? But it's also arguable that the disclaimer at the top of the answer ought to take care of that.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Henning Makholm
@MJD I like the less space, but what if we want to list the bounds for multiple integrals? Like if we have say 3 integrals and we have 3 separate bounds for each how would we list each one? Or do we have to do \int_bound1^bound2\int_bound3^bound4\int_bound5^bound6??

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user TheHopefulActuary
@Kyle I think that's exactly what you do in that case.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
Worth nothing you can use \middle with | to get it to work with \left and \right, like \left\{x\middle | \frac{x^2}{2} \in \mathbb{z}\right\}: $\left\{x\middle | \frac{x^2}{2} \in \mathbb{z}\right\}$

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user asmeurer
Thanks very much! I wanted to do that, but didn't know how.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
+ 11 like - 0 dislike

Symbols

In general, you have to search in long tables about a specific symbol you're looking for, things like $\Psi$, $\delta$, $\zeta$, $\ge$, $\subseteq$ ... And it turns out that this operation can be frustrating and time consuming, which can cause the buddy to abandon writing the complete $\LaTeX$ sentence in his answer, or in some cases, the complete answer itself.

That's why the tool that I will present you in this post was conceived. Basically, it is a $\LaTeX$ handwritten symbol recognition. Example in image:

enter image description here

Here is the website: Detexify² No more frustration.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:09 (UCT), posted by SE-user user93957
answered Oct 14, 2013 by user93957 (0 points) [ no revision ]
Amazing site!!!

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:09 (UCT), posted by SE-user Sush
+ 9 like - 0 dislike

Continued fractions

To make a continued fraction, use \cfrac, which works just like \frac but typesets the results differently:

$$ x = a_0 + \cfrac{1^2}{a_1 + \cfrac{2^2}{a_2 + \cfrac{3^2}{a_3 + \cfrac{4^4}{a_4 + \cdots}}}}$$

Don't use regular \frac or \over, or it will look awful:

$$ x = a_0 + \frac{1^2}{a_1 + \frac{2^2}{a_2 + \frac{3^2}{a_3 + \frac{4^4}{a_4 + \cdots}}}}$$

You can of course use \frac for the compact notation:

$$ x = a_0 + \frac{1^2}{a_1+} \frac{2^2}{a_2+} \frac{3^2}{a_3 +} \frac{4^4}{a_4 +} \cdots$$

Continued fractions are too big to put inline. Display them with $$$$ or use a notation like $[a_0; a_1, a_2, a_3, \ldots]$.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
answered Aug 31, 2012 by MJD (0 points) [ no revision ]
The RHS of the following continued fraction $$ \cfrac{a_{1}}{b_{1}+\cfrac{a_{2}}{b_{2}+\cfrac{a_{3}}{b_{3}+\ddots }}}= {\genfrac{}{}{}{}{a_1}{b_1}} {\genfrac{}{}{0pt}{}{}{+}} {\genfrac{}{}{}{}{a_2}{b_2}} {\genfrac{}{}{0pt}{}{}{+}} {\genfrac{}{}{}{}{a_3}{b_3}} {\genfrac{}{}{0pt}{}{}{+\dots}} $$ can be typeset with the \genfrac command '{\genfrac{}{}{}{}{a_1}{b_1}} {\genfrac{}{}{0pt}{}{}{+}} {\genfrac{}{}{}{}{a_2}{b_2}} {\genfrac{}{}{0pt}{}{}{+}} {\genfrac{}{}{}{}{a_3}{b_3}} {\genfrac{}{}{0pt}{}{}{+\dots}}'

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Américo Tavares
I wonder if something like $\frac12{\vphantom{1}\atop+}\frac34$ would be good enough? It is much simpler. (\frac12{\vphantom{1}\atop+}\frac34)

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
Yes, it is. I didn't mention it because in User’s Guide for the amsmath Package it is written the following: "Note. For technical reasons, using the primitive fraction commands \over, \atop, \above in a LATEX document is not recommended (see, e.g., amsmath.faq)."

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Américo Tavares
Happily, we are not writing $\LaTeX$ documents here.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
Or write \underset{j=1}{\overset{\infty}{\LARGE\mathrm K}}\frac{a_j}{b_j}=\cfrac{a_1}{b_1+\cfrac{a_2}{b_2+\cfrac{a_3}{b_3+\ddots}}} to get $$\underset{j=1}{\overset{\infty}{\LARGE\mathrm K}}\frac{a_j}{b_j}=\cfrac{a_1}{b_1+\cfrac{a_2}{b_2+\cfrac{a_3}{b_3+\ddots}}}.$$

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Américo Tavares
+ 9 like - 0 dislike

System of equations

  • Use \begin{array}…\end{array} and \left\{…\right.. For example, you get this:

$$ \left\{ \begin{array}{c} a_1x+b_1y+c_1z=d_1 \\ a_2x+b_2y+c_2z=d_2 \\ a_3x+b_3y+c_3z=d_3 \end{array} \right. $$

by writing this:

$$
\left\{ 
\begin{array}{c}
a_1x+b_1y+c_1z=d_1 \\ 
a_2x+b_2y+c_2z=d_2 \\ 
a_3x+b_3y+c_3z=d_3
\end{array}
\right. 
$$
  • Alternatively we can use \begin{cases}…\end{cases}. The same system

$$ \begin{cases} a_1x+b_1y+c_1z=d_1 \\ a_2x+b_2y+c_2z=d_2 \\ a_3x+b_3y+c_3z=d_3 \end{cases} $$

is produced by the following code

$$\begin{cases}
a_1x+b_1y+c_1z=d_1 \\ 
a_2x+b_2y+c_2z=d_2 \\ 
a_3x+b_3y+c_3z=d_3
\end{cases}
$$
  • To align the = signs use \begin{aligned}...\end{aligned} and \left\{…\right. (see asmeurer's comment) $$\left\{\begin{aligned} a_1x+b_1y+c_1z&=d_1+e_1 \\ a_2x+b_2y&=d_2 \\ a_3x+b_3y+c_3z&=d_3 \end{aligned} \right. $$

whose code is

$$
\left\{
\begin{aligned} 
a_1x+b_1y+c_1z &=d_1+e_1 \\ 
a_2x+b_2y&=d_2 \\ 
a_3x+b_3y+c_3z &=d_3 
\end{aligned} 
\right. 
$$
  • To align the = signs and the terms as in $$\left\{\begin{array}{ll}a_1x+b_1y+c_1z &=d_1+e_1 \\ a_2x+b_2y &=d_2 \\ a_3x+b_3y+c_3z &=d_3 \end{array} \right.$$

use array with l (for "align left"; there are also c and r) parameters

$$
\left\{
\begin{array}{ll}
a_1x+b_1y+c_1z &=d_1+e_1 \\ 
a_2x+b_2y &=d_2 \\ 
a_3x+b_3y+c_3z &=d_3 
\end{array} 
\right.
$$
This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Américo Tavares
answered Oct 3, 2012 by Américo Tavares (35 points) [ no revision ]
Most voted comments show all comments
how can i write equation in next line

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Maisam Hedyelloo
Probably better to write it so that the variables and the $=$ line up even if the systems don't match.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user asmeurer
@asmeurer The best I can do is $$ \left\{\begin{aligned} a_1x+b_1y+c_1z&=d_1+e_1 \\ a_2x+b_2y&=d_2 \\ a_3x+b_3y+c_3z&=d_3 \end{aligned} \right. $$ is produced by the code $$\left\{\begin{aligned} a_1x+b_1y+c_1z&=d_1+e_1 \\ a_2x+b_2y&=d_2 \\ a_3x+b_3y+c_3z&=d_3 \end{aligned} \right. $$ $$ \left\{\begin{aligned} a_1x+b_1y+c_1z&=d_1+e_1 \\ a_2x+b_2y\phantom{===}&=d_2 \\ a_3x+b_3y+c_3z&=d_3 \end{aligned} \right. $$ is produced by the code $$\left\{\begin{aligned} a_1x+b_1y+c_1z&=d_1+e_1 \\ a_2x+b_2y\phantom{===}&=d_2 \\ a_3x+b_3y+c_3z&=d_3 \end{aligned} \right. $$

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Américo Tavares
How to put only a $\}$ on the right ?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Mahdi Khosravi
$\left . x \right \}$ is $\left . x \right \}$. Item 7 of the main post has another example.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
Most recent comments show all comments
Thanks Americo!!!

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user ccc
How can I add {} to a post?**\begin{cases}** gives only one side { .**\end{cases}** doesn't give he other side **}**please help!

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user ccc
+ 8 like - 0 dislike

Colors

Named colors are browser-dependent; if a browser doesn't know a particular color name, it may render the text as black. The following colors are standard in HTML4 and CSS2 and should be interpreted the same by most browsers: $$\begin{array}{|rc|} \hline \verb+\color{black}{text}+ & \color{black}{text} \\ \verb+\color{gray}{text}+ & \color{gray}{text} \\ \verb+\color{silver}{text}+ & \color{silver}{text} \\ \verb+\color{white}{text}+ & \color{white}{text} \\ \hline \verb+\color{maroon}{text}+ & \color{maroon}{text} \\ \verb+\color{red}{text}+ & \color{red}{text} \\ \verb+\color{yellow}{text}+ & \color{yellow}{text} \\ \verb+\color{lime}{text}+ & \color{lime}{text} \\ \verb+\color{olive}{text}+ & \color{olive}{text} \\ \verb+\color{green}{text}+ & \color{green}{text} \\ \verb+\color{teal}{text}+ & \color{teal}{text} \\ \verb+\color{aqua}{text}+ & \color{aqua}{text} \\ \verb+\color{blue}{text}+ & \color{blue}{text} \\ \verb+\color{navy}{text}+ & \color{navy}{text} \\ \verb+\color{purple}{text}+ & \color{purple}{text} \\ \verb+\color{fuchsia}{text}+ & \color{magenta}{text} \\ \hline \end{array}$$

HTML5 and CSS3 define an additional 124 color names that will be supported on many browsers.

Math StackExchange's default style uses a light-colored page background, so avoid using light colors for text. Stick to darker colors like maroon, green, blue, and purple, and remember also that 7–10% of men are color-blind and have difficulty distinguishing red and green.

The color may also have the form #rgb where $r, g, b$ are in the range or 09, af and represent the intensity of red, green, and blue on a scale of $0–15$, with a=10, b=11, … f=15. For example:

$$\begin{array}{|rrrrrrrr|}\hline \verb+#000+ & \color{#000}{text} & & & \verb+#00F+ & \color{#00F}{text} & & \\ & & \verb+#0F0+ & \color{#0F0}{text} & & & \verb+#0FF+ & \color{#0FF}{text}\\ \verb+#F00+ & \color{#F00}{text} & & & \verb+#F0F+ & \color{#F0F}{text} & & \\ & & \verb+#FF0+ & \color{#FF0}{text} & & & \verb+#FFF+ & \color{#FFF}{text}\\ \hline \end{array} $$

$$\begin{array}{|rrrrrrrr|} \hline \verb+#000+ & \color{#000}{text} & \verb+#005+ & \color{#005}{text} & \verb+#00A+ & \color{#00A}{text} & \verb+#00F+ & \color{#00F}{text} \\ \verb+#500+ & \color{#500}{text} & \verb+#505+ & \color{#505}{text} & \verb+#50A+ & \color{#50A}{text} & \verb+#50F+ & \color{#50F}{text} \\ \verb+#A00+ & \color{#A00}{text} & \verb+#A05+ & \color{#A05}{text} & \verb+#A0A+ & \color{#A0A}{text} & \verb+#A0F+ & \color{#A0F}{text} \\ \verb+#F00+ & \color{#F00}{text} & \verb+#F05+ & \color{#F05}{text} & \verb+#F0A+ & \color{#F0A}{text} & \verb+#F0F+ & \color{#F0F}{text} \\ \hline \verb+#080+ & \color{#080}{text} & \verb+#085+ & \color{#085}{text} & \verb+#08A+ & \color{#08A}{text} & \verb+#08F+ & \color{#08F}{text} \\ \verb+#580+ & \color{#580}{text} & \verb+#585+ & \color{#585}{text} & \verb+#58A+ & \color{#58A}{text} & \verb+#58F+ & \color{#58F}{text} \\ \verb+#A80+ & \color{#A80}{text} & \verb+#A85+ & \color{#A85}{text} & \verb+#A8A+ & \color{#A8A}{text} & \verb+#A8F+ & \color{#A8F}{text} \\ \verb+#F80+ & \color{#F80}{text} & \verb+#F85+ & \color{#F85}{text} & \verb+#F8A+ & \color{#F8A}{text} & \verb+#F8F+ & \color{#F8F}{text} \\ \hline \verb+#0F0+ & \color{#0F0}{text} & \verb+#0F5+ & \color{#0F5}{text} & \verb+#0FA+ & \color{#0FA}{text} & \verb+#0FF+ & \color{#0FF}{text} \\ \verb+#5F0+ & \color{#5F0}{text} & \verb+#5F5+ & \color{#5F5}{text} & \verb+#5FA+ & \color{#5FA}{text} & \verb+#5FF+ & \color{#5FF}{text} \\ \verb+#AF0+ & \color{#AF0}{text} & \verb+#AF5+ & \color{#AF5}{text} & \verb+#AFA+ & \color{#AFA}{text} & \verb+#AFF+ & \color{#AFF}{text} \\ \verb+#FF0+ & \color{#FF0}{text} & \verb+#FF5+ & \color{#FF5}{text} & \verb+#FFA+ & \color{#FFA}{text} & \verb+#FFF+ & \color{#FFF}{text} \\ \hline \end{array}$$

You can have a look here for quick reference on colors in HTML.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user Vlad K.
answered Jun 29, 2013 by Vlad K. (0 points) [ no revision ]
Test: ${\color{olive}E}\ {\color{purple}F}$ $\text{olive, purple}$.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:09 (UCT), posted by SE-user Américo Tavares
Could you please give an example of a RGB-encoded color?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:09 (UCT), posted by SE-user Américo Tavares
@AméricoTavares Please follow the link I added.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:09 (UCT), posted by SE-user Vlad K.
Thanks for the information.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:09 (UCT), posted by SE-user Américo Tavares
+ 7 like - 0 dislike

\implies ($\implies$) is a marginally preferable alternative to \Rightarrow ($\Rightarrow $) for implication.

There's also \iff: $ \iff $

\to ($\to$) is preferable to \rightarrow or \longrightarrow for things like $f\colon A \to B$.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user leonbloy
answered Jun 13, 2013 by leonbloy (0 points) [ no revision ]
Why is it preferable?

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user MJD
implies looks nicer as the arrow is longer and \to is quicker to right (and it's also what you say in your head while typing it). at least that's what I think.

This post imported from StackExchange Mathematics Meta at 2014-04-16 16:08 (UCT), posted by SE-user John Salvatierrez

Your answer

Please use answers only to (at least partly) answer questions. To comment, discuss, or ask for clarification, leave a comment instead.
To mask links under text, please type your text, highlight it, and click the "link" button. You can then enter your link URL.
Please consult the FAQ for as to how to format your post.
This is the answer box; if you want to write a comment instead, please use the 'add comment' button.
Live preview (may slow down editor)   Preview
Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
If you are a human please identify the position of the character covered by the symbol $\varnothing$ in the following word:
p$\hbar$ysicsOv$\varnothing$rflow
Then drag the red bullet below over the corresponding character of our banner. When you drop it there, the bullet changes to green (on slow internet connections after a few seconds).
Please complete the anti-spam verification




user contributions licensed under cc by-sa 3.0 with attribution required

Your rights
...