|
Under some circumstances, you may want to be able to have Controlling
tex2math
Processingtex2math
process some portions of the page but not others. One such situation is when you usetex2math
in a bulletin-board system, where the jsMath calls are inserted automatically by the system, so you can't control what is passed to them. In that case, you may want to be able to turn on or offtex2math
by way of the HTML markup itself. You can do this using special class names to indicate whattex2math
should process.If you mark an element with
CLASS="tex2math_ignore"
, then the contents of that element will not be processed bytex2math
. This allows you to use the symbols that usually indicate mathematics without them having that special meaning. For example, in<DIV CLASS="tex2math_ignore"> Normally, you enter mathematics between \( and \) or \[ and \]. </DIV>would preventtex2math
from trying to interpret the two "and's" as mathematics.It is also possible to mark an element with
CLASS="tex2math_process"
to have the opposite effect: to causetex2math
to look for mathematics within the element when it normally wouldn't. Usually,tex2math
will ignore the contents of SCRIPT, NOSCRIPT, STYLE, TEXTAREA and PRE tags, as it usually is inappropriate to typeset mathematics within these items. If you really do wanttex2math
to process the text within one of these elements, you can use the CLASS to force that. For example, <PRE CLASS="tex2math_process"> would causetex2math
to process the contents of the PRE tag for mathematics.Note that you can nest elements with
CLASS="tex2math_process"
inside ones ofCLASS="tex2math_ignore"
and vice versa, and you can nest as many layers deep as you wish. For example, you could make the BODY tag beCLASS="tex2math_ignore"
in order to prohibit math processing, and then explicitly enable it on certain tags by usingCLASS="tex2math_process"
. If the BODY needs to be set to a different class for display purposes, you can place a DIV withCLASS="tex2math_ignore"
around the contents of the page to get the same effect.Finally, it is possible to disable
tex2math
entirely on a page by including an element that is marked withID="tex2math_off"
. Before doing any processing of the page,tex2math
looks for an item with this ID, and if present, it does not run at all. This is intended for use in bulletin-board systems, where you don't control the complete content on the page. This lets you mark a page as not being appropriate for jsMath using only the text you can insert. For example, if you add<SPAN ID="tex2math_off"></SPAN>anywhere on the page, thentex2math
will not run. Note that if you usetex2math
on a system where you are not the only one who can enter text, it is possible for others to include such a tag in their messages, perhaps maliciously, thus disabling the rest of the mathematics on that page. You can prevent this by including<SCRIPT> jsMath.text2math = {allowDisableTag: 0} </SCRIPT>in your web page before loadingtex2math
, or if you are using theeasy/load.js
file to load jsMath, by setting theallowDisableTag
value to 0.
|
|