|
Many of these instruction pages describe how to set values for jsMath by setting the Adjusting Multiple jsMath Parameters
jsMath
variable before loading thejsMath.js
file. This is often indicated by a command of the form<SCRIPT> jsMath = {some-values} </SCRIPT>You should only include one command that setsjsMath
, otherwise you will overwrite the changes you have already made to it in the previous commands. If you need to issue more than one command that setsjsMath
, you should combine them into one.For example, if you want to set some styles and also the default scaling factor, you could use the following:
<SCRIPT> jsMath = { styles: {'div.typeset': {'text-align': 'left', margin: '1em 0px 1em 1in'}}, Controls: {cookie: {scale: 133}} } </SCRIPT>If you issue several assignments tojsMath
, only the last one will remain in effect when you loadjsMath.js
.Once you have made one assignment to
jsMath
, it is possible to add more values to it using thejsMath.name
syntax if you wish. For example,<SCRIPT> jsMath = {}; jsMath.styles = {'div.typeset': {'text-align': 'left', margin: '1em 0px 1em 1in'}}; jsMath.Controls = {cookie: {scale: 133}}; </SCRIPT>performs essentially the same assignments as the previous example. Or you could do:<SCRIPT> jsMath = {}; jsMath.styles = {}; jsMath.Controls = {}; jsMath.Controls.cookie = {}; jsMath.styles['div.typeset'] = {'text-align': 'left', margin: '1em 0px 1em 1in'}; jsMath.Controls.cookie.scale = 133; </SCRIPT>If you have to add items programmatically (in response to if-then statements, for example), this is one way to go about it.
|
|