Fix(Render): Ajust "*" visibility with variables

This commit is contained in:
2018-10-10 10:40:40 +02:00
parent e6abc208a0
commit d2f67a0961
4 changed files with 11 additions and 4 deletions

View File

@@ -94,6 +94,8 @@ def mul2tex(left, right):
>>> a = mo.MOstr('x')
>>> mul2tex(mo.MO(3), a)
'3x'
>>> mul2tex(a, a)
'x \\times x'
"""
display_time = True
try:
@@ -121,7 +123,7 @@ def mul2tex(left, right):
else:
right_ = tree2tex(right)
finally:
if right_[0].isalpha():
if right_[0].isalpha() and (left_.isnumeric() or left_.isdecimal()):
display_time = False
if display_time:

View File

@@ -94,6 +94,8 @@ def mul2txt(left, right):
>>> a = mo.MOstr('x')
>>> mul2txt(mo.MO(3), a)
'3x'
>>> mul2txt(a, a)
'x * x'
"""
display_time = True
try:
@@ -121,7 +123,7 @@ def mul2txt(left, right):
else:
right_ = tree2txt(right)
finally:
if right_[0].isalpha():
if right_[0].isalpha() and (left_.isnumeric() or left_.isdecimal()):
display_time = False
if display_time: