File: fast-preview.rst

package info (click to toggle)
mathjax-docs 2.7%2B20161014-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 1,080 kB
  • ctags: 14
  • sloc: sh: 22; python: 19; makefile: 8
file content (70 lines) | stat: -rw-r--r-- 2,570 bytes parent folder | download | duplicates (3)
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
.. _configure-fast-preview:

*****************************
The fast-preview extension
*****************************

The options below control the operation of the `fast-preview`
extension that is run when you include ``"fast-preview.js"`` in the
`extensions` array of your configuration.  They are listed with their
default values.  To set any of these options, include a
``fast-preview`` section in your :meth:`MathJax.Hub.Config()` call.
For example

.. code-block:: javascript

    MathJax.Hub.Config({
      "fast-preview": {
        Chunks: {EqnChunk: 10000, EqnChunkFactor: 1, EqnChunkDelay: 0},
        color: "inherit!important",
        updateTime: 30, updateDelay: 6,
        messageStyle: "none",
        disabled: false
      }
    });

would ask for the PreviewHTML output to run as a preview (`disabled: false`),
force inheritance of the surrounding text color, and set the `updateTime` and
`updateDelay` to  low values (30ms / 6ms) to speed up
the preview pass. Furthermore, it configures the second pass to set the
chunking (`Chunks`) to a reflow every 10,000 equations and disables the
progress messages (`messageStyle`).

This extension provides a two-pass rendering mode. A **first**, fast-but-rough
rendering is genereated as a preview, using the
:ref:`configure-PreviewHTML`, then a **second** pass using the
configured output jax runs to update the preview output.

This two-pass mode will provide the reader with a quick, decent rendering to
start reading immediately, while silently updating that rendering with the
high quality layout later.


.. describe:: EqnChunk: 10000
              EqnChunkFactor: 1
              EqnChunkDelay: 0

    These values control how "chunky" the **second** pass will be. For more
    information see :ref:`configure-HTML-CSS` and :ref:`configure-SVG`.

.. describe:: color: "inherit!important"

    This value allows you to choose a text color for the **first** passs.

.. describe:: updateTime: 30
              updateDelay: 6

    These values control how often the **second** pass will pause to allow user
    interaction (e.g., scrolling).

.. describe:: messageStyle: "none"

    This value controls the verbosity of the processing messages during the
    the **second** pass; see :ref:`configure-hub` for more information.

.. describe:: disabled:false

    This value enables or disables the preview mode. In particular,
    it allows overriding a combined configuration file, cf.
    :ref:`common-configurations`. The user can independently enable or disable
    the fast preview via the MathJax Menu.