# Mapytex Formal calculus with explanation python module. [French wiki](https://opytex.org/pymath) ## Installing Install and update with [pip](pypi.org) ``` pip install -U mapytex ``` ## Examples ### Simplify expressions and explain steps ``` python >>> from mapytex import Expression >>> ajout_fractions = Expression("2 / 5 + 2 / 3") >>> resultat = ajout_fractions.simplify() >>> print(resultat) 16 / 15 >>> for s in resultat.explain(): ... print(s) ... 2 / 5 + 2 / 3 2 \times 3 / 5 \times 3 + 2 \times 5 / 3 \times 5 6 / 15 + 10 / 15 6 + 10 / 15 16 / 15 ``` ### Random expression generator ``` python >>> from mapytex import Expression >>> ajout_fraction = Expression.random("{a} + {b} / {c}") >>> print(ajout_fraction) 2 + 3 / 5 ``` ### Render in latex ``` python >>> from mapytex import Expression >>> Expression.set_render("tex") >>> ajout_fractions = Expression("2 / 5 + 2 / 3") >>> for i in ajout_fractions.simpliy().explain(): ... print(i) ... \frac{ 2 }{ 5 } + \frac{ 2 }{ 3 } \frac{ 2 \times 3 }{ 5 \times 3 } + \frac{ 2 \times 5 }{ 3 \times 5 } \frac{ 6 }{ 15 } + \frac{ 10 }{ 15 } \frac{ 6 + 10 }{ 15 } \frac{ 16 }{ 15 } ```