Ticket #7326 (closed enhancement: fixed)
html.table should automatically typeset math inside of strings
| Reported by: | jason | Owned by: | cwitty |
|---|---|---|---|
| Priority: | major | Milestone: | sage-4.2.1 |
| Component: | misc | Keywords: | |
| Cc: | whuss, rbeezer, kcrisman | Work issues: | |
| Report Upstream: | Reviewers: | Wilfried Huss | |
| Authors: | Jason Grout | Merged in: | sage-4.2.1.alpha0 |
| Dependencies: | Stopgaps: |
Description
It would be *really* nice if you could include latex code in a table, like this:
var('t')
density=t^2
html.table([
["Density $\delta(x,y)$", density]
])
and have it do the jsmath magic on the $\delta(x,y)$ part.
Attachments
Change History
comment:2 follow-up: ↓ 4 Changed 4 years ago by whuss
As a workaround this already works:
var('t')
density=t^2
html.table([
['Density <span class="math">\delta(x,y)</span>', density]
])
I am not sure why jsmath does not pick up the $$s in this case.
comment:3 follow-up: ↓ 5 Changed 4 years ago by jason
- Cc rbeezer, kcrisman added
- Status changed from new to needs_review
- Summary changed from html.table should run jsmath on the resulting table to html.table should automatically typeset math inside of strings
This is a very easy patch to review.
comment:4 in reply to: ↑ 2 Changed 4 years ago by jason
Replying to whuss:
As a workaround this already works:
var('t') density=t^2 html.table([ ['Density <span class="math">\delta(x,y)</span>', density] ])
so does html.table(sage.misc.html.math_parse('hi $x^2$')?)
Maybe what is going on is jsmath seems to be not set up to try to find dollar signs, but to only pay attention to class="math" spans and divs.
Note: See
TracTickets for help on using
tickets.

