Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Blackboard bold.. again

Help
2009-05-31
2013-04-29
  • Mads Hansen
    Mads Hansen
    2009-05-31

    Hi I'm installing jsMAth on a site, and have installed msam and msbm,a nd loaded AMSsymbols.js, however when I use the \mathbb{N} command, I get this error..

    Unknown control sequence '\msbm'

    I have double checked everything I can think of, and can't figure out where I have gone wrong.. My load.sj is below..

    /**********************************************************************
    *
    *   Customize the values given below to suit your needs.
    *   You can make additional copies of this file with
    *   different customizated settings if you need to load
    *   jsMath with different parameters.
    *  
    *   Load this page via:
    *  
    *   <SCRIPT SRC="path-to-jsMath/easy/load.js"></SCRIPT>
    *  
    *   (If you are including this file into your page via Server-Side
    *   Includes, you should remove line above.)
    *  
    *   You can make copies of this file with different settings
    *   if you need to have several different configurations.
    *  
    **********************************************************************/

    if (!window.jsMath) {window.jsMath = {}}

    jsMath.Easy = {
      //
      //  The URL of the root jsMath directory on your server
      //  (it must be in the same domain as the HTML page).
      //  It should include "http://yoursite.com/", or should
      //  be relative to the root of your server.  It is possible
      //  to be a relative URL, but it will be relative to the
      //  HTML page loading this file.
      // 
      //  If you leave this blank, jsMath will try to look it up from
      //  the URL where it loaded this file, but that may not work.
      //
      root: "",
     
      //
      //  The default scaling factor for mathematics compared to the
      //  surrounding text.
      //
      scale: 120,
     
      //
      //  1 means use the autoload plug-in to decide if jsMath should be loaded
      //  0 means always load jsMath
      //
      autoload: 1,

      //
      //  Setting any of these will cause the tex2math plugin to be used
      //  to add the <DIV> and <SPAN> tags that jsMath needs.  See the
      //  documentation for the tex2math plugin for more information.
      //
      processSlashParens: 1,       // process \(...\) in text?
      processSlashBrackets: 1,     // process \[...\] in text?
      processDoubleDollars: 1,     // process $$...$$ in text?
      processSingleDollars: 1,     // process $...$ in text?
      processLaTeXenvironments: 0, // process \begin{xxx}...\end{xxx} outside math mode?
      fixEscapedDollars: 0,        // convert \$ to $ outside of math mode?
      doubleDollarsAreInLine: 0,   // make $$...$$ be in-line math?
      allowDisableTag: 1,          // allow ID="tex2math_off" to disable tex2math?
      //
      //  If you want to use your own custom delimiters for math instead
      //  of the usual ones, then uncomment the following four lines and
      //  insert your own delimiters within the quotes.  You may want to
      //  turn off processing of the dollars and other delimiters above
      //  as well, though you can use them in combination with the
      //  custom delimiters if you wish.  See the tex2math documentation
      //  for more details.
      // 
      //customDelimiters: [
      //  '[math]','[/math]',        // to begin and end in-line math
      //  '[display]','[/display]'   // to begin and end display math
      //],

      //
      //  Disallow the use of the @(...) mechanism for including raw HTML
      //  in the contents of \hbox{}?  (If used in a content-management system
      //  where users are allowed to enter mathematics, setting this to 0
      //  would allow them to enter arbitrary HTML code within their
      //  math formulas, and that poses a security risk.)
      //
      safeHBoxes: 1,

      //
      //  Show TeX source when mathematics is double-clicked?
      //
      allowDoubleClicks: 1,
     
      //
      //  Show jsMath font warning messages?  (Disabling this prevents yours
      //  users from finding out that they can have a better experience on your
      //  site by installing some fonts, so don't disable this).
      //
      showFontWarnings: 1,
     
      //
      //  Use "Process" or "ProcessBeforeShowing".  See the jsMath
      //  author's documentation for the difference between these
      //  two routines.
      //
      method: "Process",

      //
      //  List of plug-ins and extensions that you want to be
      //  loaded automatically.  E.g.
      //      ["plugins/mimeTeX.js","extensions/AMSsymbols.js"]
      // 
      loadFiles: ["extensions/AMSsymbols.js","extensions/AMSmath.js"],
     
      //
      //  List of fonts to load automatically.  E.g.
      //      ["cmmib10"]
      //
      loadFonts: ["msam10","msbm10"],
     
      //
      //  List of macros to define.  These are of the form
      //      name: value
      //  where 'value' is the replacement text for the macro \name.
      //  The 'value' can also be [value,n] where 'value' is the replacement
      //  text and 'n' is the number of parameters for the macro.
      //  Note that backslashes must be doubled in the replacement string.
      //  E.g.,
      //      {
      //        RR: '{\\bf R}',
      //        bold: ['{\\bf #1}', 1]
      //      }
      //
      macros: {},
     
      //
      //  Allow jsMath to enter global mode?
      //  (Uses frames, so may not always work with complex web sites)
      //
      allowGlobal: 1,
     
      //
      //  Disable image fonts?  (In case you don't load them on your server.)
      //
      noImageFonts: 0
     
    };

    /****************************************************************/
    /****************************************************************/
    //
    //            DO NOT MAKE CHANGES BELOW THIS
    //
    /****************************************************************/
    /****************************************************************/

    if (jsMath.Easy.root == "") {
      jsMath.Easy.root = document.getElementsByTagName("script");
      jsMath.Easy.root = jsMath.Easy.root[jsMath.Easy.root.length-1].src
      if (jsMath.Easy.root.match(/\/easy\/[^\/]*$/)) {
        jsMath.Easy.root = jsMath.Easy.root.replace(/\/easy\/[^\/]*$/,"");
      } else {
        jsMath.Easy.root = jsMath.Easy.root.replace(/\/(jsMath\/(easy\/)?)?[^\/]*$/,"/jsMath");
      }
    }
    jsMath.Easy.root = jsMath.Easy.root.replace(/\/$/,""); // trim trailing "/" if any

    document.write('<SCRIPT SRC="'+jsMath.Easy.root+'/jsMath-easy-load.js"><'+'/SCRIPT>');

     
    • Mads Hansen
      Mads Hansen
      2009-06-03

      Might be usefull to note in the documentation that msbm and msam won't work if AMSsymbols.js is loaded :)

       
    • I think the problem is that you don't need to load the msam10 and msbm10 fonts explicitly when you use the AMSsymbols extension.  The extension sets up \msbm and \msam to load the fonts automatically when used.  I suspect that what's happening is that the AMSsymbols extension sets up the autoload stuff, and then loading msam10 and msbm10 explicitly leaves some of the macros still in the "autoload" state.  The autoload feature undefines the macro and then loads the file that is supposed to define it; but if the file is already loaded, it is not loaded again, and that leaves the macro undefined.

      So the solution for you is to not load msam10 and msbm10 in the loadFonts array of your easy/load.js file.  The AMSsymbols extension will handle that for you. 

      You are right that the documentation should be improved.

      Davide

      PS, sorry that I didn't answer your original post earlier -- I never actually saw it. Usually, they are mailed to me automatically, but SourceForge has recently changed the software they use for the forums, and it may be that your mail was lost during the transition.  It is not the only one where that occurred.