Ask Your Question

How can I alter the output so that equations are printed?

asked 2019-02-11 09:51:57 -0500

stockh0lm gravatar image

Currently, when you have something like this:

e_Ersatz = d_k * ( (e_m/d_m) + (e_s/(d_k-d_m) ) )

show( e_Ersatz )

it would just print this:

d_k * ( (e_m/d_m) + (e_s/(d_k-d_m) ) )

and it would print it beautiful and in latex formatting. but i would like it to include the " e_Ersatz = " in a nicely formatted way, so that it is easier to follow the output.

How can i do that?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-02-11 12:20:04 -0500

rburing gravatar image

updated 2019-02-11 12:25:29 -0500

You can do

show( SR.symbol('e_Ersatz') == e_Ersatz )

or really define e_Ersatz as a symbol, and show the equation:

show( e_Ersatz == d_k * ( (e_m/d_m) + (e_s/(d_k-d_m) ) ) )

Both SR.symbol and var also accept a latex_name keyword argument, so you can define e.g.

var('e_Ersatz', latex_name='e_{\\text{Ersatz}}')
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-02-11 09:51:57 -0500

Seen: 30 times

Last updated: Feb 11