\angle problem

Help
2008-12-19
2013-04-29
  • Thomas Gill

    Thomas Gill - 2008-12-19

    I'm using jsMath with Moodle and everything seems to be working, but the angle symbol is missing and a box takes its place.

    When I go to the jsMath page with the symbols character map (http://www.math.union.edu/~dpvc/jsMath/symbols/ord.html) I see the same thing regardless of the computer I'm on. 

    For what it's worth, here's a link to a page in my moodle with the problem:

    http://moodle.ccsd.cc/moodle/mod/resource/view.php?id=1673&username=guest

    Thanks in advance for any assistance.

    -Tom

     
    • Davide P. Cervone

      Well, the problem is that TeX doesn't have the \angle character as a single glyph in one of its fonts, but rather constructs it from two separate pieces, and its method of doing so was more complicated than jsMath could handle.  So jsMath uses the unicode character for the angle instead.  Unfortunately, MSIE doesn't find the character properly unless you give it the font to look in explicitly, and since jsMath doesn't know what fonts you have installed, it can't do that very effectively. 

      I will provide a better solution in the next release of jsMath, but for now, here's a temporary way to do it.  First, edit the jsMath/local/local.js file and add

      jsMath.Macro('angle','\\style{font-family:STSong,'Lucida Sans Unicode',serif}{\\unicode{x2220}}');

      to it.  (If the file doesn't exist, create it, and the directory, if needed.)  Finally, add 'local/local.js' to the loadFiles array in your filters/moodle/javascript.php file.  That should take care of it for you for now.  When you get the next version of jsMath, you can remove the local/local.js file from the loadFiles array.

      Hope that helps, and thanks for reporting the problem.

      Davide

       
    • Davide P. Cervone

      Note:  there should not be a line break in the jsMath.Macro() call.  It should be 'Lucida Sans Unicode' with no break.  Sorry, but I don't have much control over the automatic formatting that this system does.

      Davide

       
    • Thomas Gill

      Thomas Gill - 2008-12-20

      Davide,

      I followed your instructions, but now jsMath gets stuck with a message of "loading jsMath" in the lower left of the screen.  I can see jsMath changing the fonts, but all the commands remain visible instead of being replaced by math symbols.

      If I put null back into the javascript.php file in place of local/local.js, the problem goes away, so perhaps there's something amiss in the local.js line from above (the line break wasn't in it when I copied/pasted).

      Thanks for your help.

      Tom

       
      • Davide P. Cervone

        Sorry, my fault.  Try this in local/local.js instead:

        jsMath.Macro('angle',"\\style{font-family:STSong,'Lucida Sans Unicode',serif}{\\unicode{x2220}}");

        (Note the change of single quotes to double quotes in the second argument to jsMath.Macro).  I forgot about the quotes that are part of the string itself, and the two quotes interfered with each other.

        Davide

         
    • Thomas Gill

      Thomas Gill - 2008-12-20

      Davide,

      That did it.  Thanks again for all your efforts.  jsMath is phenomenal!

      Tom

       

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks