diff --git a/docs/html/_sources/api/callback.txt b/docs/html/_sources/api/callback.txt index 4eaeba196..89681b9a3 100644 --- a/docs/html/_sources/api/callback.txt +++ b/docs/html/_sources/api/callback.txt @@ -58,7 +58,7 @@ A callback specification is any one of the following: the given function, and it would return their sum, ``5``, when the callback is executed. - .. describe:: [object, fn] + .. describe:: [object, fn] An array containing an object to use as `this` and a function to call for the callback. For example, @@ -75,7 +75,7 @@ A callback specification is any one of the following: Similar to the previous case, but with data that is passed to the function as well. - ..describe:: ["method", object] + .. describe:: ["method", object] Here, `object` is an object that has a method called `method`, and the callback will execute that method (with the object as @@ -220,24 +220,6 @@ MathJax.Callback Methods - **callback** --- the callback specification :Returns: the callback object -.. method:: ExecuteHooks(hooks[, data[,reset]]) - - Calls each callback in the `hooks` array (or the single hook if it - is not an array), passing it the arguments stored in the data - array. If `reset` is ``true``, then the callback's - :meth:`reset()` method will be called before each hook is - executed. If any of the hooks returns a `Callback` object, then - it collects those callbacks and returns a new callback that will - execute when all the ones returned by the hooks have been - completed. Otherwise, :meth:`MathJax.Callback.ExecuteHooks()` - returns ``null``. - - :Parameters: - - **hooks** --- array of hooks to be called, or a hook - - **data** --- array of arguments to pass to each hook in turn - - **reset** --- ``true`` if the :meth:`reset()` method should be called - :Returns: callback that waits for all the hooks to complete, or ``null`` - .. method:: Queue([callback,...]) Creates a `MathJax.CallBack.Queue` object and pushes the given @@ -257,3 +239,66 @@ MathJax.Callback Methods :Parameters: - **name** --- name of the signal to get or create :Returns: the `Signal` object + +.. method:: ExecuteHooks(hooks[, data[,reset]]) + + Calls each callback in the `hooks` array (or the single hook if it + is not an array), passing it the arguments stored in the data + array. If `reset` is ``true``, then the callback's + :meth:`reset()` method will be called before each hook is + executed. If any of the hooks returns a `Callback` object, then + it collects those callbacks and returns a new callback that will + execute when all the ones returned by the hooks have been + completed. Otherwise, :meth:`MathJax.Callback.ExecuteHooks()` + returns ``null``. + + :Parameters: + - **hooks** --- array of hooks to be called, or a hook + - **data** --- array of arguments to pass to each hook in turn + - **reset** --- ``true`` if the :meth:`reset()` method should be called + :Returns: callback that waits for all the hooks to complete, or ``null`` + +.. method:: Hooks(reset) + + Creates a prioritized list of hooks that are called in order based + on their priority (low priority numbers are handled first). This + is meant to replace :meth:`MathJax.Callback.ExecuteHooks()` and is + used internally for signal callbacks, pre- and post-filters, and + other lists of callbacks. + + :Parameters: + - **reset** --- ``true`` if callbacks can be called more than once + :Returns: the `Hooks` object + + The list has the following methods: + + .. method:: Add(hook[,priority]) + + Add a callback to the prioritized list. If ``priority`` is + not provided, the default is 10. The ``hook`` is a `Callback` + specification as described above. + + :Parameters: + - **hook** --- callback specification to add to the list + - **priority** --- priority of the hook in the list (default: 10) + :Returns: the callback object being added + + .. method:: Remove(hook) + :noindex: + + Remove a given hook (as returned from :meth:`Add()` above) + from the prioritized list. + + :Parameters: + - **hook** --- the callback to be removed + :Returns: ``null`` + + .. method:: Execute() + + Execute the list of callbacks, resetting them if requested. + If any of the hooks return callbacks, then ``Execute()`` + returns a callback that will be executed when they all have + completed. + + :Returns: a callback object or ``null`` + diff --git a/docs/html/_sources/api/elementjax.txt b/docs/html/_sources/api/elementjax.txt index f7af083e7..a3a4159f7 100644 --- a/docs/html/_sources/api/elementjax.txt +++ b/docs/html/_sources/api/elementjax.txt @@ -42,13 +42,11 @@ Instance Properties .. describe:: inputJax - A reference to the input jax that created the element. (In the - future, this will be changed to the name of the input jax.) + The name of the input jax that created the element. .. describe:: outputJax - A reference to the output jax that has processed this element. (In - the future, this will be changed to the name of the output jax.) + The name of the output jax that has processed this element. .. describe:: inputID @@ -89,13 +87,25 @@ Methods - **callback** --- the callback specification :Returns: the callback object +.. Method:: Rerender([callback]) + :noindex: + + Removes the output and produces it again (for example, if CSS has + changed that would alter the spacing of the mathematics). Note + that the internal representation isn't regenerated; only the + output is. The `callback`, if any, is called when the process + completes. + + :Parameters: + - **callback** --- the callback specification + :Returns: the callback object + .. Method:: Reprocess([callback]) :noindex: - Removes the output and produces it again. This may be necessary if - there are changes to the CSS styles that would affect the layout - of the mathematics, for example. The `callback`, if any, is - called when the process completes. + Removes the output and then retranslates the input into the + internal form and reredners the output again. The `callback`, if + any, is called when the process completes. :Parameters: - **callback** --- the callback specification @@ -118,6 +128,16 @@ Methods :Returns: the `` + + + + + + +Type text in the box below:
+ + +

+Preview is shown here: +
+
+ + + + + diff --git a/test/sample-dynamic-steps.html b/test/sample-dynamic-steps.html index 723769104..557196976 100644 --- a/test/sample-dynamic-steps.html +++ b/test/sample-dynamic-steps.html @@ -2,9 +2,9 @@ MathJax Dynamic Steps Test Page - + - + - + + + + + +
+

A test of Equation Numbering

+
+ +
+
+Equation: + +\begin{equation} +E = mc^2 +\end{equation} + +Equation*: + +\begin{equation*} +E = mc^2 +\end{equation*} + +
+Brackets: + +\[E = mc^2\] + +Brackets tagged: + +\[E = mc^2\tag{x}\] + +
+Split: + +\begin{equation} +\begin{split} +a& =b+c-d\\ +& \quad +e-f\\ +& =g+h\\ +& =i +\end{split} +\end{equation} + +
+Multline: + +\begin{multline} + a+b+c+d+e+f+g\\ + M+N+O+P+Q\\ + R+S+T\\ + u+v+w+x+y+z +\end{multline} + +Multline*: + +\begin{multline*} + a+b+c+d+e+f+g\\ + M+N+O+P+Q\\ + R+S+T\\ + u+v+w+x+y+z +\end{multline*} + +
+Gather: + +\begin{gather} +a_1=b_1+c_1\\ +a_2=b_2+c_2-d_2+e_2 +\end{gather} + +Gather*: + +\begin{gather*} +a_1=b_1+c_1\\ +a_2=b_2+c_2-d_2+e_2 +\end{gather*} + +
+Align: + +\begin{align} +a_1& =b_1+c_1\\ +a_2& =b_2+c_2-d_2+e_2 +\end{align} + +Align*: + +\begin{align*} +a_1& =b_1+c_1\\ +a_2& =b_2+c_2-d_2+e_2 +\end{align*} + +Align: + +\begin{align} +a_{11}& =b_{11}& a_{12}& =b_{12}\\ +a_{21}& =b_{21}& a_{22}& =b_{22}+c_{22} +\end{align} + +Align with \notag and \tag: + +\begin{align} +a_{11}& =b_{11}& a_{12}& =b_{12}\notag\\ +a_{21}& =b_{21}& a_{22}& =b_{22}+c_{22} \tag{y} +\end{align} + +Align* with \tag: + +\begin{align*} +a_1& =b_1+c_1\tag{z}\\ +a_2& =b_2+c_2-d_2+e_2 +\end{align*} + +
+ + + diff --git a/test/sample-eqrefs.html b/test/sample-eqrefs.html new file mode 100644 index 000000000..c10fb5b28 --- /dev/null +++ b/test/sample-eqrefs.html @@ -0,0 +1,85 @@ + + + +MathJax Equation References + + + + + + + + + + + + +
+

A test of Equation References

+
+ +
+
+Here is a labeled equation: +$$x+1\over\sqrt{1-x^2}\label{ref1}$$ +with a reference to ref1: \ref{ref1}, +and another numbered one with no label: +$$x+1\over\sqrt{1-x^2}$$ +This one uses \nonumber: +$$x+1\over\sqrt{1-x^2}\nonumber$$ +

+


+

+Here's one using the equation environment: +\begin{equation} +x+1\over\sqrt{1-x^2} +\end{equation} +and one with equation* environment: +\begin{equation*} +x+1\over\sqrt{1-x^2} +\end{equation*} +

+


+

+This is a forward reference [\ref{ref2}] and another \eqref{ref2} for the +following equation: +$$x+1\over\sqrt{1-x^2}\label{ref2}$$ +More math: +$$x+1\over\sqrt{1-x^2}$$ +Here is a ref inside math: $\ref{ref2}+1$ and text after it. + +\begin{align} +x& = y_1-y_2+y_3-y_5+y_8-\dots +&& \text{by \eqref{ref1}}\\ +& = y'\circ y^* && \text{(by \eqref{ref3})}\\ +& = y(0) y' && \text {by Axiom 1.} +\end{align} + +Here's a bad ref [\ref{ref4}] to a nonexistent label. +

+


+

+An alignment: +\begin{align} +a&=b\label{ref3}\cr +&=c+d +\end{align} +and a starred one: +\begin{align*} +a&=b\cr +&=c+d +\end{align*} + +

+ + + diff --git a/test/sample-loader-config.html b/test/sample-loader-config.html new file mode 100644 index 000000000..0d401fbfe --- /dev/null +++ b/test/sample-loader-config.html @@ -0,0 +1,55 @@ + + + +Load MathJax with in-line configuration after the page is ready + + + + + + + + + + + +

Adding MathJax with In-Line Configuration

+ +

+When $a \ne 0$, there are two solutions to $ax^2 + bx + c = 0$ and they are +$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$ +

+ + + diff --git a/test/sample-loader.html b/test/sample-loader.html new file mode 100644 index 000000000..cd85a6df5 --- /dev/null +++ b/test/sample-loader.html @@ -0,0 +1,47 @@ + + + +Load MathJax after the page is ready + + + + + + + + + + + +

Adding MathJax After the Page is Loaded

+ +

+When \(a \ne 0\), there are two solutions to \(ax^2 + bx + c = 0\) and they are +$$x = {-b \pm \sqrt{b^2-4ac} \over 2a}.$$ +

+ + + diff --git a/test/sample-signals.html b/test/sample-signals.html index 7d9837270..65ecef4e5 100644 --- a/test/sample-signals.html +++ b/test/sample-signals.html @@ -2,9 +2,9 @@ MathJax Signals Test Page - + - + + - +