# MathJax basic tutorial and quick reference

1. To see how any formula was written in any question or answer, including this one, right-click on the expression it and choose "Show Math As > TeX Commands". (When you do this, the '$' will not display. Make sure you add these. See the next point.) 2. For inline formulas, enclose the formula in $...$. For displayed formulas, use $$...$$. These render differently. For example, type $\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$ to show $$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$ (which is inline mode) or type $$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$ to show $$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$ (which is display mode). 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$$, \log_2 x: $$\log_2 x$$. 5. Groups. 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 (\frac{\sqrt x}{y^3}) the parentheses will be too small: $$(\frac{\sqrt x}{y^3})$$. Using \left(\right) will make the sizes adjust automatically to the formula they enclose: \left(\frac{\sqrt x}{y^3}\right) is $$\left(\frac{\sqrt x}{y^3}\right)$$. \left and\right apply to all the following sorts of parentheses: ( and ) $$(x)$$, [ and ] $$[x]$$, \{ and \} $$\{ x \}$$, | $$|x|$$, \vert $$\vert x \vert$$, \Vert $$\Vert x \Vert$$, \langle and \rangle $$\langle x \rangle$$, \lceil and \rceil $$\lceil x \rceil$$, and \lfloor and \rfloor $$\lfloor x \rfloor$$. \middle can be used to add additional dividers. There are also invisible parentheses, denoted by .: \left.\frac12\right\rbrace is $$\left.\frac12\right\rbrace$$. If manual size adjustments are required: \Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr) gives $$\Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr)$$. 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$$, \iiint $$\iiint$$, \idotsint $$\idotsint$$. 8. Fractions There are three 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}$$. Using \cfrac{a}{b} command is useful for continued fractions $$\cfrac{a}{b}$$, more details for which are given in this sub-article. 9. Fonts • Use \mathbb or \Bbb for "blackboard bold": $$\mathbb{CHNQRZ}$$. • Use \mathbf for boldface: $$\mathbf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$$ $$\mathbf{abcdefghijklmnopqrstuvwxyz}$$. • Use \mathit for italics: $$\mathit{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$$ $$\mathit{abcdefghijklmnopqrstuvwxyz}$$. • Use \pmb for boldfaced italics: $$\pmb{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$$ $$\pmb{abcdefghijklmnopqrstuvwxyz}$$. • Use \mathtt for "typewriter" font: $$\mathtt{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$$ $$\mathtt{abcdefghijklmnopqrstuvwxyz}$$. • Use \mathrm for roman font: $$\mathrm{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$$ $$\mathrm{abcdefghijklmnopqrstuvwxyz}$$. • Use \mathsf for sans-serif font: $$\mathsf{ABCDEFGHIJKLMNOPQRSTUVWXYZ}$$ $$\mathsf{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}$$ Nonstandard function names can be set with \operatorname{foo}(x) $$\operatorname{foo}(x)$$. 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 \leq \leqq \leqslant \ge \geq \geqq \geqslant \neq $$\lt\, \gt\, \le\, \leq\, \leqq\, \leqslant\, \ge\, \geq\, \geqq\, \geqslant\, \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 \simeq \cong \equiv \prec \lhd \therefore $$\approx\, \sim \, \simeq\, \cong\, \equiv\, \prec\, \lhd\, \therefore$$ • \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{…}, for example to access spaces. 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}$$ and \overleftrightarrow $$\overleftrightarrow{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. If you want \ itself, you should use \backslash $$\backslash$$, because \\ is for a new line.

(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.

## Contents

Alphabetical list of links to To MathJax Topics, by title:

• 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}$ – robjohn Aug 28 '12 at 2:06
• Two related questions: How do I insert a table when asking a question? and How to show the integral symbol on this site? – Martin Sleziak Aug 28 '12 at 13:26
• 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$. – Charles Staats Aug 28 '12 at 16:45
• It might be useful to mention hanging subscripts for things like _5C_3 $_5C_3$. You could also mention \frac vs \dfrac. – axblount Aug 29 '12 at 18:09
• 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. – MJD Aug 30 '12 at 2:06
• 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? – Andrew Stacey Sep 11 '12 at 14:13
• @AndrewStacey Thanks for pointing this out. Let's by all means be as correct as possible, particularly when there's no extra cost. – MJD Sep 11 '12 at 14:15
• @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.) – Andrew Stacey Sep 11 '12 at 14:22
• @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? – MJD Sep 11 '12 at 14:35
• @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. – Andrew Stacey Sep 11 '12 at 14:40
• @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". – axblount Sep 11 '12 at 15:01
• @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. – Andrew Stacey Sep 11 '12 at 15:08
• @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. – Andrew Stacey Sep 11 '12 at 16:04
• 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. – user1527227 May 31 '13 at 18:09
• @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. – robjohn Jun 10 '13 at 16:23

# Units

While $\LaTeX$ has packages that format units, MathJax does not. For visual consistency, one should format units within the same string of MathJax code as the value to which it corresponds, separating the value and unit with \ (space-backslash-space) since the BIPM recommends a small space between the value and units. In addition, follow the below conventions for formatting values and units:

### Decimal Separator & Digit Separation

Following the conventions of the English-speaking world, a . $.$ should be used to separate the decimal part of a number from the integral part, not , $,$ as is common in some languages. This is because commas are already reserved for separating mathematical notation such as arguments of multivariate functions, elements of a set, and the coordinates of ordered tuples.

No punctuation should be used to separate multiples of three digits on either side of the decimal separator; instead, a small space rendered by \, should be used on both sides of the decimal marker when the string of digits consists of more than four or five digits. For example,

• 4321.1234 $4321.1234$
• 54\,321.123\,45 $54\,321.123\,45$
• 0.56789 $0.56789$
• 0.567\,89 $0.567\,89$

If you use a decimal separator, you should include a digit on both sides of the separator, even if the digit is simply $0$.

### Powers of $10$

Seeing as we are not calculators, it is preferable to fully write without abbreviation \times10^{n} $\times10^{n}$ when scientific or engineering notation is helpful or necessary. Do not precede or follow this markdown with positive nor negative spaces; \times takes care of that on its own.

Nevertheless, if necessary, use an upright variant of the letter ‘E’ or ‘e’ to indicate order of magnitude, such as

• \mathrm{E}\,6 $\mathrm{E}\,6$
• \scriptsize{\mathrm{E}}\,\normalsize{6} $\scriptsize{\mathrm{E}}\,\normalsize{6}$
• \mathrm{e}\,6 $\mathrm{e}\,6$

A small space on either side is perfectly fine and recommended.

### Single Units

The symbol of any unit—especially SI units—should follow the form \mathrm{u}. (I have this command saved under the keyboard shortcut usin on my devices.) For example,

• \mathrm{m} $\mathrm{m}$
• \mathrm{kg} $\mathrm{kg}$
• \mathrm{ft.} $\mathrm{ft.}$

Do not use a period with symbolic units; do use a period with abbreviated units.

### Units with a Dot Multiplier

Multiplied units conjoined by a dot should follow the form \mathrm{u}\!\cdot\!\mathrm{v} $\mathrm{u}\!\cdot\!\mathrm{v}$. (I have this sequence of commands saved under the keyboard shortcut umul on my devices.) Because of how \cdot is designed (i.e., to separate numbers), the small negative space \! on either side maintains uniform spacing throughout the whole compound unit. For example,

• \mathrm{N}\!\cdot\!\mathrm{m} $\mathrm{N}\!\cdot\!\mathrm{m}$
• \mathrm{s}\!\cdot\!\mathrm{A} $\mathrm{s}\!\cdot\!\mathrm{A}$

Do not use \times $\times$ as a separator.

### Units with a Solidus Separator

Divided units conjoined by a solidus should follow the form \left.\mathrm{u}\middle/\mathrm{v}\right. $\left.\mathrm{u}\middle/\mathrm{v}\right.$. (I have this sequence of commands saved under the keyboard shortcut udiv on my devices.) The extra markdown is to ensure that solidus stretches the entire height of the unit, especially when exponents are involved. For example,

• \left.\mathrm{J}\middle/\mathrm{s}\right. $\left.\mathrm{J}\middle/\mathrm{s}\right.$
• \left.\mathrm{m}\middle/\mathrm{s}^2\right. $\left.\mathrm{m}\middle/\mathrm{s}^2\right.$

You may include small negative spaces \! on either side of the solidus if you please.

### Exponents

Exponents can be rendered with the standard MathJax markdown. The carat and number should immediately follow the closing brace of the mathrm{} argument. For example,

• \mathrm{m}^2 $\mathrm{m}^2$
• \left.\mathrm{m}\middle/\mathrm{s}^2\right. $\left.\mathrm{m}\middle/\mathrm{s}^2\right.$

### Parentheses

Parentheses can also be rendered with standard MathJax markdown using \left( and \right) outside the argument of \mathrm. For example,

• \left.\mathrm{kg}\!\cdot\!\mathrm{m}^2\middle/\left(\mathrm{C}\!\cdot\!\mathrm{s}\right)\right. $\left.\mathrm{kg}\!\cdot\!\mathrm{m}^2\middle/\left(\mathrm{C}\!\cdot\!\mathrm{s}\right)\right.$

### Exponents in Place of Separators

If you prefer to use no separators and only powers, separator each single \mathrm{} with a small space \, and use exponents as necessary. For example,

• \mathrm{m}\,\mathrm{s}^{-2} $\mathrm{m}\,\mathrm{s}^{-2}$
• \mathrm{s}^{-1}\,\mathrm{mol} $\mathrm{s}^{-1}\,\mathrm{mol}$

### Examples in Context

\mu_0=4\pi\times10^{-7} \ \left.\mathrm{\mathrm{T}\!\cdot\!\mathrm{m}}\middle/\mathrm{A}\right.


$$\mu_0=4\pi\times10^{-7} \ \left.\mathrm{\mathrm{T}\!\cdot\!\mathrm{m}}\middle/\mathrm{A}\right.$$

180^\circ=\pi \ \mathrm{rad}


$$180^\circ=\pi \ \mathrm{rad}$$

N_A = 6.022\times10^{23} \ \mathrm{mol}^{-1}


$$N_A = 6.022\times10^{23} \ \mathrm{mol}^{-1}$$

# Markov Chains

This is a heuristic solution for coding Markov chains in Mathjax using a combination of commutative diagrams, the encircle tool and font sizes. There are a few minor issues with this method, for instance the arrows' ends should be attached closer to their targets. Also, it lacks double-headed diagonal arrows and it is difficult to attach probabilities to diagonal arrows. Therefore, it's mostly useful for small chains.

$$\require{enclose} \begin{array}{ccccccccc} \Large{\enclose{circle}{A}} & \xrightarrow{0.1} & \Large{\enclose{circle}{B}} & \xrightarrow{0.2} & \Large{\enclose{circle}{C}} & \xleftarrow{0.3} & \Large{\enclose{circle}{D}} & \xleftarrow{0.4} & \Large{\enclose{circle}{E}}\\\ \scriptsize{0.5}\large{\downarrow} & \scriptsize{0.6}\large{\searrow} & \scriptsize{0.7}\large{\downarrow} & \scriptsize{0.8}\large{\nearrow} & \scriptsize{0.9}\large{\downarrow} & \scriptsize{0.1}\large{\swarrow} & \scriptsize{0.2}\large{\downarrow} & \scriptsize{0.3}\large{\nwarrow} & \scriptsize{0.4}\large{\downarrow}\\\ \Large{\enclose{circle}{F}} & \xrightarrow[0.5]{} & \Large{\enclose{circle}{G}} & \xrightarrow[0.6]{} & \Large{\enclose{circle}{H}} & \xleftarrow[0.7]{} & \Large{\enclose{circle}{I}} & \xleftarrow[0.8]{} & \Large{\enclose{circle}{J}}\\ \circlearrowright\tfrac12\\ \end{array}$$

\require{enclose}
$$\begin{array}{ccccccccc} \Large{\enclose{circle}{A}} & \xrightarrow{0.1} & \Large{\enclose{circle}{B}} & \xrightarrow{0.2} & \Large{\enclose{circle}{C}} & \xleftarrow{0.3} & \Large{\enclose{circle}{D}} & \xleftarrow{0.4} & \Large{\enclose{circle}{E}}\\\ \scriptsize{0.5}\large{\downarrow} & \scriptsize{0.6}\large{\searrow} & \scriptsize{0.7}\large{\downarrow} & \scriptsize{0.8}\large{\nearrow} & \scriptsize{0.9}\large{\downarrow} & \scriptsize{0.1}\large{\swarrow} & \scriptsize{0.2}\large{\downarrow} & \scriptsize{0.3}\large{\nwarrow} & \scriptsize{0.4}\large{\downarrow}\\\ \Large{\enclose{circle}{F}} & \xrightarrow[0.5]{} & \Large{\enclose{circle}{G}} & \xrightarrow[0.6]{} & \Large{\enclose{circle}{H}} & \xleftarrow[0.7]{} & \Large{\enclose{circle}{I}} & \xleftarrow[0.8]{} & \Large{\enclose{circle}{J}}\\ \circlearrowright\tfrac12\\ \end{array}$$


Credit to Zev Chonoles for the commutative diagram.

## Tables

W/ Sub-Variables

After spending too much time searching for a way to make tables of this form (to no avail), I spent even longer searching for the pieces (of which most were found here) to Frankenstein my own. I made this table for a combinatorics q on MSE...

$$\begin{array}{l} \begin{array}{c|c} \hskip36.5pt & \hskip42.5pt\style{font-family:inherit}{\text{Ordering}} \end{array} \\[-7pt]\hline\hskip-5.5pt \begin{array}{c|c|c} \style{font-family:inherit}{\text{Repetition}} & \style{font-family:inherit}{\text{w/}} & \style{font-family:inherit}{\text{w/o}} \\\hline \style{font-family:inherit}{\text{w/}} & P_r^n=n^r & C_r^n=\left(\!\left(\begin{smallmatrix} n \\ r \end{smallmatrix}\right)\!\right)=\left(\begin{smallmatrix} n+r-1 \\ r \end{smallmatrix}\right) \\[0pt]\hline \style{font-family:inherit}{\text{w/o}} & nPr=\frac{n!}{(n-r)!} & nCr=\left(\begin{smallmatrix} n \\ r \end{smallmatrix}\right)=\frac{n!}{r!(n-r)!} \end{array}\hskip-5.5pt \end{array}$$

W/o Sub-Variables

While searching, I found several tables of this form...

$$\begin{array}{c|c|c|c} \style{font-family:inherit}{\text{Day}} & \style{font-family:inherit}{\text{Credit}} & \style{font-family:inherit}{\text{Debit}} & \style{font-family:inherit}{\text{Total}}\\\hline 0 & 0 & 0 & 10000 \\\hline 1 & 100 & 500 & 9600 \\\hline 2 & 0 & 400 & 10000 \\\hline 3 & 1000 & 500 & 10500 \end{array}$$

• I still consider myself a MathJax novice so please comment any code simplifications/corrections & I'll make the edit. – Landon Mar 20 '19 at 5:21
• – Martin Sleziak Mar 20 '19 at 5:35
• @MartinSleziak That was 1 of the questions I came across while searching for a way to make tables w/ sub-variables. – Landon Mar 20 '19 at 6:17

# Alternative Ways of Writing in $\Large\LaTeX$

## TYPESET FONTS

As mentioned before, you can write $\mathtt{. . .}$ to generate fonts like $\mathtt{A}$, $\mathtt{B}$, $\mathtt{C}$ and etc.

You can also produce these fonts writing $\verb|. . .|$ which generates the same fonts $\verb|A|$, $\verb|B|$, $\verb|C|$ and etc.

And concerning different “angle fonts”, $\angle$ generates $\angle$, $\measuredangle$ generates $\measuredangle$ and last but not least, $\sphericalangle$ generates $\sphericalangle$. Also, $\langle...\rangle$ generates $\langle...\rangle$.

Concerning different “approximation fonts”, $\approx$ generates $\approx$ with $\thickapprox$ generating $\thickapprox$. In addition to that, $\sim$ generates $\sim$ and $\thicksim$ generates $\thicksim$ with $\backsim$ generating $\backsim$.

For a symbol of contradiction, you can write $\Rightarrow\Leftarrow$ to generate $\Rightarrow\Leftarrow$ or you can write $\unicode{x21af}$ to generate $\unicode{x21af}$, which is read as Scar (short for Harry Potter's scar, explaining why it looks like a lightning bolt).

$$***$$

## INEQUALITY SIGNS

You can write $\lt$ or $<$ to generate $<$ and $\gt$ or $>$ to generate $>$, with $\le$ or $\leq$ to generate $\leq$.

You can also produce similar less than inequality signs with $\leqslant$ to generate $\leqslant$ and $\leqq$ to generate $\leqq$. The same applies for greater than inequality signs, for which we just rewrite the command as $\g...$ instead of $\l...$ which produces $\geq$, $\geqslant$ and $\geqq$.

By putting in an n, we could form commands like $\ngtr$ to generate $\ngtr$ and $\nless$ to generate $\nless$ as opposed to $\not>$ and $\not<$.

Also, $\ngeq$ = $\not\geq$ which generates $\ngeq$ and $\nleq$ = $\not\leq$, generating $\nleq$.

Furthermore, putting slant at the end of strictly the previous two commands generates $\ngeqslant$ and $\nleqslant$.

$$***$$

## SET CONTAINMENT

You could write $\not\subseteq$ to generate $\not\subseteq$ or $\not\supseteq$ to generate $\not\supseteq$.

You can write $\subsetneq$ to generate $\subsetneq$ and $\supsetneq$ to generate $\supsetneq$.

Or, you can write $\subsetneqq$ to generate $\subsetneqq$ and $\supsetneqq$ to generate $\supsetneqq$.

By striking out the n in the previous commands with qq at the end, we can generate $\subseteqq$ and $\supseteqq$.

Instead of $\left\{. . .\right\}$ to generate $\left\{...\right\}$, you can write $\lbrace...\rbrace$ to generate the exact same thing. For sets that contain element(s) with a single number or letter, you can also write $\{. . .\}$ to generate strictly $\{. . .\}$ with no other smaller or larger brace sizes.

As another alternative to denoting the difference of two sets $A$ and $B$, you can write $\diagdown$ to generate $\diagdown$ in the set expression, $A\diagdown B$. This command though is mainly used for sets $A^n$ and $B^n$. There also exists $\diagup$ = $\diagup$ by the way to denote the division operation as opposed to the ordinary / or $\div$ = $\div$. $$***$$

## OLD-STYLE

For old-style notation, you can write $\eqslantless$ to generate $\eqslantless$ and $\eqslantgtr$ to generate $\eqslantgtr$. These notations can be used to mean the same as $\leqslant$ and $\geqslant$ which is also the same as $\leq$ and $\geq$, but if used today, they commonly represent a not much less than or not much greater than inequality sign.

If you want to write that the statement, $x > y$ and thus $x\neq y$, without any words, then you can write $x \gvertneqq y$ to generate $x \gvertneqq y$. If, on the other hand, you want to then write the same statement for $x < y$ then you can write $x \lvertneqq y$ to generate $x \lvertneqq y$.

Suppose you have that $x\in \mathbb{R}$ but $x \neq 0$ $(\star)$ for example (like in this question), one could write it as follows: $x\in\mathbb{R}\setminus\{0\}$ with $\setminus$ or $\backslash$ to generate $\backslash$. There is an alternative way of writing $(\star)$, nonetheless.

You can write $\gtrless$ to generate $\gtrless$ which means less than and greater than. If $x\gtrless y$ then $x$ is equal to a number greater than $y$ or less than $y$. Therefore, $x \in\mathbb{R}\setminus\{0\}$ can also be written as $x\gtrless 0$. You can also write $\lessgtr$ to generate $\lessgtr$ which essentially means the same thing. The following commands and notation is unnecessary, for their definition is obvious.

$\gtreqless$ generates $\gtreqless$ and $\lesseqgtr$ generates $\lesseqgtr$.

$\gtreqqless$ generates $\gtreqqless$ and $\lesseqgtr$ generates $\lesseqqgtr$.

• or $\setminus$ could be used. – user645636 Sep 14 '19 at 14:38

Is there a way to make the Greek letters displayed upright (non-italic)?

Asked in comment. There is a way using unicode characters, for which one can search here: http://unicode-table.com/en. Normal use of phi is $\phi = ...$, which gives $$\phi = ...$$.
Looking up phi on the above site gives a couple of results, if one uses 'Greek Capital Letter Phi' and copy it with 'Click to copy and paste symbol', and use it like
$Φ = ...$, the result is $$Φ = ...$$.
One might need to experiment which symbol(s) look(s) right.

Is there a tool to visually edit (prepare) the formulas with pre-defined symbols and paste here?

# Overlaying symbols

Yes, it is so easy to overlay symbols, Just one command:

eg. To overlay the $$\wedge$$(\wegde) and the $$\bigcirc$$(\bigcirc) to make the Kulkarni Nomizu Product:

$$\wedge\!\!\!\!\!\bigcirc$$

Which is "$$\text{\wedge\!\!\!\!\!\bigcirc}$$":

Overlaying $$\}$$ (\}) and $$\div$$(\div):

$$\}\!\!\!\!\div$$

Which is "$$\text{\}\!\!\!\!\div}$$"

As you can see, the number of "\!" is different, for exact overlaying each symbol. An "\!" makes the Characters left and right to it move a little bit closer.

Example, the code "ab" produces $$ab$$.
And the code "a\!b" produces $$a\!b$$