When I do this sequence of code in a worksheet:
M1=matrix([[1,2],[3,4]])
print(latex(M1))
html('$%s$' %latex(M1))
M2=matrix([[1,2,3],[1,2,3],[1,2,3]])
print(latex(M2))
html('$%s$' %latex(M2))
... M1 displays correctly, but M2 looks weird. I don't see any
difference in the way the html is constructed. Does anybody else
get a funny result on this? Or have I possibly screwed up
something in my worksheet environment?
-Mike
Are you sure you have jsmath fonts installed? Similar complaints were
made before by people without jsmath fonts.
--
Tim Joseph Dumol <tim (at) timdumol (dot) com>
http://timdumol.com
I don't know. I don't remember doing anything explicitly to
install them. I don't have any other latex related problems
in the notebook (that I've found out about yet :-)
Is there some command that can tell me if they're installed?
Or can you give me a pointer to the documentation I might read
to find out more about that?
-Mike
Follow up question: I'm not actually going to use this notebook
myself. I generally just output latex and build a PDF file.
I'm making the notebook for others to use. Are they going to
have to have jsmath fonts installed? My whole intent in using
the notebook interface is that (hopefully) someone can just
point their browser at it, and not have to know about the
underlying issues. Is this realistic?
-Mike
There is an optional spkg for sage, jsmath_image_fonts-1.4.p3.spkg
description: The jsMath image fonts provide a fall-back for rendering
TeX characters in browsers on computers that do not have the TeX fonts
installed.
This is not included by default because it is huge (many images
[although i heard it is indirectly in the mercurial repo of sagenb]),
but afaik would render installing fonts on all clients unnecessary.
H
Well, I *thought* that that was equivalent to what I do have:
html('<script src="http://localhost/jsMath/easy/load.js"></script>')
Although, now that I try it, everything other than the 3d matrix
seems to work with or without that line. I'm a bit confused about
what jsmath capabilities are needed and when. Is there something else,
other than displaying matrices that should fail if jsmath isn't
properly set up?
So, I tried this:
/usr/local/sage-4.5.1/sage -i jsmath_image_fonts-1.4.p3.spkg
It downloaded the package and appeared to install it without
any problem. I stopped the sage server, exited out of sage,
quit netscape, then started everything up again. Nothing changed.
(I did eliminate all the includes for my local jsmath stuff too.)
-Mike
It looks like jsMath failed to set up properly (error code -7). I will
try to keep going, but it could get ugly.
I don't remember ever seeing this before. I haven't updated
firefox lately. Anyone know if this indicates that my browser
has some particular problem? I imagine whatever this is may
be the root of my other issues.
-Mike
sage -i jsmath_image_fonts-1.4.p3
which might help.
William
--
William Stein
Professor of Mathematics
University of Washington
http://wstein.org
you can setup several profiles with firefox, it's worth checking this
out by creating a new one. Also, disable all
adblock/scriptblocking/content modification plugins.
$ firefox -P "sage" -safe-mode
-P for profile, -safe-mode disables plugins and loads the default theme.
H
I did this. I checked all the "disable" boxes while creating the
new profile. When I go to sagenb.org, I still get the "jsMath failed
to setup" error. And I still have the same matrix display problem
locally. By the way, this is firefox 3.5.6 on Fedora 11.
In the meantime I've found by trying a couple of other computers,
that there are *some* other browsers on *some* other system do get the
same error, and some don't.
For example, my girlfriends laptop with Fedora 12 and Firefox 3.5.9
does NOT get the "fail to setup" error on sagenb.org.
But I tried in on another Fedora 12 system with Firefox 3.5.11,
and that one DOES get the error. Google Chrome 5.0.375.125 beta
on this same fc12 system does NOT get the error.
BTW, I don't see the jsmath failed to setup error when I use
my own server, even for the browsers that "fail" with sagenb.
But the same browsers that get the error on sagenb are the
ones that have the problem displaying the matrix. So, I
assume it's the same problem.
So, after these test, I can only assume that I'm not the only
one who ever gets this "failed to setup" with sagenb(?)
For the record, I just did these, around 8:00am (PST) Tuesday.
-Mike
Could you please also check how the examples on the official jsmath
page look? Maybe it's time to update jsmath?
(clicking on the jsmath icon at the bottom right reveals the version number)
here are matrices:
http://www.math.union.edu/~dpvc/jsMath/examples/TeXbook18b.html
H
I think we'd probably move to MathJax, the successor to jsmath. I think
all development has moved from jsmath to MathJax.
Thanks,
Jason
Yes, those look fine. And I followed the links to a bunch of other
examples, which all worked. BTW, I really did try to duplicate this
problem outside of the sage notebook environment and I couldn't
do it.
It appears that I'm using jsMath v3.6e on the system that
has the problem. On the other system, google-chrome which does
not have the problem, and firefox which does have the problem
both report: jsMath v3.6e also.
Wow, good job finding a fix! Can you summarize the issue and fix on a
trac ticket?
Thanks,
Jason
Well, AFAIK this isn't really a fix. Since that line shouldn't be
executed (as far as I can see) and it doesn't appear to be related
to the error on sagenb.org. It just makes things work on my local
server, for reasons that I don't understand. I'm way out of my
depth here, and I was hoping that what I found would serve as a
"hint" to someone who knows how the notebook really works.
Also, I'm a little confused about the fact that no one else has
reported this "-7" error with sagenb.org. This seems to call
into question whether there is, in general, a problem or not.
So I'm afraid I'd just create more confusion by starting to
create trac tickets, without really knowing what I'm doing.
I guess my best "summary" of the "suspected" error would be
to phrase it in terms of sagenb, rather than a server running
on my system (since that brings in all sorts of other
complications) and that summary is:
It looks like jsMath failed to set up properly (error code -7). I will
try to keep going, but it could get ugly.
Happens when I try to use sagenb.org on some systems with
some browsers, but not with any pattern that I've been able
to detect.
Sorry I can't do better than that. I've never really
used the notebook interface much. I normally output stuff
using latex and view it in PDF. I just happened to try to
create some worksheets so that they could be viewed by
a study group I'm in. Maybe I should have had more experience
with notebooks before trying that :-)
-Mike
When I don't load the image fonts properly I see something crazy.
When they do load properly, I see the same symbol in the sage
notebook that I see with jsMath on a regular html page. So I
assume it's the right symbol.
If I do
QL('This is the $\Bigl\\lfloor x \\Bigr\\rfloor$ function')
Then the x is lined up with the rest of the text, but the
"bars" surrounding the x extend for quite a ways
above and below the x and the rest of the text. But the amount
of extension appears roughly equal. When I look closely,
perhaps those line in the notebook extend *slightly* further
down than they do on a regular html page.
-Mike