From 8c553818f9860460fc48078c4cea49b4a9709c0c Mon Sep 17 00:00:00 2001 From: "Davide P. Cervone" Date: Wed, 16 Jun 2021 13:21:24 -0400 Subject: [PATCH] Add information about lazy typesetting --- index.rst | 1 + output/lazy.rst | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+) create mode 100644 output/lazy.rst diff --git a/index.rst b/index.rst index 3521a90..dac3930 100644 --- a/index.rst +++ b/index.rst @@ -64,6 +64,7 @@ need it. :titlesonly: Output Formats + Lazy Typesetting Line Breaking Font Support Browser Support diff --git a/output/lazy.rst b/output/lazy.rst new file mode 100644 index 0000000..2f0604b --- /dev/null +++ b/output/lazy.rst @@ -0,0 +1,50 @@ +.. _lazy-typesetting: + +################ +Lazy Typesetting +################ + +MathJax offers an extension that is designed to improve the +performance of pages with large numbers of equations. It implements a +"lazy typesetting" approach that only processes an expression when it +comes into view. This means that expressions will not be typeset when +they are not visible, and your readers will not have to wait for the +entire document to typeset, speeding up their initial view of the +page. Furthermore, any expressions that are never seen will not be +typeset, saving the processing time that would normally have been +spent on those expressions. + +This also helps with the situation where you may link to a particular +location in your page (via a URL with a hash); typesetting the +material above that point can cause the browser to change the scroll +position, and so the user may not end up at the proper location in the +page. With the lazy extension, the material above that point is not +typeset until the user scrolls upwards, and so there is no position +change. + +To use the lazy typesetting extension, simply add it to your +configuration as follows: + +.. code-block:: latex + + MathJax = { + loader: {load: ['ui/lazy']} + }; + +This will adjust the typesetting pipeline to implement the +lazy-typesetting functionality. + +Lazy typesetting works best with SVG output, but changes with the way +the CommonHTML output handles its stylesheet updates make the CHTML +output nearly as fast. With TeX input, the lazy extension makes sure +that previous expressions are processed by TeX (though not output to +the page) so that any macro definitions or automatic equation numbers +are in place when the visible expressions are processed. Currently, +documents that contain ``\ref`` or ``\eqref`` links may not yet work +properly, since target equations may not have been typeset, and so the +link location may not be marked in the document. In particular, +forward references are unlikely to work, and backward references will +work only if the target expression has already been typeset. We hope +to improve this situation in a future release. + +|-----|