1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>The MathJax.Hub Object — MathJax v1.1 documentation</title>
<link rel="stylesheet" href="../_static/mj.css" type="text/css" />
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '../',
VERSION: '1.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="../_static/jquery.js"></script>
<script type="text/javascript" src="../_static/underscore.js"></script>
<script type="text/javascript" src="../_static/doctools.js"></script>
<!--<script type="text/javascript" src="../../../MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>-->
<link rel="top" title="MathJax v1.1 documentation" href="../index.html" />
<link rel="up" title="The MathJax API" href="index.html" />
<link rel="next" title="The MathJax.Ajax Object" href="ajax.html" />
<link rel="prev" title="The MathJax variable" href="variable.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="ajax.html" title="The MathJax.Ajax Object"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="variable.html" title="The MathJax variable"
accesskey="P">previous</a> |</li>
<li><a href="../index.html">MathJax v1.1 documentation</a> »</li>
<li><a href="index.html" accesskey="U">The MathJax API</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="the-mathjax-hub-object">
<span id="api-hub"></span><h1>The MathJax.Hub Object<a class="headerlink" href="#the-mathjax-hub-object" title="Permalink to this headline">¶</a></h1>
<p>The MathJax Hub, <cite>MathJax.Hub</cite>, is the main control structure for
MathJax. It is where input and output <a class="reference internal" href="../glossary.html#term-jax"><em class="xref std std-term">jax</em></a> are tied together,
and it is what handles processing of the MathJax <tt class="docutils literal"><span class="pre"><script></span></tt> tags.
Processing of the mathematics on the page may require external files
to be loaded (when the mathematics includes less common functionality,
for example, that is defined in an extension file), and since file
loading is asynchronous, a number of the methods below may return
before their actions are completed. For this reason, they include
callback functions that are called when the action completes. These
can be used to synchronize actions that require the mathematics to be
completed before those action occur. See the <a class="reference internal" href="../callbacks.html#using-callbacks"><em>Using Callbacks</em></a> documentation for more details.</p>
<div class="section" id="properties">
<h2>Properties<a class="headerlink" href="#properties" title="Permalink to this headline">¶</a></h2>
<dl class="describe">
<dt>
<tt class="descname">config: { ... }</tt></dt>
<dd><p>This holds the configuration parameters for MathJax. Set these
values using <tt class="xref py py-meth docutils literal"><span class="pre">MathJax.Hub.Config()</span></tt> described below. The
options and their default values are given in the <a class="reference internal" href="../options/hub.html#configure-hub"><em>Core
Options</em></a> reference page.</p>
</dd></dl>
<dl class="describe">
<dt>
<tt class="descname">processUpdateTime: 250</tt></dt>
<dd><p>The minimum time (in milliseconds) between updates of the
“Processing Math” message.</p>
</dd></dl>
<dl class="describe">
<dt>
<tt class="descname">signal</tt></dt>
<dd><p>The hub processing signal (tied to the
<tt class="xref py py-meth docutils literal"><span class="pre">MathJax.Hub.Register.MessageHook()</span></tt> method).</p>
</dd></dl>
<dl class="describe">
<dt>
<tt class="descname">queue</tt></dt>
<dd><p>MathJax’s main processing queue. Use <tt class="xref py py-meth docutils literal"><span class="pre">MathJax.Hub.Queue()</span></tt> to push
callbacks onto this queue.</p>
</dd></dl>
<dl class="describe">
<dt>
<tt class="descname">Browser</tt></dt>
<dd><p>The name of the browser as determined by MathJax. It will be one
of <tt class="docutils literal"><span class="pre">Firefox</span></tt>, <tt class="docutils literal"><span class="pre">Safari</span></tt>, <tt class="docutils literal"><span class="pre">Chrome</span></tt>, <tt class="docutils literal"><span class="pre">Opera</span></tt>, <tt class="docutils literal"><span class="pre">MSIE</span></tt>,
<tt class="docutils literal"><span class="pre">Konqueror</span></tt>, or <tt class="docutils literal"><span class="pre">unkown</span></tt>. This is actually an object with
additional properties and methods concerning the browser:</p>
<dl class="describe">
<dt>
<tt class="descname">version</tt></dt>
<dd><p>The browser version number, e.g., <tt class="docutils literal"><span class="pre">"4.0"</span></tt></p>
</dd></dl>
<dl class="describe">
<dt>
<tt class="descname">isMac and isPC</tt></dt>
<dd><p>These are boolean values that indicate whether the browser is
running on a Macintosh computer or a Windows computer. They
will both be <tt class="docutils literal"><span class="pre">false</span></tt> for a Linux computer</p>
</dd></dl>
<dl class="describe">
<dt>
<tt class="descname">isForefox, isSafari, isChrome, isOpera, isMSIE, isKonqueror</tt></dt>
<dd><p>These are <tt class="docutils literal"><span class="pre">true</span></tt> when the browser is the indicated one, and
<tt class="docutils literal"><span class="pre">false</span></tt> otherwise.</p>
</dd></dl>
<dl class="describe">
<dt>
<tt class="descname">versionAtLeast(version)</tt></dt>
<dd><p>This tests whether the browser version is at least that given
in the <cite>version</cite> string. Note that you can not simply do a
numeric comparison, as version 4.10 should be considered later
than 4.9, for example. Similarly, 4.10 is different from 4.1,
for instance.</p>
</dd></dl>
<dl class="describe">
<dt>
<tt class="descname">Select(choices)</tt></dt>
<dd><p>This lets you perform browser-specific functions. Here,
<cite>choices</cite> is an object whose properties are the names of the
browsers and whose values are the functions to be performed.
Each function is passed one parameter, which is the
<tt class="docutils literal"><span class="pre">MathJax.Hub.Browser</span></tt> object. You do not need to include
every browser as one of your choices (only those for which you
need to do special processing. For example:</p>
<div class="highlight-javascript"><div class="highlight"><pre><span class="nx">MathJax</span><span class="p">.</span><span class="nx">Hub</span><span class="p">.</span><span class="nx">Browser</span><span class="p">.</span><span class="nx">Select</span><span class="p">(</span>
<span class="nx">MSIE</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">browser</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">browser</span><span class="p">.</span><span class="nx">versionAtLeast</span><span class="p">(</span><span class="s2">"8.0"</span><span class="p">))</span> <span class="p">{...</span> <span class="k">do</span> <span class="nx">version</span> <span class="mi">8</span> <span class="nx">stuff</span> <span class="p">...</span> <span class="p">}</span>
<span class="p">...</span> <span class="k">do</span> <span class="nx">general</span> <span class="nx">MSIE</span> <span class="nx">stuff</span> <span class="p">...</span>
<span class="p">},</span>
<span class="nx">Firefox</span><span class="o">:</span> <span class="kd">function</span> <span class="p">(</span><span class="nx">browser</span><span class="p">)</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="nx">browser</span><span class="p">.</span><span class="nx">isMac</span><span class="p">)</span> <span class="p">{...</span> <span class="k">do</span> <span class="nx">Mac</span> <span class="nx">stuff</span> <span class="p">...</span> <span class="p">}</span>
<span class="p">...</span> <span class="k">do</span> <span class="nx">general</span> <span class="nx">Firefox</span> <span class="nx">stuff</span>
<span class="p">}</span>
<span class="p">);</span>
</pre></div>
</div>
</dd></dl>
</dd></dl>
</div>
<div class="section" id="methods">
<h2>Methods<a class="headerlink" href="#methods" title="Permalink to this headline">¶</a></h2>
<dl class="method">
<dt id="Config">
<tt class="descname">Config</tt><big>(</big><em>options</em><big>)</big><a class="headerlink" href="#Config" title="Permalink to this definition">¶</a></dt>
<dd><p>Sets the configuration options (stored in <tt class="docutils literal"><span class="pre">MathJax.Hub.config</span></tt>)
to the values stored in the <cite>options</cite> object. See
<a class="reference internal" href="../options/index.html#configuration"><em>Configuring MathJax</em></a> for details on how this
is used and the options that you can set.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>options</strong> — object containing options to be set</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last"><tt class="docutils literal"><span class="pre">null</span></tt></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="describe">
<dt>
<tt class="descname">Configured()</tt></dt>
<dd><p>When <tt class="docutils literal"><span class="pre">delayStartupUntil</span></tt> is specified in the configuration file or
in the script that loads <tt class="docutils literal"><span class="pre">MathJax.js</span></tt>, MathJax’s startup sequence is
delayed until this routine is called. See <a class="reference internal" href="../options/index.html#configuration"><em>Configuring MathJax</em></a> for details on how this is used.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><tt class="docutils literal"><span class="pre">null</span></tt></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="describe">
<dt>
<tt class="descname">Register.PreProcessor(callback)</tt></dt>
<dd><p>Used by preprocessors to register themselves with MathJax so that
they will be called during the <tt class="xref py py-meth docutils literal"><span class="pre">MathJax.Hub.PreProcess()</span></tt>
action.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>callback</strong> — the callback specification for the preprocessor</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last"><tt class="docutils literal"><span class="pre">null</span></tt></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="describe">
<dt>
<tt class="descname">Register.MessageHook(type,callback)</tt></dt>
<dd><p>Registers a listener for a particular message being sent to the
hub processing signal (where <cite>PreProcessing</cite>, <cite>Processing</cite>, and
<cite>New Math</cite> messages are sent). When the message equals the
<cite>type</cite>, the <cite>callback</cite> will be called with the message as its
parameter.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>type</strong> — a string indicating the message to look for</li>
<li><strong>callback</strong> — a callback specification</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last"><tt class="docutils literal"><span class="pre">null</span></tt></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="describe">
<dt>
<tt class="descname">Register.StartupHook(type,callback)</tt></dt>
<dd><p>Registers a listener for a particular message being sent to the
startup signal (where initialization and component startup
messages are sent). When the message equals the <cite>type</cite>, the
<cite>callback will be called with the message as its parameter.
See the :ref:`Using Signals <using-signals></cite> dcocumentation for
more details.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>type</strong> — a string indicating the message to look for</li>
<li><strong>callback</strong> — a callback specification</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last"><tt class="docutils literal"><span class="pre">null</span></tt></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="describe">
<dt>
<tt class="descname">Register.LoadHook(file,callback)</tt></dt>
<dd><p>Registers a callback to be called when a particular file is
completely loaded and processed. (The callback is called when the
file makes its <tt class="xref py py-meth docutils literal"><span class="pre">MathJax.Ajax.loadComplete()</span></tt> call.) The
<cite>file</cite> should be the complete file name, e.g.,
<tt class="docutils literal"><span class="pre">"[MathJax]/config/MathJax.js"</span></tt>.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>file</strong> — the name of the file to wait for</li>
<li><strong>callback</strong> — a callback specification</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last">the callback object</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt>
<tt class="descname">Queue</tt><big>(</big><em>callback</em>, <em>...</em><big>)</big></dt>
<dd><p>Pushes the given callbacks onto the main MathJax command queue.
This synchronizes the commands with MathJax so that they will be
performed in the proper order even when some run asynchronously.
See <a class="reference internal" href="../queues.html#using-queues"><em>Using Queues</em></a> for more details about how
to use queues, and the MathJax queue in particular. You may
supply as many <cite>callback</cite> specifications in one call to the
<a class="reference internal" href="callback.html#Queue" title="Queue"><tt class="xref py py-meth docutils literal"><span class="pre">Queue()</span></tt></a> method as you wish.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>callback</strong> — a callback specification</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last">the callback object for the last callback added to the queue</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="Typeset">
<tt class="descname">Typeset</tt><big>(</big><span class="optional">[</span><em>element</em><span class="optional">[</span>, <em>callback</em><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#Typeset" title="Permalink to this definition">¶</a></dt>
<dd><p>Calls the preprocessors on the given element, and then typesets
any math elements within the element. If no <cite>element</cite> is
provided, the whole document is processed. The <cite>element</cite> is
either the DOM <cite>id</cite> of the element, or a reference to the DOM
element itself. The <cite>callback</cite> is called when the process is
complete. See the <a class="reference internal" href="../typeset.html#typeset-math"><em>Modifying Math</em></a> section
for details of how to use this method properly.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>element</strong> — the element whose math is to be typeset</li>
<li><strong>callback</strong> — the callback specification</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last">the callback object</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="PreProcess">
<tt class="descname">PreProcess</tt><big>(</big><span class="optional">[</span><em>element</em><span class="optional">[</span>, <em>callback</em><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#PreProcess" title="Permalink to this definition">¶</a></dt>
<dd><p>Calls the loaded preprocessors on the entire document, or on the
given DOM element. The <cite>element</cite> is either the DOM <cite>id</cite> of the
element, or a reference to the DOM element itself. The <cite>callback</cite>
is called when the processing is complete.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>element</strong> — the element to be preprocessed</li>
<li><strong>callback</strong> — the callback specification</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last">the callback object</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="Process">
<tt class="descname">Process</tt><big>(</big><span class="optional">[</span><em>element</em><span class="optional">[</span>, <em>callback</em><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#Process" title="Permalink to this definition">¶</a></dt>
<dd><p>Scans either the entire document or a given DOM <cite>element</cite> for
MathJax <tt class="docutils literal"><span class="pre"><script></span></tt> tags and processes the math those tags
contain. The <cite>element</cite> is either the DOM <cite>id</cite> of the element to
scan, or a reference to the DOM element itself. The <cite>callback</cite> is
called when the processing is complete.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>element</strong> — the element to be processed</li>
<li><strong>callback</strong> — the callback specification</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last">the callback object</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="Update">
<tt class="descname">Update</tt><big>(</big><span class="optional">[</span><em>element</em><span class="optional">[</span>, <em>callback</em><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#Update" title="Permalink to this definition">¶</a></dt>
<dd><p>Scans either the entire document or a given DOM element for
mathematics that has changed since the last time it was processed,
or is new, and typesets the mathematics they contain. The
<cite>element</cite> is either the DOM <cite>id</cite> of the element to scan, or a
reference to the DOM element itself. The <cite>callback</cite> is called
when the processing is complete.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>element</strong> — the element to be updated</li>
<li><strong>callback</strong> — the callback specification</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last">the callback object</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="Reprocess">
<tt class="descname">Reprocess</tt><big>(</big><span class="optional">[</span><em>element</em><span class="optional">[</span>, <em>callback</em><span class="optional">]</span><span class="optional">]</span><big>)</big><a class="headerlink" href="#Reprocess" title="Permalink to this definition">¶</a></dt>
<dd><p>Removes any typeset mathematics from the document or DOM
element, and then processes the mathematics again,
re-typesetting everything. This may be necessary, for example, if
the CSS styles have changed and those changes would affect the
mathematics. The <cite>element</cite> is either the DOM <cite>id</cite> of the element
to scan, or a reference to the DOM element itself. The <cite>callback</cite>
is called when the processing is complete.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>element</strong> — the element to be reprocessed</li>
<li><strong>callback</strong> — the callback specification</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last">the callback object</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="getAllJax">
<tt class="descname">getAllJax</tt><big>(</big><span class="optional">[</span><em>element</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#getAllJax" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of all the element jax in the document or a
specific DOM element. The <cite>element</cite> is either the DOM <cite>id</cite> of the
element, or a reference to the DOM element itself.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>element</strong> — the element to be searched</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last">array of <cite>element jax</cite> objects</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="getJaxByType">
<tt class="descname">getJaxByType</tt><big>(</big><em>type</em><span class="optional">[</span>, <em>element</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#getJaxByType" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of all the element jax of a given MIME-type in the
document or a specific DOM element. The <cite>element</cite> is either the
DOM <cite>id</cite> of the element to search, or a reference to the DOM
element itself.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>type</strong> — MIME-type of <cite>element jax</cite> to find</li>
<li><strong>element</strong> — the element to be searched</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last">array of <cite>element jax</cite> objects</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="getJaxByInputType">
<tt class="descname">getJaxByInputType</tt><big>(</big><em>type</em><span class="optional">[</span>, <em>element</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#getJaxByInputType" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns a list of all the element jax associated with input
<tt class="docutils literal"><span class="pre"><script></span></tt> tags with the given MIME-type within the given DOM
element or the whole document. The <cite>element</cite> is either the DOM
<cite>id</cite> of the element to search, or a reference to the DOM element
itself.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>type</strong> — MIME-type of input (e.g., <tt class="docutils literal"><span class="pre">"math/tex"</span></tt>)</li>
<li><strong>element</strong> — the element to be searched</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last">array of <cite>element jax</cite> objects</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="getJaxFor">
<tt class="descname">getJaxFor</tt><big>(</big><em>element</em><big>)</big><a class="headerlink" href="#getJaxFor" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns the element jax associated with a given DOM
element. If the element does not have an associated element jax,
<tt class="docutils literal"><span class="pre">null</span></tt> is returned. The <cite>element</cite> is either the DOM <cite>id</cite> of the
element, or a reference to the DOM element itself.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>element</strong> — the element whose element jax is required</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last"><cite>element jax</cite> object or <tt class="docutils literal"><span class="pre">null</span></tt></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="isJax">
<tt class="descname">isJax</tt><big>(</big><em>element</em><big>)</big><a class="headerlink" href="#isJax" title="Permalink to this definition">¶</a></dt>
<dd><p>Returns <tt class="docutils literal"><span class="pre">0</span></tt> if the element is not a <tt class="docutils literal"><span class="pre"><script></span></tt> that can be
processed by MathJax or the result of an output jax, returns <tt class="docutils literal"><span class="pre">-1</span></tt>
if element is an unprocessed <tt class="docutils literal"><span class="pre"><script></span></tt> tag that could be
handled by MathJax, and returns <tt class="docutils literal"><span class="pre">1</span></tt> if element is a processed
<tt class="docutils literal"><span class="pre"><script></span></tt> tag or an element that is the result of an output jax.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>element</strong> — the element to inspect</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last">integer (-1, 0, 1)</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="Insert">
<tt class="descname">Insert</tt><big>(</big><em>dst</em>, <em>src</em><big>)</big><a class="headerlink" href="#Insert" title="Permalink to this definition">¶</a></dt>
<dd><p>Inserts data from the <cite>src</cite> object into the <cite>dst</cite> object. The
<cite>key:value</cite> pairs in <cite>src</cite> are (recursively) copied into <cite>dst</cite>, so
that if <cite>value</cite> is itself an object, its contents is copied into
the corresponding object in <cite>dst</cite>. That is, objects within <cite>src</cite>
are merged into the corresponding objects in <cite>dst</cite> (they don’t
replace them).</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>dst</strong> — the destination object</li>
<li><strong>src</strong> — the source object</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last">the modified destination object</p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="method">
<dt id="formatError">
<tt class="descname">formatError</tt><big>(</big><em>script</em>, <em>error</em><big>)</big><a class="headerlink" href="#formatError" title="Permalink to this definition">¶</a></dt>
<dd><p>This is called when an internal error occurs during the processing
of a math element (i.e., an error in the MathJax code itself).
The <cite>script</cite> is a reference to the <tt class="docutils literal"><span class="pre"><script></span></tt> tag where the
error occurred, and <cite>error</cite> is the <tt class="docutils literal"><span class="pre">Error</span></tt> object for the error.
The default action is to insert an HTML snippet at the location of
the script, but this routine can be overriden durring MathJax
configuration in order to perform some other action.
<tt class="docutils literal"><span class="pre">MathJax.Hub.lastError</span></tt> holds the <tt class="docutils literal"><span class="pre">error</span></tt> value of the last
error on the page.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Parameters :</th><td class="field-body"><ul class="first simple">
<li><strong>script</strong> — the <tt class="docutils literal"><span class="pre"><script></span></tt> tag causing the error</li>
<li><strong>error</strong> — the <tt class="docutils literal"><span class="pre">Error</span></tt> object for the error</li>
</ul>
</td>
</tr>
<tr class="field"><th class="field-name">Returns :</th><td class="field-body"><p class="first last"><tt class="docutils literal"><span class="pre">null</span></tt></p>
</td>
</tr>
</tbody>
</table>
</dd></dl>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="../index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">The MathJax.Hub Object</a><ul>
<li><a class="reference internal" href="#properties">Properties</a></li>
<li><a class="reference internal" href="#methods">Methods</a></li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="variable.html"
title="previous chapter">The MathJax variable</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="ajax.html"
title="next chapter">The MathJax.Ajax Object</a></p>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="../search.html" method="get">
<input type="text" name="q" size="18" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="../genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="ajax.html" title="The MathJax.Ajax Object"
>next</a> |</li>
<li class="right" >
<a href="variable.html" title="The MathJax variable"
>previous</a> |</li>
<li><a href="../index.html">MathJax v1.1 documentation</a> »</li>
<li><a href="index.html" >The MathJax API</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2011 Design Science.
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
</div>
</body>
</html>
|