Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

embed sage vars in html notebook cell

Again I feel like I'm missing something. I'm trying to add some mostly text content to a notebook cell, but I want to include an equation contained in a notebook variable. For example I have defined

var('u, v, w') x = u * v * w^2

And then I want to write a few paragraphs that includes the formula contained in x.

If I use the HTML editor and put something in dollar signs, it formats as path but doesn't eval the content, i.e. if I say $x$ then I just get a literal x in italics.

If I call the html() function, I can do something like html('testing $'+latex(x)+'$') to manually substitute myself, but this gets formatted in fixed-width font for reasons I don't understand.

If I start a cell with %html, then I can't figure out how to get the latex/html representation of the formula in x, but otherwise it formats it nicely. (I guess like an HTML editor cell)

Also, is there some documentation of how the different cell tags like %latex, %html, etc work?

click to hide/show revision 2
format code

embed sage vars in html notebook cell

Again I feel like I'm missing something. I'm trying to add some mostly text content to a notebook cell, but I want to include an equation contained in a notebook variable. For example I have defined

var('u, v, w')
x = u * v * w^2

w^2

And then I want to write a few paragraphs that includes the formula contained in x.

If I use the HTML editor and put something in dollar signs, it formats as path but doesn't eval the content, i.e. if I say $x$ then I just get a literal x in italics.

If I call the html() function, I can do something like html('testing $'+latex(x)+'$') $'+latex(x)+'$') to manually substitute myself, but this gets formatted in fixed-width font for reasons I don't understand.

If I start a cell with %html, %html, then I can't figure out how to get the latex/html representation of the formula in x, but otherwise it formats it nicely. (I guess like an HTML editor cell)

Also, is there some documentation of how the different cell tags like %latex, %html, etc work?

embed sage vars in html notebook cell

Again I feel like I'm missing something. I'm trying to add some mostly text content to a notebook cell, but I want to include an equation contained in a notebook variable. For example I have defined

var('u, v, w')
x = u * v * w^2

And then I want to write a few paragraphs that includes the formula contained in x.

If I use the HTML editor and put something in dollar signs, it formats as path math but doesn't eval the content, i.e. if I say $x$ then I just get a literal x in italics.

If I call the html() function, I can do something like html('testing $'+latex(x)+'$') to manually substitute myself, but this gets formatted in fixed-width font for reasons I don't understand.

If I start a cell with %html, then I can't figure out how to get the latex/html representation of the formula in x, but otherwise it formats it nicely. (I guess like an HTML editor cell)

Also, is there some documentation of how the different cell tags like %latex, %html, etc work?