## File: jax.rst

package info (click to toggle)
mathjax-docs 2.7+20171212-1
• links: PTS, VCS
• area: main
• in suites: bullseye, buster, sid
• size: 1,100 kB
• sloc: sh: 22; python: 19; makefile: 8
 file content (146 lines) | stat: -rw-r--r-- 4,984 bytes parent folder | download | duplicates (3)
 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 .. _api-jax: ****************** The Base Jax Class ****************** The MathJax.InputJax, MathJax.OutputJax and MathJax.ElementJax classes are all subclasses of the base Jax class in MathJax. This is a private class that implements the methods common to all three other jax classes. Unlike most MathJax.Object classes, calling the class object creates a *subclass* of the class, rather than an instance of the class. E.g., .. code-block:: javascript MathJax.InputJax.MyInputJax = MathJax.InputJax({ id: "MyInputJax", version: "1.0", ... }); creates MathJax.InputJax.MyInputJax as a subclass of MathJax.InputJax. Class Properties ================ .. describe:: directory The name of the jax directory (usually "[MathJax]/jax"). Overridden in the subclass to be the specific directory for the class, e.g. "[MathJax]/jax/input". .. describe:: extensionDir The name of the extensions directory (usually "[MathJax]/extensions"). Instance Properties =================== .. describe:: id The name of the jax. .. describe:: version The version number of the jax. .. describe:: directory The directory for the jax (e.g., "[MathJax]/jax/input/TeX"). .. describe:: require: null An array of files to load before the jax.js file calls the :meth:MathJax.Ajax.loadComplete() method. .. describe:: config: {} An object that contains the default configuration options for the jax. These can be modified by the author by including a configuration subsection for the specific jax in question. .. describe:: JAXFILE: "jax.js" The name of the file that contains the main code for the jax. Methods ======= .. Method:: Translate(script) This is a stub for a routine that should be defined by the jax's jax.js file when it is loaded. It should perform the translation action for the specific jax. For an input jax, it should return the ElementJax object that it created. The :meth:Translate() method is never called directly by MathJax; during the loadComplete() call, this function is copied to the :meth:Process() method, and is called via that name. The default :meth:Translate() method throws an error indicating that the :meth:Translate() method was not redefined. That way, if the jax.js file fails to load for some reason, you will receive an error trying to process mathematics with this jax. :Parameters: - **script** --- reference to the DOM