From d393e1e794f6c3e14be8b2339070c40d167bba79 Mon Sep 17 00:00:00 2001 From: Lafrite Date: Tue, 25 Feb 2014 15:59:22 +0100 Subject: [PATCH] debug texrenders but need unittest --- pymath/renders.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pymath/renders.py b/pymath/renders.py index c729c17..e9a35e7 100644 --- a/pymath/renders.py +++ b/pymath/renders.py @@ -28,6 +28,7 @@ post2in_fix = Render(p2i_infix, p2i_postfix, p2i_other, join = False) # A latex render def texSlash(op1, op2): + """ Tex render for / """ if not Render.isNumerande(op1) and op1[0] == "(" and op1[-1] == ")": op1 = op1[1:-1] if not Render.isNumerande(op2) and op2[0] == "(" and op2[-1] == ")": @@ -35,11 +36,13 @@ def texSlash(op1, op2): return ["\\frac{" , op1 , "}{" , op2 , "}"] def texFrac(frac): + """ Tex render for Fractions""" return ["\\frac{" , str(frac._num) , "}{" , str(frac._denom) , "}"] def texMult(op1,op2): + """ Tex render for * """ fe = first_elem(op2) - if type(fe) == Polynom or fe.isalpha(): + if type(fe) != int and (type(fe) == Polynom or fe.isalpha()): if type(op1) == list and op1[0] == "(": return ["(", op1[1:-1], op2, ")"] else: