Commit c3e72cf
committed
fix(export): correct wkhtmltopdf MathJax sizing with minScale floor
wkhtmltopdf's old headless Qt-4 WebKit mis-measures the surrounding
text's ex-height, so MathJax shrinks each equation to its minScale
floor (0.5). The previous fix blindly multiplied by a magic scale of
2.5, which combined with that floor over-enlarged math to ~1.25x the
surrounding text.
Replace the magic 2.5 with a root-cause fix: raise MathJax's SVG
minScale floor to 1.0 so math cannot be shrunk below text size, and
drop scale back to its default. Scoped to the wkhtmltopdf export path
only; on-screen preview and the Qt WebEngine printToPdf path are
behaviorally unchanged (they emit the -1 sentinel and fall back to
MathJax's default 0.5).
- Plumb a new mathJaxMinScale global option exactly like mathJaxScale
(MarkdownWebGlobalOptions + MarkdownParas, both generateMarkdownViewer
Template copies, and toJavascriptObject()).
- mathjax.js: honor window.vxOptions.mathJaxMinScale, defaulting to
MathJax's documented 0.5 when absent (sentinel -1).
- webviewexporter: set mathJaxMinScale = 1.0 for wkhtmltopdf and -1
otherwise; set mathJaxScale = -1 (removing the 2.5).1 parent 11ad2cc commit c3e72cf
5 files changed
Lines changed: 17 additions & 3 deletions
File tree
- src
- core
- data/extra/web/js
- export
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
214 | 215 | | |
215 | 216 | | |
216 | 217 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
| 58 | + | |
58 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
59 | 63 | | |
60 | 64 | | |
61 | 65 | | |
| |||
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
| 90 | + | |
| 91 | + | |
86 | 92 | | |
87 | 93 | | |
88 | 94 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| 204 | + | |
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
| |||
478 | 479 | | |
479 | 480 | | |
480 | 481 | | |
481 | | - | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
482 | 487 | | |
483 | 488 | | |
484 | 489 | | |
| |||
0 commit comments