Available MathJax Extensions and Macros

MarkFL

Super Moderator
Staff member
Joined
Nov 24, 2012
Messages
1,552
Hello, FMH Community! :D

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]
\(\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

If you have any questions about these, please feel free to ask.
 

mmm4444bot

Super Moderator
Staff member
Joined
Oct 6, 2005
Messages
10,273
Great thread, MarkFL! 🐬
 

Otis

Senior Member
Joined
Apr 22, 2015
Messages
1,362
Code:
[MATH]\frac{\cancel{a}x}{\cancel{a}}=x[/MATH]
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?

[tex]\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[/tex]

\(\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
Joined
Nov 24, 2012
Messages
1,552
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?

[tex]\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[/tex]

\(\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
Joined
Oct 6, 2005
Messages
10,273
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
Joined
Nov 24, 2012
Messages
1,552
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

Administrator
Staff member
Joined
Dec 21, 2002
Messages
349
Hey I hate to be the one asking the obvious but... What does \displaystyle do?
 

Otis

Senior Member
Joined
Apr 22, 2015
Messages
1,362
… 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:
  • Like
Reactions: Ted

MarkFL

Super Moderator
Staff member
Joined
Nov 24, 2012
Messages
1,552
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
Joined
Oct 6, 2005
Messages
10,273
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.)

😵

🙃
 
Top