Ask Your Question
1

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

asked 2019-02-11 16:51:57 +0100

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
1

answered 2019-02-11 19:20:04 +0100

rburing gravatar image

updated 2019-02-11 19:25:29 +0100

You can do

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

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

var('e_Ersatz')
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

Stats

Asked: 2019-02-11 16:51:57 +0100

Seen: 315 times

Last updated: Feb 11 '19