Now I need to redefine the fractions as follows
By writing \fr{2,3}
, we get $\frac{2}{3}$
. How can I achieve this? I have tried
\newcommand{\fr}[1,2]{\frac{#1}{#2}}
but got wrong.
fractions
Now I need to redefine the fractions as follows
By writing \fr{2,3}
, we get $\frac{2}{3}$
. How can I achieve this? I have tried
\newcommand{\fr}[1,2]{\frac{#1}{#2}}
but got wrong.
Best Answer
The following example defines
\fr
with one argument and separates the numerator and denominator via the help macro\fr@aux
:A variant with error checking: