www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 141081d5435933846d69adefdb96ebcab943cffe
parent 0533da5ab9317c519f6b6407525ca5d0a489fbf9
Author: Georges Dupéron <georges.duperon@gmail.com>
Date:   Tue, 18 Jul 2017 12:30:51 +0200

Fixed size of pre-rendered math, it is now near-identical to the fully-rendered math (± a pixel due to the differing rendering methods).

Diffstat:
Mrun-mathjax-offline.node.js | 2+-
Mscribblings/util.rkt | 10+++++-----
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/run-mathjax-offline.node.js b/run-mathjax-offline.node.js @@ -71,7 +71,7 @@ jsdom.env('doc/phc-thesis/index.html', function(err, window) { } }; // Fix the font size (mathjax-node cannot know easily the webpage's font size in advance). - var patchFontSizeCode = "(function() { var outer = document.createElement('div'); outer.style.width = '0px'; outer.style.height = '0px'; outer.style.overflow = 'hidden'; var d = document.createElement('div'); d.style.width = '2260ex'; outer.appendChild(d); document.body.appendChild(outer); window.setTimeout(function() { var sz = d.clientWidth / 1000; document.body.removeChild(outer); if (sz > 3) { var st = document.createElement('style'); st.appendChild(document.createTextNode('html .mjx-chtml { font-size: '+sz+'px; } html .mjx-chtml .mjx-chtml { font-size: inherit; }')); document.head.appendChild(st); } }, 0)})();"; + var patchFontSizeCode = "(function() { var outer = document.createElement('div'); outer.style.width = '0px'; outer.style.height = '0px'; outer.style.overflow = 'hidden'; var d = document.createElement('div'); /* 1.18rem from scribble's stylesheet, times 118% in the MathJax-generated CSS. */ outer.style.fontSize = (1.18 * 1.18) + 'rem'; d.style.width = '1000em'; outer.appendChild(d); document.body.appendChild(outer); window.setTimeout(function() { var sz = d.clientWidth / 1000; document.body.removeChild(outer); if (sz > 3) { var st = document.createElement('style'); st.appendChild(document.createTextNode('html .mjx-chtml { font-size: '+sz+'px; } html .mjx-chtml .mjx-chtml { font-size: inherit; }')); document.head.appendChild(st); } }, 0)})();"; var patchFontSize = window.document.createElement('script'); patchFontSize.appendChild(window.document.createTextNode(patchFontSizeCode)); patchFontSize.setAttribute('type', 'text/javascript'); diff --git a/scribblings/util.rkt b/scribblings/util.rkt @@ -171,14 +171,14 @@ EOTEX ) (elem #:style (style #f (list (css-addition - #".NoteBox { - height: auto !important; + #"html .NoteBox { + height: auto; clear: right; - margin-bottom: 1em !important; + margin-bottom: 1em; } -.MathJax_Display { - margin: 2em 0 !important; +html .MathJax_Display, html div.MathJax_Preview { + margin: 2em 0; }")))))) (define my-title ;; TODO: use this for the other wrapped procs in this file