# Available MathJax Extensions and Macros

#### MarkFL

##### Super Moderator
Staff member
Hello, FMH Community!

The implementation of MathJax we're running now has all of the available extensions being loaded.

Bbox:

Code:
[MATH]\bbox[5px,border:2px solid red]{\frac{x}{y}}[/MATH]
$$\displaystyle \bbox[5px,border:2px solid red]{\frac{x}{y}}$$

Code:
[MATH]\color{white}\bbox[5px,blue]{\sum_{k=0}^n\left(k^3 \right)=\left(\sum_{k=0}^n\left(k \right) \right)^2}[/MATH]
Moderator Note: MathJax renders LaTeX at this site. Due to an issue with their service, the example below is currently under construction.

$$\displaystyle \color{white}\bbox[5px,blue]{\sum_{k=0}^n\left(k^3 \right)=\left(\sum_{k=0}^n\left(k \right) \right)^2}$$

Cancel:

The cancel commands (we previously had this extension, but we thought it would be good to show the variants):

Code:
[MATH]\frac{\cancel{a}x}{\cancel{a}}=x[/MATH]
$$\displaystyle \frac{\cancel{a}x}{\cancel{a}}=x$$

Code:
[MATH]\frac{\bcancel{a}x}{\bcancel{a}}=x[/MATH]
$$\displaystyle \frac{\bcancel{a}x}{\bcancel{a}}=x$$

Code:
[MATH]\frac{\xcancel{a}x}{\xcancel{a}}=x[/MATH]
$$\displaystyle \frac{\xcancel{a}x}{\xcancel{a}}=x$$

Chemical equations:

Code:
[MATH]\ce{SO4^2- + Ba^2+ -> BaSO4 v}[/MATH]
$$\displaystyle \ce{SO4^2- + Ba^2+ -> BaSO4 v}$$

Enclose:

Code:
[MATH]\enclose{circle}[mathcolor="red"]{\color{black}{x}}[/MATH]
$$\displaystyle \enclose{circle}[mathcolor="red"]{\color{black}{x}}$$

Code:
[MATH]\enclose{circle,box}{x}[/MATH]
$$\displaystyle \enclose{circle,box}{x}$$

Code:
[MATH]13\enclose{longdiv}{169}[/MATH]
$$\displaystyle 13\enclose{longdiv}{169}$$

Code:
[MATH]\enclose{left}{\frac{x}{y}}[/MATH]
$$\displaystyle \enclose{left}{\frac{x}{y}}$$

Extpfeil:

Code:
[MATH]x\xtwoheadrightarrow y[/MATH]
$$\displaystyle x\xtwoheadrightarrow y$$

Code:
[MATH]x\xtwoheadleftarrow y[/MATH]
$$\displaystyle x\xtwoheadleftarrow y$$

Code:
[MATH]x\xmapsto y[/MATH]
$$\displaystyle x\xmapsto y$$

Code:
[MATH]x\xlongequal y[/MATH]
$$\displaystyle x\xlongequal y$$

Code:
[MATH]x\xtofrom y[/MATH]
$$\displaystyle x\xtofrom y$$

You can even define your own arrow as follows:

Code:
[MATH]\Newextarrow{\xrightharpoonup}{5,10}{0x21C0}[/MATH]
$$\displaystyle \Newextarrow{\xrightharpoonup}{5,10}{0x21C0}$$

and then use it thereafter (in that post):

Code:
[MATH]x\xrightharpoonup y[/MATH]
$$\displaystyle x\xrightharpoonup y$$

Text tip:

This allows you to define information the will pop up when the mouse cursor hovers over your expression.

Code:
[MATH]\texttip{\int_a^b f(x)\,dx=F(b)-F(a)}{The Anti-Derivative form of The Fundamental Theorem of Calculus}[/MATH]
$$\displaystyle \texttip{\int_a^b f(x)\,dx=F(b)-F(a)}{The Anti-Derivative form of The Fundamental Theorem of Calculus}$$

Unicodes:

Code:
[MATH]\unicode[.55,0.05]{x22D6}[/MATH]
$$\displaystyle \unicode[.55,0.05]{x22D6}$$

Macros:

Differentiation:

\d{y}{x}

$$\displaystyle \d{y}{x}$$

Partial differentiation:

\pd{f}{x}

$$\displaystyle \pd{f}{x}$$

Scientific exponentiation:

\E{n}

$$\displaystyle \E{n}$$

Trig. functions:

\csch
\arccsc
\arcsec
\arccot
\sech
\arsinh
\arcosh
\artanh
\arcsch
\arsech
\arcoth
\cis

Last edited by a moderator:

Staff member

#### Otis

##### Senior Member
Code:
[MATH]\frac{\cancel{a}x}{\cancel{a}}=x[/MATH]
Hi Mark. Below, I've used _{} and ^{} to show reductions in fractions. How does it look?

$$\displaystyle \dfrac{4}{5} × \dfrac{420}{1} \;\; = \;\; \dfrac{4}{\cancel{5}_{1}} × \dfrac{\cancel{420}^{84}}{1} \;\; = \;\; \dfrac{4×84}{1×1} \; = \; \dfrac{336}{1} \; = \; 336$$

$$\displaystyle \dfrac{4}{5} × \dfrac{420}{1} \;\; = \;\; \dfrac{4}{\cancel{5}_{1}} × \dfrac{\cancel{420}^{84}}{1} \;\; = \;\; \dfrac{4×84}{1×1} \; = \; \dfrac{336}{1} \; = \; 336$$

#### MarkFL

##### Super Moderator
Staff member
Hi Mark. Below, I've used _{} and ^{} to show reductions in fractions (done by arithmetic students, before multiplying/dividing with fractions). How does it look?

$$\displaystyle \dfrac{4}{5} × \dfrac{420}{1} \;\; = \;\; \dfrac{4}{\cancel{5}_{1}} × \dfrac{\cancel{420}^{84}}{1} \;\; = \;\; \dfrac{4×84}{1×1} \; = \; \dfrac{336}{1} \; = \; 336$$

$$\displaystyle \dfrac{4}{5} × \dfrac{420}{1} \;\; = \;\; \dfrac{4}{\cancel{5}_{1}} × \dfrac{\cancel{420}^{84}}{1} \;\; = \;\; \dfrac{4×84}{1×1} \; = \; \dfrac{336}{1} \; = \; 336$$

Looks great!

#### mmm4444bot

##### Super Moderator
Staff member
I notice the system automatically inserted \displaystyle. Is that a default? If so, then \frac{}{} could be used, instead of \dfrac{}{}.

Is there a way to prevent \displaystyle?

#### MarkFL

##### Super Moderator
Staff member
I notice the system automatically inserted \displaystyle. Is that a default? If so, then \frac{}{} could be used, instead of \dfrac{}{}.

Is there a way to prevent \displaystyle?

Yes the math and tex tags automatically insert \displaystyle. To suppress those when using inline math, use \ ( code here \ ) (without the spaces.

#### Ted

Staff member
Hey I hate to be the one asking the obvious but... What does \displaystyle do?

#### Otis

##### Senior Member
… What does \displaystyle do?
It tells the system to increase the size, generally when placing LaTeX on its own line.

On vBulletin for example, by default, the code \frac{}{} produced a
ratio sized for use inline ($$\frac{a}{b}$$), so it's smaller. We had to either insert
\displaystyle at the beginning of each line or use \dfrac{}{}, to get
a larger ratio: $$\displaystyle \frac{a}{b}$$.

Now, everything is display-style, by default. (That saves some typing!) Because Mark just explained, I'm able to insert $$\frac{a}{b}$$ inline, by not typing the BBCode tags but enclosing the LaTeX in the middle of \͏(\) like this:

\͏(\frac{a}{b}\)

EDITED per post #9. Thanks MarkFL

Last edited by a moderator:
Ted

#### MarkFL

##### Super Moderator
Staff member
It tells the system to increase the size, generally when placing LaTeX on its own line.

On vBulletin for example, by default, the code \frac{}{} produced a
ratio sized for use inline ($$\frac{a}{b})$$, so it's smaller. We had to either insert
\displaystyle at the beginning of each line or use \dfrac{}{}, to get
a larger ratio: $$\displaystyle \frac{a}{b}$$.

Now, everything is display-style, by default. (That saves some typing!) Because Mark just explained, I'm able to insert LaTeX inline ($$\frac{a}{b})$$, by not typing the BBCode tags but enclosing the LaTex inside $$)\ like this: \(\frac{a}{b})\ The order of the backslash and bracket needs to be reversed in your closing tags Code: Inline tags: \(...markup here...$$

Display math tags:

$...markup here...$

#### mmm4444bot

##### Super Moderator
Staff member
The order of the backslash and bracket needs to be reversed in your closing tags …
Lol! I knew I was botching somethin'. Confused myself, because I was doing inline LaTeX within displayed parentheses, I suppose. Almost went cross-eyed, trying to discern what up, heh. (I'll fix my post.)

#### JeffM

##### Elite Member
Mark

I like the long division symbol, but is there a way to show the quotient and process in the standard way or does this feature simply permit

$$\displaystyle 4 \enclose{longdiv}{120} = 30.$$

#### MarkFL

##### Super Moderator
Staff member
Mark

I like the long division symbol, but is there a way to show the quotient and process in the standard way or does this feature simply permit

$$\displaystyle 4 \enclose{longdiv}{120} = 30.$$
Right now, the display of LaTeX is messed up due to issues with MathJax I tried to fix, but which caused other problems. So, I'll have to show you an image of what you can do with the Begin/End environment and the long division symbol:

#### mmm4444bot

##### Super Moderator
Staff member
Click HERE to scroll up. $$\displaystyle \;\Big\uparrow\;$$ ͏(This post is for thread-bumps only.)

$$\;$$