Debian Codegraph @

texmf-dist/tex/generic/tex4ht/mathplayer.4ht

raw
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 % mathplayer.4ht 2008-09-27-22:19 %
3 % Copyright (C) 2002--2008 Eitan M. Gurari %
4 % %
5 % This work may be distributed and/or modified under the %
6 % conditions of the LaTeX Project Public License, either %
7 % version 1.3 of this license or (at your option) any %
8 % later version. The latest version of this license is %
9 % in %
10 % http://www.latex-project.org/lppl.txt %
11 % and version 1.3 or later is part of all distributions %
12 % of LaTeX version 2003/12/01 or later. %
13 % %
14 % This work has the LPPL maintenance status "maintained".%
15 % %
16 % This Current Maintainer of this work %
17 % is Eitan M. Gurari. %
18 % %
19 % If you modify this program your changing its signature %
20 % with a directive of the following form will be %
21 % appreciated. %
22 % \message{signature} %
23 % %
24 % [email protected] %
25 % http://www.cse.ohio-state.edu/~gurari %
26 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
27 \immediate\write-1{version 2008-09-27-22:19}
28
29 \exit:ifnot{Preamble,%
30 color,%
31 tex4ht}
32
33 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
34 \ConfigureHinput{Preamble}
35 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36 \edef\Preamble{\Preamble,xht}
37 \Configure{ext}{xht}
38
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
40
41 \endinput\empty\empty\empty\empty\empty\empty
42 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43
44 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45 \ConfigureHinput{tex4ht}
46 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47 \Configure{DOCTYPE}
48 {\HCode{<!DOCTYPE html PUBLIC
49 "-//W3C//DTD XHTML 1.1 plus MathML 2.0//\expandafter
50 \ifx \csname a:dtd-lang\endcsname\relax EN\else
51 \csname a:dtd-lang\endcsname
52 \fi
53 "\Hnewline
54 "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd"\Hnewline
55 [\Hnewline
56 <!ENTITY \% MATHML.prefixed "INCLUDE">\Hnewline
57 <!ENTITY \% MATHML.prefix "m">\Hnewline
58 ]\Hnewline
59 >\Hnewline }}
60 \Configure{@BODY}
61 {\ifvmode \EndP\fi \IgnorePar\HCode{<script type="text/javascript">\Hnewline<!--\Hnewline
62 if( navigator.appName=="Microsoft Internet Explorer" \Hnewline
63 && navigator.platform=="Win32" \Hnewline
64 ){ \Hnewline
65 if( parseFloat(navigator.appVersion.substr( \Hnewline
66 navigator.appVersion.indexOf("MSIE ")+5))>="5.5" \Hnewline
67 ){
68 try { \Hnewline
69 var oMP = new ActiveXObject("MathPlayer.Factory.1"); \Hnewline
70 } \Hnewline
71 catch(e) { alert("Can't find Design Science's MathPalyer" + \Hnewline
72 "(http://www.dessci.com/webmath/mathplayer)");} \Hnewline
73 } else { \Hnewline
74 alert("Requires MSIE version 5.5 or later"); \Hnewline
75 } } \Hnewline
76 \Hnewline-->\Hnewline
77 </script>\Hnewline
78 }\par\ShowPar}
79 \Configure{@HTML}
80 {xmlns:m="http://www.w3.org/1998/Math/MathML"\Hnewline
81 % xmlns:dsi="http://www.dessci.com/mathml" \Hnewline
82 }
83 %\let\dsi:=\empty
84 \Configure{halignTD} {}{}
85 {<}{\ifmathml \HCode{ columnalign="left"}\else
86 \HCode{ style="text-align:left" }\fi}
87 {-}{\ifmathml \HCode{ columnalign="center"}\else
88 \HCode{ style="text-align:center" }\fi}
89 {>}{\ifmathml \HCode{ columnalign="right"}\else
90 \HCode{ style="text-align:right" }\fi}
91 {^}{\ifmathml \HCode{ rowalign="top"}\else
92 \HCode{ style="vertical-align:top" }\fi}
93 {=}{\ifmathml \HCode{ rowalign="baseline"}\else
94 \HCode{ style="vertical-align:baseline" }\fi}
95 {|}{\ifmathml \HCode{ rowalign="center"}\else
96 \HCode{ style="vertical-align:middle" }\fi}
97 {_}{\ifmathml \HCode{ rowalign="bottom"}\else
98 \HCode{ style="vertical-align:bottom" }\fi}
99 {p}{\ifmathml \HCode{ columnalign="left"}\else
100 \HCode{ style="text-align:left"}\fi}
101 {}
102 \:CheckOption{xht} \if:Option
103 \else \:CheckOption{xml} \if:Option
104 \else
105 \Configure{DviMath}
106 {\a:DviMathML \mathmltrue
107 \ifOption{mml-fonts}{}{\NoFonts}%
108 \IgnoreRule \HCode{<!--l.
109 \the\inputlineno-->}\HCode{<\a:mathml math\Hnewline}%
110 \let\sva:mathml=\a:mathml \let\a:mathml=\empty
111 %
112 \HCode{\csname a:math-xmlns\endcsname \Hnewline \a:@math>}%
113 \let\a:mathml=\sva:mathml
114 \a:math
115 \edef\sv:ignore{\if:nopar
116 \noexpand\IgnorePar\else \noexpand\ShowPar\fi}%
117 \IgnorePar}
118 {\Tg</\a:mathml math>\EndIgnoreRule
119 \ifOption{mml-fonts}{}{\EndNoFonts}%
120 \mathmlfalse \b:DviMathML \sv:ignore
121 }
122 \fi\fi
123
124 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
125
126 \endinput\empty\empty\empty\empty\empty\empty
127 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
214 \ConfigureHinput{color}
215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
216 \let\a:txt:textcolor\a:textcolor
217 \let\b:txt:textcolor\b:textcolor
218 \Configure{textcolor}
219 {\ifmathml
220 \Configure{color}%
221 {\Configure{SetHColor}
222 {\HCode{<m:mstyle color="\HColor">}}}%
223 \else \a:txt:textcolor \fi
224 }
225 {\ifmathml \HCode{</m:mstyle>}\else \b:txt:textcolor \fi}
226
227 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
228
229 \endinput\empty\empty\empty\empty\empty\empty
230 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527 \endinput
528