Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to get latex expression in exponential notation?

I need a latex representation of equations in exponential notation, e.g. units of J/K should be represented as:

J K^{-1}

Is there a way to force sage to return such a result? Here is an example:

var('J K ')
unit1 = J/K
latex(unit1)

returns:

 \frac{J}{K}

How to get latex expression in exponential notation?

I need a latex representation of equations in exponential notation, e.g. units of J/K should be represented as:

J K^{-1}

Is there a way to force sage to return such a result? Here is an example:

var('J K ')
unit1 = J/K
latex(unit1)

returns:

 \frac{J}{K}

I tried expand(), but it does not seem to expand fractions to their exponential representation.