File size: 292 Bytes
cc646d3 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
from sympy import latex
def to_latex(expr, is_coeff=False):
return "" if is_coeff and expr == 1 else f"{{{latex(expr)}}}"
def to_latexes(*args, is_coeff=False):
return [to_latex(i, is_coeff=is_coeff) for i in args]
sign2cmp = {1: ">", -1: "<"}
sign2cmp_inv = {1: "<", -1: ">"}
|