Skip to content

Commit 41f7747

Browse files
committed
Set MathJax.Hub.processSectionDelay to 0 to fix jumping behavior in MathJax 2.5+
Fixes #3006
1 parent b0628b0 commit 41f7747

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/lib/svg_text_utils.js

+12
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,19 @@ function texToSVG(_texString, _config, _callback) {
166166

167167
var originalRenderer,
168168
originalConfig,
169+
originalProcessSectionDelay,
169170
tmpDiv;
171+
170172
MathJax.Hub.Queue(
171173
function() {
172174
originalConfig = Lib.extendDeepAll({}, MathJax.Hub.config);
175+
176+
originalProcessSectionDelay = MathJax.Hub.processSectionDelay;
177+
if(MathJax.Hub.processSectionDelay !== undefined) {
178+
// MathJax 3.5+
179+
MathJax.Hub.processSectionDelay = 0;
180+
}
181+
173182
return MathJax.Hub.Config({
174183
messageStyle: 'none',
175184
displayAlign: 'left',
@@ -212,6 +221,9 @@ function texToSVG(_texString, _config, _callback) {
212221
}
213222
},
214223
function() {
224+
if (originalProcessSectionDelay !== undefined) {
225+
MathJax.Hub.processSectionDelay = originalProcessSectionDelay;
226+
}
215227
return MathJax.Hub.Config(originalConfig);
216228
});
217229
}

0 commit comments

Comments
 (0)