$$LEARNING \quad the \quad MATHJAX$$
$$(my \quad MathJax \quad notebook)$$
I've tried to write the things in a systematic manner; i.e, when the reader have a query about a plus-related problem, the visitor will find it on respective paragraph. Similarly when the user have a question about division, fraction and ratio; all the symbols would be found in the respective paragraph.
Part-1 : Reference and resources.
Main Stack-Exchange Articles:
Other useful Stack-exchange articles
MathJax Official Website
Other Online Resources:
Other quick references
- On a math expression formatted with MathJax; do a right-click (mouse secondary button). That would give following dropdown menu.
.
On this dropdown list; take help of "Show math as" (and then --> TeX commands) which will show the command prompt required to design the math expression. And also take help of "MathJax Help", which gives some help as well as gives a link to MathJax official site.
Part-2 : The tutorial.
Content
- Recognition of MathJax Commands.
- Most MathJax command involves Back-Slash.
- Special commands may not require in some cases.
- Writing punctuation marks, special characters, writing normal text, escaping execution.
- Subscript and Superscript lettering
- Putting space.
- Grouping some characters as a single thing.
- Bracketing.
- Breaking into new lines.
- Writing Numbers.
- Writing variables.
- Writing Greek letters
- Writing Physical Quantities.
- Writing Chemical formula.
- Writing relationships like equations and inequalities.
- Writing Chemical equations.
- Addition, Subtraction, Positive, Negative and Plus-minus.
- Multiplication.
- Division, fraction, ratios.
- Power, Root, Logarithm.
- Trigonometric functions and inverse trigonometric functions.
- Modern algebra, Set- theory and logic.
- Geometry.
- Matrix, Tables, arrays.
- PHYSICS formatting
- CHEMISTRY Formatting.
- STATISTICS formatting.
Inside :
$$Basic \quad Structure$$
Recognition of MathJax input:
- The Dollar sign (
$
) works as a label or indicator of MathJax input. System will recognize the part text as Mathjax input with help of dollars used in input.
- To write math-expressions within line of normal text; cover the expression with single dollar sign at start and end. Such as
$2+2=4$
gives you $2+2=4$ within the line within normal text.
Similarly $2^2=4$
gives $2^2=4$ , within the line.
- To display mathematical expressions in a separate paragraph, cover the expression within double dollar (i.e. at start of expression a double dollar (
$$
), at end of expression again double dollar ($$
).
Such as within line $$(x+y)^2=(x^2)+(2xy)+(y^2)$$
will give $$(x+y)^2=(x^2)+(2xy)+(y^2)$$ out of line.
- Don't Forget to use open and close the mathematical text with equal number of dollar sign. If the mathematical text starts with single dollar, close it with single dollar. If the math text start with double dollar, finish it with double dollar.
- In a continuous mathematical text, normally you need not to introduce any extra dollar-signs (other than the starting and ending). Because that may be recognized as a close signal, or some other complication or error. In the following examples, where-ever, commands contain the dollars, it means the ultimate terminal dollars for an individual example of mathematical text. While applying them to a larger mathematical text, those extra dollars in commands to be discarded.
- To display a new line, it is NOT compulsory to end a mathjax text (
$
Math-text-1 $
or $$
Math-text-1 $$
) and again start a new mathJax Text ( $
Math-text-2$
or $$
Math-text-2$$
). The usage of \\
command for line break within a single continuous MathJax paragraph, has been discussed soon below.
this section is about recognition of MathJax commands by system. The detailed commands for specific purpose, has been discussed below
- Most commands in MathJax requires 'back-Slash' (
\
) :
- most commands in MathJax format, will require the special character back-slash or
\
, usually at the starting-end (left-hand end) of the command. For just some examples,
$\log_5{25}=2$ is obtained from $\log_5{25}=$
.
$\sqrt[2]{25}=5$ is obtained from $\sqrt[2]{25}=2$
.
Greek letter lowercase alpha (α) (in markdown α
), in MathJax obtained from \alpha
and gives output as $\alpha$.
Back-Slash (\
) is not to be confused with forward-slash (/
) , also known as front-slash, stroke-mark, oblique, etc.
this section is about general structure of MathJax commands. The detailed commands for specific purpose, has been discussed below
- Special commands may NOT require for some common tasks. (
!
)
- Common numerals (
0-9
), English alphabet (Uppercase: A-Z
, Lowercase: a-z
), common mathematical signs plus (+
), minus (-
), equals (=
), decimal point (.
) does not require special commands. (Verification Required. Not based on reference; only based on observation).
- Some special characters could be entered directly from keyboard, but there are more safe commands for them.
Such as less than (<
), $a<b$
gives output as $a<b$.
But with command it could be written as $a\lt b$
that gives output as $a\lt b$.
Similarly, greater than (>
), $a>b$
gives output as $a<b$.
But in command prompt it would be $a\gt b$
that gives rise to $a\gt b$.
this section is about when we need not a MathJax commands. The detailed commands for specific purpose, has been discussed below
!
Status: Verification and improvement required
- Writing punctuation marks, special characters, writing normal-text, escaping
execution.
- Subscript and Superscript lettering
- Putting Space.
- MathJax allows us to write normal sentence, but it does not show the blank spaces ( $\require{cancel}\cancel{_b}$ ) entered by users. so, both AB and A(space)B reads like AB.
Example: $a b c$
gives $a b c$ .
To avoid this situation, command or code for space required.
- To display a tiny little space, use
\,
(i.e. Backslash Comma).
Such as $a\,b\,c$
gives $a\,b\,c$
- To display a larger space, use
\;
(i.e. Backslash Semicolon).
Such as $a\;b\;c$
gives to $a\;b\;c$.
- To display more larger space, use
\quad
.
Such as $a\quad b\quad c$
gives to $a\quad b\quad c$.
- To display even more larger space, use
\qquad
.
Such as $a\qquad b\qquad c$
gives to $a\qquad b\qquad c$.
Note that; we can't output spacebar directly; but there is function of spacebar in input. Such as a\quad b
does not work if we remove all the space i.e. do (a\quadb
). between quad and b, the space is working as a separator. $a\quadb$
gives $a\quadb$ i.e.
Error message.
this section is about usage of spaces in MathJax commands. The detailed commands for specific purpose, has been discussed below
- Grouping: Curly braces i.e.
{ }
functions in 'grouping' of characters as a single value. It also indicates taking a value for a function
- For one example, while using the command for power (
^
), if we want to write x-to-the-power-Twenty-three (x23) and write $x^23$
, it will give $x^23$ i.e. x 2 3.
- To avoid this circumstance, we need to group that 23 as a single value that we are giving as input.
i.e. $x^{23}$
gives $x^{23}$.
- Similarly,
To write ${x^{y}}^z$, type ${x^{y}}^z$
, or in more typographic sense $x^{yz}$
(renders to $x^{yz}$).
But to write $x^{y^{z}}$ type $x^{y^{z}}$
.
- Similarly, to write the command for trigonometric functions like sine (
\sin
), cosine (\cos
) etc;
to render $\sin{90^\circ}=\cos{0^\circ}=1$, use $\sin{90^\circ}=\cos{0^\circ}=1$
. To write $\sin{90}$ use $\sin{90}$
.
To write $\sin{90^\circ}+\cos{90^\circ}$ use $\sin{90^\circ}+\cos{90^\circ}$
- Some operations that require two values at a time; may seek to put one value in some other form.
- For example,
$\sqrt[123]{45678}$ is obtained from $\sqrt[123]{45678}$
. Here the radicand is being taken within curly braces '{ }' but the index of the root is being taken by square braces or []
.
- $\log_{10}{10000}$ is obtained by
\log_{10}{10000}
.
this section is about grouping characters or part of an equation into a single value (with MathJax commands). The detailed commands for specific purpose, has been discussed below
- Bracketing
- Breaking into new lines:
- Double backslash is command for line break.
- example:
$a+b=10\\
\Rightarrow a=10-b\\
\Rightarrow -a=-10+b$.
To write this, we have to type the followings:
$a+b=10\\
\Rightarrow a=10-b\\
\Rightarrow -a=-10+b$
If we omit the line break sign, \\
, i.e. write as:
$a+b=10
\Rightarrow a=10-b
\Rightarrow -a=-10+b$
; it will render as:
$a+b=10
\Rightarrow a=10-b
\Rightarrow -a=-10+b$.
i.e. all in a continuous line.
this section is about creating multiple lines (within a single continuous section written in MathJax). The detailed commands for specific purpose, has been discussed below
$$Writing \quad mathematical \quad terms, \quad units \quad etc$$
- Writing Numbers.
- Writing variables.
- Writing Greek Letters.
- Writing Physical Quantities.
(Will be discussed again in physics notation section below. This is an introductory mention in writing things)
- Writing chemical formulae
(Will be discussed again in chemistry notation section below. This is an introductory mention in writing things)
- Writing relationships like equations and inequalities.
- Writing chemical Equations.
(Will be discussed again in Chemistry notation below. This is an introductory mention about how to write things)
$$Applying \quad different \quad functions \quad and \quad operators$$
- ADDITION, SUBTRACTION, POSITIVE, NEGATIVE, PLUS-MINUS
- Simple Plus and Minus do not require any command.
- Plus obtained by
+
(plus) sign of keyboard.
Such as $5+2$=7
gives output as $5+2=7$.
- Same for positive sign,
such as, to write $+5.6 \; Coulomb$ , type $+5.6 Coulomb$
(!
).
- Similarly, minus obtained by Dash (
-
) key of the keyboard.
Such as $5-2=3$
gives $5-2=3$.
- Same for Negative sign.
Such as to write $-5.6 \; Coulomb$ , type
$-5.6 Coulomb$
(!
)
- To write Plus-minus, i.e. , use
\pm
.
- Such as
$\pm$
gives $\pm$.
$\pm 5.6$
gives $\pm5.6$.
$40\pm 0.5$
gives $40\pm 0.5$
$\sqrt{4}=\pm 2$
gives $\sqrt{4}=\pm 2$
- To use Minus-Plus, i. e. , use
\mp
.
- Such as
$\mp$
gives $\mp$.
$\mp 5.6$
gives $\mp 5.6$.
$40\mp 0.5$
gives $40\mp 0.5$.
$-\sqrt{4}=\mp 2$
gives $-\sqrt{4}=\mp 2$.
- To write the plus within a circle, use
\oplus
. It is basically sign of direct sum (Stackexchange). But it could also be used as positive or plus polarity sign as sometimes done in physics, chemistry and biochemistry.
- Such as
$\oplus$
gives $\oplus$.
Superscript form: $^\oplus$
, gives to $^\oplus$.
Subscript form: $_\oplus$
gives $_\oplus$
- To write minus within a circle, use
\ominus
. This is basically mathematical sign for Symmetric difference, the same sign could be use to show negative or minus polarity sign as sometimes done in physics, chemistry and biochemistry.
- Such as
$\ominus$
gives $\ominus$.
Similarly it works with superscript i.e. $^\ominus$
gives $^\ominus$.
Subscript form: $_ominus$
gives $_\ominus$
Summation:
(for details about integration sign, see calculus section below)
!
Requires review. If there exist more-formal commands to write Units,
plz inform
- Multiplication.
- Algebraic variables expressed as letters, normally can be write side-wise.
- e.g.
$xyz$
renders $xyz$.
$5xy$
renders $5x$.
$5(a+b)(c+d)(e+f-g)$
renders $5(a+b)(c+d)(e+f-g)$.
- For a centered dot use
\cdot
.
- e. g.
$x\cdot y$
gives $x\cdot y$.
$a\cdot b\cdot \cdot c$
gives $a\cdot b \cdot c$.
$5\cdot x\cdot y$
renders $5 \cdot x \cdot y$.
- The full-stop sign gives the dot at a lower portion of line. So it increase chances of confusion with decimal points. So it is better to use
\cdot
to mean multiplication.
Such as $21.67 \cdot x \cdot (a+b) \cdot (c-d)$
gives $21.67 \cdot x \cdot (a+b) \cdot (c-d)$.
Or to further avoid clash, brackets could be used, such as
$(21.67) \cdot x \cdot (a+b) \cdot (c-d)$
gives $(21.67) \cdot x \cdot (a+b) \cdot (c-d)$.
- To get Cross-sign, use
\times
.
- Such as
$5\times 6=30$
gives $5\times 6=30$.
- On traditional or lower level math text it is okay to use either dot ($\cdot$) or cross ($\times$), any one, for the same purpose. But when dot product ($\cdot$) and cross product ($\times$) matters, the 2 signs have separate meaning.
- Cross sign could be also included into (covered by) a circle with the command
$\otimes$
, that gives $\otimes$. (it is basically sign of tensor product, but also a notation of magnetic polarity down the plane. Likewise another symbol $\odot$ for magnetic polarity that could be obtained from \odot
.)
They will be again discussed in physics symbols below. Here mentioned due to similarity with multiplication signs cross ($\times$) and dot($\cdot$).
- Serial multiplication or product of a sequence sign could be obtained by
\prod
.
- $\prod$ This is obtained from
$\prod$
.
- Division, Fraction and ratios.
- To use division sign (÷) use
\div
,
- Such as
$\div$
gives $\div$ .
$10\div 2=5$
gives $10\div 2=5$ .
similarly $(x+3)\div y(z-5)$
gives $(x+3)\div y(z-5)$
And $x=(y\div 6)$
gives $x=(y\div 6)$
- There are several ways to deal fraction sign or line of division.
- One way is to use the Slash (or front-slash) sign or
/
.
- Examples-
$q=x/y$
gives $q=x/y$ .
$r={(a+b)}/{(x+y)}$
gives $t={(a+b)}/{(x+y)}$ .
$s={a}+{(b/x)}+{y} $
gives $s={a}+{(b/x)}+{y}$ .
$t={a}+{b/{(x+y)}}$
gives $t={a}+{(b/{(x+y)})}$ .
$u={{(a+b)}/x}+{b}$
gives $u={({(a+b)}/x)}+{b}$ .
However
$v={a+b}/{x+y}$
gives $v={a+b}/{x+y}$ which is ambiguous.
It can mean either
(A) ${v_1}=a+{(b/x)}-y$ obtained from ${v_2}=a+{(b/x)}-y$
.
(B) ${v_2}={(a+b)}/{(x+y)}$ obtained from ${v_2}={(a+b)}/{x-y}$
.
- Another method is use of command
\frac
. This command draws a horizontal division line.
General format: \frac{numerator}{denominator}
.
- Examples:
$\frac{numerator}{denominator}$
gives $\frac{numerator}{denominator}$ .
$\frac{a}{b}$
gives $\frac{a}{b}$ .
$\frac{100a+200.5b}{5x-0.005yz}$
gives $\frac{100a+200.5b}{5x-0.005yz}$ .
$\frac{(a+b)}{(c+d)}$
gives $\frac{(a+b)}{(c+d)}$ .
$\frac{(a+b) (c+d) (e+f)}{(x+y-z)}
gives $\frac{(a+b) (c+d) (e+f)}{(x+y-z)}$.
$p=\frac{(a+b)}{(m+n)}
renders to $p=\frac{(a+b)}{(m+n)}$ .
$\frac{q+r}{s+t}=\frac{(a+b)}{(c+d+e+f)}$ displays $\frac{q+r}{s+t}=\frac{(a+b)}{(c+d+e+f)}$ .
It is also possible to write more complex fractions.
For example,
$m=\frac{(\frac{A}{B})}{C}$ is obtained from $m=\frac{(\frac{A}{B})}{C}$
.
Similarly $n=\frac{(\frac{a+b}{c+d})}{x+y-z}$
is obtained from $n=\frac{(\frac{a+b}{c+d})}{x+y-z}$
Also ,
$p=\frac{A}{(\frac{B}{C})}$ is obtained from
$p=\frac{A}{(\frac{B}{C})}$
.
Similarly $q=\frac{a+b+m+n}{(\frac{c+d}{e+f})}$
obtained from $q=\frac{a+b+m+n}{(\frac{c+d}{e+f})}$
.
- There is another method to draw horizontal division lines, command
\over
. Its function is same as \frac
command, but much easier to format, because its placement is is in between numerator and denominator (like the /
and \div
).
General format: {{numerator}\over {denominator}}
Note that, here requires an extra (outermost) pair of curly braces. Otherwise a \over
command will consider whatever at the left (before) side of \over
command, as a numerator; and whatever at the right (after) side of \over
, as a denominator.
- Examples;
${{numerator}\over {denominator}}$
gives ${{numerator}\over {denominator}}$
Similarly $a\over b$
gives $a\over b$
And ${{a+b}\over {c+d}}$
gives ${{a+b}\over {c+d}}$ .
Also ${{(a+b)\times(c+d)}\over {(x+y+z)}}$
gives ${{(a+b)\times(c+d)}\over {(x+y+z)}}$ .
The command \over
is more suitable to complex fractions.
Such as
${{A\over B}\over C}$ obtained from ${{A\over B}\over C}$
.
Similarly ${{{(a+b)(c-d)}\over{(m+m)(p+q)}}\over {(a+b)}}$ obtained from ${{{(a+b)(c-d)}\over{(m+m)(p+q)}}\over {(a+b)}}$
.
Also, ${A\over {B\over C}}$ obtained from ${A\over {B\over C}}$
.
Similarly ${ {(a+b)(c-d)}\over { {(m+n)(p-q)}\over {(w+x)(y-z)} } }$ obtained from
${ {(a+b)(c-d)}\over { {(m+n)(p-q)}\over {(w+x)(y-z)} } }$
.
- Why that extra (outermost) curly-braces are important while using
\over
command?
Lets see the following expression.
$x={{2(a+b)}\over {(c-d)}}=c$.
it has been written with $x={{2(a+b)} \over {(c-d)}=c$
.
If it was mistakenly written as
$x={2(a+b)}\over {(c-d)}=c$
, it would give output as
$x={2(a+b)}\over{c+d}=c$. i.e. That is wrong and undeserved.
- There is way to use mixture of slash (oblique) type divisions and horizontal type divisions together.
- Example : Now we'll try to to tackle the following two fractions (A) and (B) using firstly with
/
and \frac
(harder method); and then \
and \over
(easier method).
Expression-A:
Using /
and \frac
:
${x}=\frac{(a+b)}{(c-d)}=(a+b)/(c-d)$
gives
${x}=\frac{(a+b)}{(c-d)}=(a+b)/(c-d)$.
Similarly using /
and \over
:
${x}={(a+b)}\over {(c-d)}= {(a+b)}/{(c-d)}$
gives
${x}={{(a+b)}\over {(c-d)}}= {(a+b)}/{(c-d)}$.
.
A brief Summary is coming soon.
(for each sections).
Update:
I am in a temporary pause from Stackexchange. Will be back few months latter.
......................