 The render mode, either static or dynamic.
 */
function render(renderMode) {
    if (renderMode == RENDER_MODE.STATIC) {
        // For static pages, simply call rendering functions once.
        renderLaTeX();
        updateNavigation();
    } else {
        // For dynamic pages (via `dex web`), listen to update events.
        var source = new EventSource(&quot;/getnext&quot;);
        source.onmessage = function(event) {
            var body = document.getElementById(&quot;main-output&quot;);
          