@@ -93,28 +93,27 @@ automatic equation numbers generated when the ``tags`` option in the
93
93
section: 1 ,
94
94
tex: {
95
95
tags: ' ams' ,
96
+ packages: {' [+]' : [' tagformat' ]},
96
97
tagformat: {
97
98
number : (n ) => MathJax .config .section + ' .' + n,
98
99
id : (tag ) => ' eqn-id:' + tag
99
100
},
100
- packages: {' [+]' : [' tagformat' ]}
101
- },
102
- loader: {load: [' [tex]/tagformat' ]},
103
- startup: {
104
- ready () {
105
- MathJax .startup .defaultReady ();
106
- MathJax .startup .input .tex .preFilters .add (({math}) => {
101
+ preFilters: [
102
+ ({math}) => {
107
103
if (math .inputData .recompile ) {
108
104
MathJax .config .section = math .inputData .recompile .section ;
109
105
}
110
- });
111
- MathJax .startup .input .tex .postFilters .add (({math}) => {
106
+ }
107
+ ],
108
+ postFilters: [
109
+ ({math}) => {
112
110
if (math .inputData .recompile ) {
113
111
math .inputData .recompile .section = MathJax .config .section ;
114
112
}
115
- });
116
- }
117
- }
113
+ }
114
+ ]
115
+ },
116
+ loader: {load: [' [tex]/tagformat' ]},
118
117
};
119
118
120
119
This arranges for automatic equation numbers to be of the form
@@ -204,7 +203,21 @@ Here is a complete example HTML document:
204
203
tagformat: {
205
204
number : (n ) => MathJax .config .section + ' .' + n,
206
205
id : (tag ) => ' eqn-id:' + tag
207
- }
206
+ },
207
+ preFilters: [
208
+ ({math}) => {
209
+ if (math .inputData .recompile ) {
210
+ MathJax .config .section = math .inputData .recompile .section ;
211
+ }
212
+ }
213
+ ],
214
+ postFilters: [
215
+ ({math}) => {
216
+ if (math .inputData .recompile ) {
217
+ math .inputData .recompile .section = MathJax .config .section ;
218
+ }
219
+ }
220
+ ]
208
221
},
209
222
loader: {load: [' [tex]/tagformat' ]},
210
223
startup: {
@@ -225,16 +238,6 @@ Here is a complete example HTML document:
225
238
' sections' , {handler: {macro: [' sections' ]}}
226
239
);
227
240
MathJax .startup .defaultReady ();
228
- MathJax .startup .input .tex .preFilters .add (({math}) => {
229
- if (math .inputData .recompile ) {
230
- MathJax .config .section = math .inputData .recompile .section ;
231
- }
232
- });
233
- MathJax .startup .input .tex .postFilters .add (({math}) => {
234
- if (math .inputData .recompile ) {
235
- math .inputData .recompile .section = MathJax .config .section ;
236
- }
237
- });
238
241
}
239
242
}
240
243
}; </script >
@@ -307,7 +310,21 @@ Here is a complete example HTML document:
307
310
tagformat: {
308
311
number: (n) => MathJax.config.section + "." + n,
309
312
id: (tag) => "eqn-id:" + tag
310
- }
313
+ },
314
+ preFilters: [
315
+ ({math}) => {
316
+ if (math.inputData.recompile) {
317
+ MathJax.config.section = math.inputData.recompile.section;
318
+ }
319
+ }
320
+ ],
321
+ postFilters: [
322
+ ({math}) => {
323
+ if (math.inputData.recompile) {
324
+ math.inputData.recompile.section = MathJax.config.section;
325
+ }
326
+ }
327
+ ]
311
328
},
312
329
loader: {load: ["[tex]/tagformat"]},
313
330
startup: {
@@ -328,16 +345,6 @@ Here is a complete example HTML document:
328
345
"sections", {handler: {macro: ["sections"]}}
329
346
);
330
347
MathJax.startup.defaultReady();
331
- MathJax.startup.input.tex.preFilters.add(({math}) => {
332
- if (math.inputData.recompile) {
333
- MathJax.config.section = math.inputData.recompile.section;
334
- }
335
- });
336
- MathJax.startup.input.tex.postFilters.add(({math}) => {
337
- if (math.inputData.recompile) {
338
- math.inputData.recompile.section = MathJax.config.section;
339
- }
340
- });
341
348
}
342
349
}
343
350
};</script>
0 commit comments