Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I found an ugly way to get the latex representation step by step:

var('J K ')
units1 = J/K
facs = units1.factor_list()
str1 = ''
for term1 in facs:
    str1 = str1 +' ' + str(term1[0])
    op1 = term1[1]
    if op1!=1:
        str1 = str1 + '^{' + str(op1) + '} '
latex_expr = '$'+str1+'$'