Processing math: 100%

First time here? Check out the FAQ!

Ask Your Question
0

Messy typesetting problem

asked 12 years ago

bobcat gravatar image

updated 12 years ago

kcrisman gravatar image

If I enter the followng in a sage notebook, the typeset output is correct but for h(r) is unreadable, is there someway to coerce sage to output a reasonable representation?

The desired expression is h(r)=1r21b2(1dr)1r2

f(r) looks good, g(r) is poor and confusing, h(r) is unreadable.

var ('r, b, d')
f(r) = r^2 * sqrt(1/b^2)    
print(f)    
f.show()
g(r) = r^2 * sqrt(1/b^2 - 1)
print(g)
g.show()
h(r) = 1 / (r^2 * sqrt (1/b^2 - (1 - d/r)*1/r^2))
print (h)
h.show()
Preview: (hide)

1 Answer

Sort by » oldest newest most voted
1

answered 12 years ago

Eviatar Bach gravatar image

I don't think there's any real way to do it now (ticket 10035 could work, if it is ever implemented). If you know the LaTeX code, however, you can do

show(LatexExpr(r'h(r) = {1\over{r^2 \sqrt{ \frac{1}{b^2} - (1 - \frac{d}{r}) \frac{1}{r^2}}}}'))

in the terminal, or

html(r'$h(r) = {1\over{r^2 \sqrt{ \frac{1}{b^2} - (1 - \frac{d}{r}) \frac{1}{r^2}}}}$')

in the notebook.

Preview: (hide)
link

Comments

Even using things like `h(r) = 1/((r^2).mul(sqrt (1/b^2 - (1 - d/r).mul(1/r^2,hold=True)),hold=True))` doesn't really help (we've had hold, just not hold contexts, for quite a while now) because the symbolics automatically reorder things according to its own ordering. I'm not sure how to get it to print in the order one wants (e.g., with the r^2 first).

kcrisman gravatar imagekcrisman ( 12 years ago )

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: 12 years ago

Seen: 377 times

Last updated: Jun 04 '12