diff --git a/mapytex/calculus/core/MO/monomial.py b/mapytex/calculus/core/MO/monomial.py index a19cdd4..8eba5aa 100644 --- a/mapytex/calculus/core/MO/monomial.py +++ b/mapytex/calculus/core/MO/monomial.py @@ -190,6 +190,27 @@ class MOMonomial(Molecule): Molecule.__init__(self, _tree) + + def __str__(self): + if self._coefficient != -1: + return super(MOMonomial, self).__str__() + else: + return "- " + self.strpower.__str__() + + @property + def __txt__(self): + if self._coefficient != -1: + return super(MOMonomial, self).__txt__ + else: + return "- " + self.strpower.__txt__ + + @property + def __tex__(self): + if self._coefficient != -1: + return super(MOMonomial, self).__tex__ + else: + return "- " + self.strpower.__tex__ + @property def coefficient(self): return self._coefficient