LaTeX & MathJax basic tutorial – Crossing things out

Crossing things out

Use \require{cancel} in the first formula in your post that requires cancelling; you need it only once per page. Then use:

\verb|y+\cancel{x}| & y+\cancel{x}\\
\verb|\cancel{y+x}| & \cancel{y+x}\\
\verb|y+\bcancel{x}| & y+\bcancel{x}\\
\verb|y+\xcancel{x}| & y+\xcancel{x}\\
\verb|y+\cancelto{0}{x}| & y+\cancelto{0}{x}\\
\verb+\frac{1\cancel9}{\cancel95} = \frac15+& \frac{1\cancel9}{\cancel95} = \frac15 \\

Use \require{enclose} for the following:

\verb|\enclose{horizontalstrike}{x+y}| & \enclose{horizontalstrike}{x+y}\\
\verb|\enclose{verticalstrike}{\frac xy}| & \enclose{verticalstrike}{\frac xy}\\
\verb|\enclose{updiagonalstrike}{x+y}| & \enclose{updiagonalstrike}{x+y}\\
\verb|\enclose{downdiagonalstrike}{x+y}| & \enclose{downdiagonalstrike}{x+y}\\
\verb|\enclose{horizontalstrike,updiagonalstrike}{x+y}| & \enclose{horizontalstrike,updiagonalstrike}{x+y}\\

\enclose can also produce enclosing boxes, circles, and other notations; see MathML menclose documentation for a complete list.

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{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]$.

Leave a Reply

Your email address will not be published. Required fields are marked *