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. Changing Other jsMath Attributes
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 loadingjsMath.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 thejsMath.Font.fallback
variable to one of"symbol"
,"image"
or"unicode"
before loading thejsMath.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 loadingjsMath.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 setjsMath.Controls.cookieDomain
to the appropriate domain name.
|
|