Fractions belong to the standard applications within mathematics, but they are also occasionally used within normal text.

Input | Output |

$\frac{1}{a}$ | \[\frac{1}{a}\] |

$\frac{1}{\frac{a}{b}}$ | \[\frac{1}{\frac{a}{b}}\] |

$\frac{\frac{a}{b+c}+d}{a +\frac{b}{c+d}}$ | \[\frac{\frac{a}{b+c}+d}{a +\frac{b}{c+d}}\] |

\[\frac{1}{a}\] | \[\frac{1}{a}\] |

\[\frac{1}{\frac{a}{b}}\] | \[\frac{1}{\frac{a}{b}}\] |

\[\frac{\frac{a}{b+c}+d}{a +\frac{b}{c+d}}\] | \[\frac{\frac{a}{b+c}+d}{a +\frac{b}{c+d}}\] |

name/command | input | output |

displaystyle | $\dfrac{1}{\dfrac{a}{b}}$ | \[\dfrac{1}{\dfrac{a}{b}}\] |

textstyle | $\tfrac{1}{\tfrac{a}{b}}$ | \[\tfrac{1}{\tfrac{a}{b}}\] |

scriptstyle | ${\scriptstyle \frac{1}{\frac{a}{b}} }$ | \[\scriptstyle \frac{1}{\frac{a}{b}}\] |

scriptscriptstyle | ${\scriptscriptstyle \frac{1}{\frac{a}{b}} }$ | \[\scriptstyle \frac{1}{\frac{a}{b}}\] |

For the latter two sizes scriptstyle and scriptscriptstyle amsmath.sty provides no shortcut commands for these. However, these commands are quite easy to create.

$\sfrac{1}{\sfrac{a}{b}}$ | \[\scriptstyle \frac{1}{\frac{a}{b}}\] |

$\ssfrac{1}{\ssfrac{a}{b}}$ | \[\scriptscriptstyle \frac{1}{\frac{a}{b}}\] |

Output:

\[\frac{1}{1+\frac{1}{1+\frac{1}{1+\frac{1}{1 + \frac{1}{1 + x}}}}}\] |

Normal continued fraction within displaymath environment:

\[\frac{1}{1+\frac{1}{1+\frac{1}{1+\frac{1}{1 + \frac{1}{1 + x}}}}}\]

Output:

\[\frac{1}{1+\frac{1}{1+\frac{1}{1+\frac{1}{1 + \frac{1}{1 + x}}}}}\]

Normal continued fraction by using the

Output:

\[\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1 + \cfrac{1}{1 + x}}}}}\] |

Normal continued fraction by using the

\[\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1 + \cfrac{1}{1 + x}}}}}\]

Output:

\[\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1+\cfrac{1}{1 + \cfrac{1}{1 + x}}}}}\]

\[\substack{a\\b}\] |

It will also work within displaymath environment:

\[\substack{a\\b}\]\[\substack{a\\b}\]

Without

Output:

\[ ( \frac{a^{2}}{2} ) \] |

With

$\left( \frac{a^{2}}{2} \right)$

Output:

\[\left( \frac{a^{2}}{2} \right)\] |

command | example | description |

$\cancel{24}$ | \[\cancel{24}\] | Stroke / Line from bottom left to top right |

$\bcancel{24}$ | \[\bcancel{24}\] | Stroke / Line from top left to bottom right |

$\xcancel{24}$ | \[\xcancel{24}\] | Two crossing strokes (combination of the first two commands) |

$\cancelto{23}{46}$ | \[\cancelto{23}{46}\] | Reducing to ... |

Output:

\[\frac{\cancel{24}}{\cancel{8}} = 3\] \[\frac{\cancel{24}}{\bcancel{8}} = 3\] \[\frac{\xcancel{24}}{\bcancel{8}} = 3\] \[\frac{\cancelto{23}{46}}{\cancelto{4}{8}} = \frac{23}{4}\] The first three commands also work with text:

Input | Output |

\cancel{Text} | \[\cancel{\text{Text}}\] |

\bcancel{Text} | \[\bcancel{\text{Text}}\] |

\xcancel{Text} | \[\xcancel{\text{Text}}\] |

instead of |

\newcommand{\bcancelto}[2]{\rotatebox[origin=c]{180}{$\cancelto{\rotatebox[origin=c]{180}{\scriptsize #1}}{#2}$}}Hint: The command

Input:

\[ \frac{\cancelto{23}{46}}{\bcancelto{4}{8}} = \frac{23}{4} \text{ instead of } \frac{\cancelto{23}{46}}{\cancelto{4}{8}} = \frac{23}{4} \]Output:

instead of |