[HOME] jsMath (Authors/2.x) [Prev][Top][Up][Next]

Changing Other jsMath Attributes

The previous sections have described how to change the font warning messages, the math font sizes, and so on. There are a few other attributes that are also customizable for jsMath.

The Error Message Style

If jsMath encounters an error in the TeX code in a web page, it displays an error message in place of the mathematics. Normally, this is black text on a yellow background with a red border, but you can customize that using the .error CSS style. You can set this using
    <SCRIPT> jsMath = {styles: {'.error': 'style-attributes'}} </SCRIPT>
before loading jsMath.js, or by
    <STYLE> .error {style-attributes} </STYLE>
afterward. The default is
    .error {font-size: 10pt; font-style: italic; background-color: #FFFFCC;
            padding: 1px; border: 1px solid #CC0000}

The Default Fallback Method

You can specify the default fallback method by setting the jsMath.Font.fallback variable to one of "symbol", "image" or "unicode" before loading the jsMath.js file. The default is "symbol", which means letters and numbers are shown in standard fonts, but math symbols are shown using images. For example
    <SCRIPT> jsMath = {Font: {fallback: "image"}} </SCRIPT>
will set the default fallback to be image mode.

Controlling the jsMath Cookie

The data that the user can modify in the jsMath control panel is stored in a cookie within the browser. A cookie is tied to a specific website and (optionally) to specific directories within that website. By default, jsMath stores site-wide cookies, which means that any page using jsMath that is loaded from your web server will have the same cookie values.

It is possible to tell jsMath to use a more restricted cookie by specifying the path for which the cookie is valid. For example, you can make the cookie be specific to the pages within the directory myMath/Examples (and all of its subdirectories) on your website by setting

    <SCRIPT> jsMath = {Controls: {cookiePath: "myMath/Examples"}} </SCRIPT>
before loading jsMath.js. If you are using a web site that is part of a larger domain and you want the settings to cover more than just your own server, but also the wider domain, you can set jsMath.Controls.cookieDomain to the appropriate domain name.

Get jsMath at SourceForge.net. Fast, secure and Free Open Source software downloads [HOME] jsMath web pages
Created: 10 Jul 2005
Last modified: 02 Dec 2005 12:59:19
Comments to: dpvc@union.edu
[Next] Adjusting Multiple jsMath Parameters
[Up] Information for jsMath v2.x Authors
[Prev] Changing the jsMath Button-Click Attributes