On May 13, 9:49 am, Brian Hawkins <[email protected]> wrote: > I did not know about the %latex command, thanks for the tip. > > Looking at the symbol table, I found one that serves my particular > purpose well: \top. $M^\top$ renders as I'd like for a transpose and > avoids using an unsupported font in jsMath. > > Brian > > On May 12, 4:55 am, Jason Grout <[email protected]> wrote: > > > > > Rob Beezer wrote: > > > Hi Brian, > > > > In a notebook cell, I enter and evaluate: > > > > %latex > > > $M^\mathsf{T}$ > > > > and get back a slanted M and a very crisp, upright superscript T. So > > > it can be done, but this is accomplished by running a full-blown > > > instance of TeX and creating a PNG graphic as output. $M^{\sf T}$ > > > looks to render identically. > > > > I get the error you mention when I add $M^\mathsf{T}$ via the TinyMCE > > > editor (shift-click on a blue bar). I think this gets interpreted by > > > jsMath, so any fonts will come from jsMath. From here I'm not sure > > > how to proceed, but maybe this will be enough for somebody else to > > > show the way forward. > > > Searching in the jsmath source shows that \mathrm and \rm are defined, > > but \mathsf and \sf don't seem to be defined. > > > Davide, does jsmath implement san serif fonts? > > > Thanks, > > > Jason
This was posted on the jsMath help forum, http://sourceforge.net/forum/forum.php?forum_id=592273: By: Davide P. Cervone (dpvc) - 2009-05-12 15:17 No, there is no mathsf at this point. There are two possible solutions that I can see. The cheap but easy one is to do a definition like the following: \def\mathsf#1{\style{font-family:sanserif}{\hbox{#1}}} or jsMath.Macro('mathsf','\\style{font-family:sanserif}{\\hbox{#1}}',1); if you include it in a JavaScript file. Some disadvantages: it will always be at the normal text size (so won't get smaller for super- or sub-scripts, for example), and it will use the browser's default sans- serif font, not a TeX font, so it might not match the rest of the TeX output as well. There may also be some spacing issues, as jsMath doesn't really know the sizes of the characters. But it is easy to do and may be sufficient for your needs. The other approach is to make a new jsMath "extra font" for mathsf, like the ones for the other extra fonts (msam10, etc). The tools for doing this are on the jsMath website at http://www.math.union.edu/locate/jsMath/authors/making-fonts.html but you will have to figure out which TeX font you want to use for the \mathsf font. Probably cmss10 would do. Davide --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
