I need to show the path to simplify fractions, i.e., through their common divisors, so that show the first simplifications. For example: 18/6 I'd want to show some like this:
\frac{\cancel{18}^9}{\cancel{6}_3}
Taking 2 as a common divisor, I want that the 9 and the 3 appear above/below of 18 and 6 respectively. If I have more divisors they appear above/below of previous, for example, 50:
\cancel{50}^{\cancel{10}^{2}}
i.e., I want that 10 appears above of the cancelled 50, the 2 appear above of the cancelled 10 (if I divide for 5)
Is there some command or package that does that?
Thanks a lot!
cancel
which does what you want!