Debian Codegraph @

texmf-dist/source/generic/tex4ht/tex4ht-jsmath.tex

raw
1 % $Id: tex4ht-jsmath.tex 77 2011-01-28 11:45:59Z cvr $
2 % compile 3 times: latex tex4ht-jsmath
3 % or xhlatex tex4ht-jsmath "html,3,sections+"
4 %
5 % Copyright (C) 2009-2010 TeX Users Group
6 % Copyright (C) 2005-2009 Eitan M. Gurari
7 % Released under LPPL 1.3c+.
8 % See tex4ht-cpright.tex for license text.
9 %
10 % CDATA support:
11 % http://planetmath.org/encyclopedia/
12 %
13 % <script type="text/javascript">
14 % //<![CDATA[
15 % jsMath.Macro( 'ab', '{#1}_{\\mathrm{ab}}', 1)
16 % //]]>
17 % </script><script type="text/javascript">
18 % //<![CDATA[
19 % jsMath.Macro( 'Ad', '\\mathrm{Ad}', 0)
20 % //]]>
21 % </script><script type="text/javascript">
22 % //<![CDATA[
23 % jsMath.Macro( 'ad', '\\mathrm{ad}', 0)
24 % //]]>
25
26 \ifx \HTML\UnDef
27 \def\HTML{jsmath,html-jsmath}
28 \def\CONFIG{\jobname}
29 \def\MAKETITLE{\author{Eitan M. Gurari}}
30 \def\next{\input mktex4ht.4ht \endinput}
31 \expandafter\next
32 \fi
33
34 \input{common-code}
35 \input{common}
36 \input{tex4ht-cpright}
37
38
39 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
40 \chapter{Constructs}
41 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42
43
44
45 \<jsmath\><<<
46 % jsmath.4ht (|version), generated from |jobname.tex
47 % Copyright (C) 2009-2010 TeX Users Group
48 % Copyright (C) |CopyYear.2005. Eitan M. Gurari
49 |<TeX4ht copywrite|>
50 >>>
51
52 \<html-jsmath\><<<
53 % html-jsmath.4ht (|version), generated from |jobname.tex
54 % Copyright (C) 2009-2010 TeX Users Group
55 % Copyright (C) |CopyYear.2006. Eitan M. Gurari
56 |<TeX4ht copywrite|>
57 >>>
58
59
60 \<configure html-jsmath tex4ht\><<<
61 \Configure{VERSION}{}
62 >>>
63
64
65 \<configure jsmath tex4ht\><<<
66 \NewConfigure{jsmath}{1}
67 \ifOption{easy-load}{%
68 \Configure{jsmath}{jsMath/easy/load.js}%
69 }{%
70 \Log:Note{The `easy-load' command line option offers
71 an alternative loading approach of
72 jsMath version 3.4 or above}%
73 \Configure{jsmath}{jsMath/jsMath.js}%
74 }
75 >>>
76
77 % CVR: 2011-01-28
78
79 Rob Beezer \texttt{<[email protected]>} reported parse errors triggered
80 by xtpipes when jsmath compatible html pages are generated. Hence the
81 \verb=\Hcode{<!--l. \the\inputlineno-->}= has been commented out. Also
82 commented out is \verb= |<recall dvimath par|>= which would insert a
83 \verb=\sv:ignore= macro at the end of the \verb=DViMath=
84 configuration.
85
86
87 \<configure html-jsmath tex4ht\><<<
88 \Configure{DviMath}
89 {\a:DviJsmath \mathltxtrue
90 \ifOption{mml-fonts}{}{|%\mml:htfsym|%\NoFonts}%
91 \IgnoreRule
92 % \HCode{<!--l. \the\inputlineno-->}
93 \ifx \a:@math\empty\else
94 \Tg<\a:@math\space class="math"\Hnewline >\fi
95 \a:math
96 |<sv dvimath par|>\IgnorePar}
97 {\ifx \a:@math\empty\else \Tg</\a:@math>\fi \EndIgnoreRule
98 \ifOption{mml-fonts}{}{|%\ext:htfsym|%\EndNoFonts}%
99 \mathltxfalse \After:Math \b:DviJsmath % |%recall dvimath par|%
100 }
101 \NewConfigure{DviJsmath}{2}
102 >>>
103
104
105
106 \<defs for jsmath\><<<
107 jsMath.Macro('firstOfOne','\#1',1)
108 >>>
109
110
111
112 \<end mtext space\><<<
113 \ht:special{t4ht@,}%
114 >>>
115
116 \<start mtext space\><<<
117 \ht:special{t4ht@,&\#x00A0;}%
118 >>>
119
120 Changes to fix bugs reported by Rob Beezer's
121 \texttt{<[email protected]>}: Values of \verb=\@math= in the
122 configurations of \verb=$= and \verb=$$= have been changed from
123 \verb=span= and \verb=div= to \verb=\dlr= and \verb=\dlr\dlr=
124 respectively. \verb=\dlr= will expand to \verb=$= character which is
125 needed by jsMath. Removed \verb=|<inline end-par comment|>= after
126 \verb=IgnorePar= in the configuration for \verb=$$=.
127
128
129 \<configure jsmath tex4ht\><<<
130 \def\dlr{\expandafter\@gobble\string\$}
131 \Configure{$}
132 {\Configure{@math}{\dlr}\DviMath}
133 {\EndDviMath}{}
134 \Configure{$$}
135 {\Configure{@math}{\dlr\dlr}\IgnorePar
136 \EndP\DviMath}
137 {\EndDviMath
138 \ShowPar\par{\csname HCondtrue\endcsname\noindent}}
139 {\DisplayMathtrue}
140 >>>
141
142 \<recall dvimath par\><<<
143 \sv:ignore
144 >>>
145
146 \<sv dvimath par\><<<
147 \edef\sv:ignore{\if:nopar
148 \noexpand\IgnorePar\else \noexpand\ShowPar\fi}%
149 >>>
150
151 \<configure html-jsmath tex4ht\><<<
152 \Configure{@HEAD}{|<load jsmath|>}
153 \Configure{@BODY}
154 {\ifvmode \IgnorePar\fi \EndP\HCode{%
155 |<window opening|>%
156 |<load jsmath warning|>%
157 }\par\ShowPar}
158 \ifOption{easy-load}{}{%
159 \Configure{@/BODY}{%
160 \par\IgnorePar\EndP
161 \HCode{
162 <script type="text/javascript" >\Hnewline
163 jsMath.Process();\Hnewline
164 </script>
165 }\par}%
166 }
167 \Configure{!BODY}{ class="tex2math_ignore" }
168 >>>
169
170
171
172 \<load jsmath\><<<
173 \HCode{<script
174 type="text/javascript"
175 src="\a:jsmath"></script>\Hnewline
176 <script type="text/javascript">|<defs for jsmath|></script>\Hnewline}
177 >>>
178
179 \<load jsmath warning\><<<
180 <noscript> \Hnewline
181 <div style="color:\#CC0000; text-align:center"> \Hnewline
182 <b>Warning: <a href="http://www.math.union.edu/locate/jsMath">jsMath</a> \Hnewline
183 requires JavaScript to process the mathematics on this page.<br /> \Hnewline
184 If your browser supports JavaScript, be sure it is enabled.</b> \Hnewline
185 </div> \Hnewline
186 <hr /> \Hnewline
187 </noscript>\Hnewline
188 >>>
189
190
191
192 %%%%%%%%%%%%%
193 \subsection{Links}
194 %%%%%%%%%%%%%
195
196
197
198
199 \<configure jsmath tex4ht\><<<
200 \def\Hbrakets<#1>{\ifmathltx
201 \ifmtext @(#1)\else \string\hbox{@(#1)}\fi
202 \else <#1>\fi}
203 \def\EndLink{\ifmathltx
204 \ifmtext |<end mtext space|>%
205 \egroup \HCode{\%\Hnewline\%}\Endmtxt:link
206 \HCode{\string\end{ref}\Hnewline}|<start mtext space|>%
207 \else \HCode{\Hbrakets</a>}\fi
208 \else \expandafter\M:EndLink\fi}
209 \LinkCommand\msp:link{a, href, id, \mml:class="label",,}
210 >>>
211
212 \<configure jsmath tex4ht\><<<
213 \def\Link{\M:Link}
214 \def\EndLink{\M:EndLink}
215 >>>
216
217
218 ``The contents of an \verb=\hbox{}= are not rendered by jsMath, but
219 instead are used as plain text in the browser. JsMath allows you to
220 include HTML commands through the (rather awkward) means of using
221 @(...) in place of \verb=<...>=. For example, \verb=\hbox{@(tt)=
222 monospaced \verb=text@(/tt)= would get the enclosed text in the TT font.''
223 The above also holds for \verb=\text= instead of \verb=\hbox=.
224
225
226
227 %%%%%%%%%%%%%
228 \subsection{Core}
229 %%%%%%%%%%%%%
230
231
232
233 \<configure jsmath tex4ht\><<<
234 \Configure{over}
235 {\Send{GROUP}{0}{\l:brace\space}}
236 {\HCode{\string\over\space}\Send{EndGROUP}{0}{\r:brace\space}}
237 \Configure{atop}
238 {\Send{GROUP}{0}{\l:brace\space}}
239 {\HCode{\string\atop\space}\Send{EndGROUP}{0}{\r:brace\space}}
240 >>>
241
242
243
244
245 %%%%%%%%%%%%%%%%%%
246 \section{LaTeX}
247 %%%%%%%%%%%%%%%%%%
248
249 \marginpar{Anchors need fixing}
250
251 \<configure jsmath latex\><<<
252 \def\set:label#1{\ifmathltx
253 % \HCode{\%\Hnewline\%\string\begin{label}}%
254 % {\ht:special{t4ht@, }\let\:newlnch\space \mathltxfalse #1}%
255 % \HCode{\string\end{label}\Hnewline}%
256 \else #1\fi
257 }
258 >>>
259
260
261
262
263 \<configure jsmath latex\><<<
264 \Configure{frac}
265 {\HCode{\l:brace}}
266 {\HCode{\string\over\space}\Configure{over}{}{}}
267 {}
268 {\HCode{\r:brace}}
269 >>>
270
271
272
273
274
275 \<configure jsmath latex\><<<
276 \Configure{[]}
277 {\Configure{@math}{div}\csname a:mathltx[]\endcsname
278 \DviMath$$\DisplayMathtrue }
279 {$$\EndDviMath\csname b:mathltx[]\endcsname}
280 \Configure{()}
281 {\Configure{@math}{span}\csname a:mathltx()\endcsname
282 \DviMath$}
283 {$\EndDviMath\csname b:mathltx()\endcsname}
284 >>>
285
286
287 \<configure jsmath fontmath\><<<
288 \Configure{mfenced}{\langle}{\string\langle\space}
289 \Configure{mfenced}{\rangle}{\string\rangle\space}
290 \def\:tempc{\HCode{\string\langle\space}}
291 \HLet\langle\:tempc
292 \def\:tempc{\HCode{\string\rangle\space}}
293 \HLet\rangle\:tempc
294 \def\:tempc{\HCode{\string\vert\space}}
295 \HLet\vert\:tempc
296 \def\:tempc{\HCode{\string\Vert\space}}
297 \HLet\Vert\:tempc
298 \def\:tempc{\HCode{\string\||}}
299 \HLet\||\:tempc
300 \def\:tempc{\HCode{\string\big\space}}
301 \HLet\big\:tempc
302 \def\:tempc{\HCode{\string\bigg\space}}
303 \HLet\bigg\:tempc
304 \def\:tempc{\HCode{\string\Big\space}}
305 \HLet\Big\:tempc
306 \def\:tempc{\HCode{\string\Bigg\space}}
307 \HLet\Bigg\:tempc
308 >>>
309
310
311
312 \<configure jsmath array\><<<
313 |<config array|>
314 >>>
315
316 \<configure jsmath latex\><<<
317 |<config array|>
318 >>>
319
320 \<config array\><<<
321 \Configure{array}
322 {%\expandafter\tmp:toks\expandafter{\Clr}%
323 \HCode{\string\array\l:brace\Hnewline}}
324 {\ifvmode \IgnorePar\fi \HCode{\r:brace}}
325 {\ifnum \HRow> 1\HCode{\string\cr\Hnewline}\fi}
326 {}
327 {|<mtd array|>}
328 {}
329 >>>
330
331
332 \<configure jsmath latex\><<<
333 \Configure{emph}
334 {\ifmmode \Configure{@mtext}{\string\mathit}\fi}
335 {}%
336 >>>
337
338 %%%%%%%%%%%%%%%%%%
339 \section{AMS Math}
340 %%%%%%%%%%%%%%%%%%
341
342 \<configure jsmath amsmath\><<<
343 \expandafter\def\csname genfrac \endcsname#1#2#3#4{%
344 \def\:tempa{#1}\ifx\:tempa\empty\else \HCode{\string\left}#1\fi
345 \def\:tempa{#2}\ifx\:tempa\empty\else \def\:tempa{\HCode{\string\right}#2}\fi
346 \edef\@tempb{\@nx\@genfrac\@mathstyle{#4}%
347 \expandafter\noexpand\csname @@\ifx @#3@over\else above\fi
348 \endcsname}%
349 \@tempb{#3}}
350 \def\:tempc#1#2#3#4#5{{\a:genfrac#1\b:genfrac{\c:genfrac#4#2#3\relax
351 {\d:genfrac#5\e:genfrac}}\f:genfrac}\:tempa}
352 \HLet\@genfrac\:tempc
353 >>>
354
355
356 \<configure html-jsmath amsmath\><<<
357 \ifx \mathdisplay@@pop\:UnDef
358 \ifx \emdf@La\:UnDef
359 |<amsmath html-jsmath pre 2000|>
360 \else
361 |<amsmath html-jsmath jan 2000|>
362 \fi
363 \else
364 |<amsmath html-jsmath july 2000|>
365 \fi
366 >>>
367
368
369 \<configure html-jsmath amsmath\><<<
370 \Configure{equation$$}
371 {\Configure{$$}
372 {\IgnorePar \Configure{@math}{div}\EndP\DviMath}
373 {\EndDviMath\EndP}
374 {\DisplayMathtrue}%
375 }
376 >>>
377
378 \<configure jsmath amsmath\><<<
379 \Configure{tmspace}
380 {\HCode{\string\kern \space \textspace\space}}
381 \def\lvert{\HCode{\string\vert\space}}
382 \def\rvert{\HCode{\string\vert\space}}
383 \def\lVert{\HCode{\string\Vert\space}}
384 \def\rVert{\HCode{\string\Vert\space}}
385 >>>
386
387 % CVR: 2011-01-28
388
389 Changes to fix bugs reported by Rob Beezer's
390 \texttt{<[email protected]>}: Configuration for \verb=\intertext=
391 introduced.
392
393 \<configure jsmath amsmath\><<<
394 \Configure{intertext}
395 {\IgnorePar %\ifinalign@
396 \HCode{\string\cr }%
397 \AA:text{intertext}}
398 {\BB:text \ifvmode \IgnorePar \fi %\EndP
399 \HCode{\string\cr }}
400 >>>
401
402 \<configure jsmath amsmath\><<<
403 \ConfigureEnv{multline}
404 {\bgroup \Configure{$$}
405 {\Configure{@math}{}\IgnorePar \EndP\DviMath }
406 {\EndDviMath\ShowPar\csname par\endcsname
407 {\csname HCondtrue\endcsname\noindent}}
408 {\DisplayMathtrue}%
409 } {\egroup}
410 {}{}
411 \Configure{multline}
412 {\HCode{<table class="multline"><tr><td><span class="math">}}
413 {\HCode{</span></td></tr></table>}}
414 {\ifnum \HRow> 1\HCode{</span></td></tr>\Hnewline
415 <tr><td><span class="math">}\fi}
416 {\gdef\mult:amp{\gdef\mult:amp{\HCode{</span></td>
417 <td class="eq-no"><span class="math">}}}}
418 {\csname mult:amp\endcsname \HCode{\ifnum 1<\HMultispan
419 % \string\multicolumn\l:brace\HMultispan\r:brace
420 %\string\multispan
421 ?span/multispan-in-jsmath?
422 \space\HMultispan\space
423 \fi}%
424 } {}
425 \Css{table.multline td {text-align:left;
426 vertical-align:middle; padding-left: 2em; }}
427 \Css{table.multline td.eq-no { text-align:center; }}
428 \Css{table.multline { width:100\%; }}
429 >>>
430
431 \<configure jsmath amsmathNO\><<<
432 \ConfigureEnv{multline}
433 {\bgroup |<display math-|>} {\egroup}
434 {}{}
435 \Configure{multline}
436 {\HCode{\string\begin\l:brace array\r:brace
437 \l:brace lp{10mm}r\r:brace}}
438 {\HCode{\string\end \l:brace array\r:brace}}
439 {\ifnum \HRow> 1\HCode{\string\\\space}\qquad\fi}
440 {\gdef\mult:amp{\gdef\mult:amp{\HCode{\a:math:amp}\qquad}}}
441 {\csname mult:amp\endcsname \HCode{\ifnum 1<\HMultispan
442 % \string\multicolumn\l:brace\HMultispan\r:brace
443 |<multi span|> \space\HMultispan\space
444 \fi}%
445 } {}
446 >>>
447
448 \<configure jsmath amsmath\><<<
449 \ConfigureEnv{multline*}
450 {\bgroup |<display math-|>} {\egroup}
451 {}{}
452 \Configure{multline*}
453 {\HCode{\string\begin\l:brace array\r:brace
454 \l:brace lr\r:brace}}
455 {\HCode{\string\end \l:brace array\r:brace}}
456 {\ifnum \HRow> 1\HCode{\string\\\Hnewline}\fi}
457 {}
458 >>>
459
460
461 \<display math-\><<<
462 \Configure{$$}
463 {\Configure{@math}{div}\IgnorePar
464 \EndP\DviMath }
465 {\EndDviMath\ShowPar\csname par\endcsname
466 {\csname HCondtrue\endcsname\noindent}}
467 {\DisplayMathtrue}%
468 >>>
469
470
471
472 \<configure jsmath amsmath\><<<
473 \Configure{subarray}
474 {\HCode{\string\begin\l:brace array\r:brace
475 \l:brace \Hlcr\r:brace}}
476 {\HCode{\string\end \l:brace array\r:brace}}
477 {\ifnum \HRow> 1\HCode{\string\\\Hnewline}\fi} {}
478 \Configure{smallmatrix}
479 {\HCode{\string\begin\l:brace matrix\r:brace}}
480 {\HCode{\string\end \l:brace matrix\r:brace}}
481 {\ifnum \HRow> 1\HCode{\string\\\Hnewline}\fi} {}
482 {\HCode{\ifnum \HCol>1 \a:math:amp\fi \scriptstyle
483 \ifnum 1<\HMultispan
484 % \string\multicolumn\l:brace\HMultispan\r:brace
485 |<multi span|> \space\HMultispan\space
486 \fi}%
487 } {}
488 >>>
489
490
491
492
493
494
495
496
497 \<configure jsmath amsmath\><<<
498 \Configure{aligned}
499 {\HCode{\string\begin\l:brace array\r:brace
500 \l:brace rlrlrl\r:brace}}
501 {\HCode{\string\end \l:brace array\r:brace}}
502 {}
503 {\HCode{\string\cr\space}}
504 {}
505 {\HCode{\a:math:amp\space}}
506 \Configure{alignedat}
507 {\HCode{\string\begin\l:brace array\r:brace
508 \l:brace rlrl\r:brace}}
509 {\HCode{\string\end \l:brace array\r:brace}}
510 {}
511 {\HCode{\string\cr\space}}
512 {}
513 {\HCode{\a:math:amp\space}}
514 >>>
515
516
517
518
519
520
521
522
523
524
525
526
527 \<amsmath html-jsmath july 2000\><<<
528 \Configure{equation}
529 {\ifvmode \IgnorePar\fi\EndP
530 \HCode{<table class="equation"><tr><td>}%
531 |<amsmath equation july 2000|>%
532 |<math display in amsmath equation|>%
533 }
534 {\ifvmode \IgnorePar\fi\EndP
535 \HCode{</td><td class="eq-no">}%
536 }
537 {\ifvmode \IgnorePar\fi\EndP \HCode{</td></tr></table>}%
538 \ShowPar\IgnoreIndent\par}
539 \Configure{equation*}
540 {\ifvmode \IgnorePar\fi\EndP
541 \HCode{<table class="equation-star"><tr><td>}%
542 |<amsmath equation* july 2000|>%
543 |<math display in amsmath equation|>%
544 }
545 {\ifvmode \IgnorePar\fi\EndP \HCode{</td></tr></table>}%
546 \ShowPar\IgnoreIndent\par}
547 >>>
548
549
550 \<math display in amsmath equation\><<<
551 \csname a:equation\string$\string$\endcsname
552 >>>
553
554
555
556 \<amsmath equation july 2000\><<<
557 \Configure{gather}
558 {\HCode{\string\begin\l:brace array\r:brace
559 \l:brace lp{10mm}r\r:brace}\IgnorePar
560 |<math display in equation|>}
561 {\HCode{\string\end\l:brace array\r:brace}}
562 {}
563 {}
564 {\ifnum\HCol=2 \IgnorePar
565 \HCode{\a:math:amp}\fi }
566 {}
567 >>>
568
569
570 \<amsmath equation* july 2000\><<<
571 \Configure{gather*}
572 {\HCode{\string\begin\l:brace array\r:brace
573 \l:brace lp{10mm}r\r:brace}\IgnorePar
574 |<math display in equation|>}
575 {\HCode{\string\end\l:brace array\r:brace}}
576 {}
577 {}
578 {\ifnum\HCol=2 \IgnorePar
579 \HCode{\a:math:amp}\fi }
580 {}
581 >>>
582
583
584
585
586 \<configure jsmath amsmath\><<<
587 \Configure{split}
588 {\HCode{\string\begin\l:brace array\r:brace
589 \l:brace rl\r:brace}}
590 {\ifvmode\IgnorePar\fi
591 \HCode{\string\end \l:brace array\r:brace}}
592 {\ifnum \HRow> 1\HCode{\string\\\Hnewline}\fi} {}
593 {|<mtd array|>} {}
594 >>>
595
596
597 \<configure jsmath tex4ht\><<<
598 \Configure{math:amp}{\string&amp;}
599 >>>
600
601
602
603 \<mtd array\><<<
604 \HCode{\ifnum \HCol>1 \a:math:amp\fi
605 \ifnum 1<\HMultispan
606 % \string\multicolumn\l:brace\HMultispan\r:brace
607 |<multi span|> \space\HMultispan\space
608 \fi}%
609 >>>
610
611 \<multi span\><<<
612 %\string\multispan
613 ?span/multispan-in-jsmath?
614 >>>
615
616
617 \<configure jsmath amsmath\><<<
618 \ConfigureEnv{gather}
619 {\bgroup |<display math-|>} {\egroup}
620 {}{}
621 \Configure{gather}
622 {\HCode{\string\begin\l:brace array\r:brace
623 \l:brace cl\r:brace}}
624 {\HCode{\string\end \l:brace array\r:brace}}
625 {\ifnum \HRow> 1\HCode{\string\\\Hnewline}\fi} {}
626 {|<mtd array|>} {}
627 \ConfigureEnv{gather*}
628 {\bgroup |<display math-|>} {\egroup}
629 {}{}
630 \Configure{gather*}
631 {\HCode{\string\begin\l:brace array\r:brace
632 \l:brace cl\r:brace}}
633 {\HCode{\string\end \l:brace array\r:brace}}
634 {\ifnum \HRow> 1\HCode{\string\\\Hnewline}\fi} {}
635 {|<mtd array|>} {}
636 >>>
637
638 % CVR 2011-01-28
639
640 \verb=\HtmlParOff= added to \verb=\Configure{#1}=.
641 \verb=\HCode{<--tex4ht:inline-->}= commented out as it interfered with
642 parsing. \verb=\HtmlParOn= added after \verb=\end:mathalign=. Before
643 cell and after cell configurations have been rewritten to solve the
644 problems reported by Rob Beezer's \texttt{<[email protected]>}.
645
646 % \<configure jsmath amsmath\><<<
647 % \def\:tempc#1#2{%
648 % \ConfigureEnv{#1}
649 % {\def\end:al:env{}\ifmmode\else
650 % \ifvmode\else \def\end:al:env{\par\ShowPar\IgnoreIndent}
651 % \fi\fi}
652 % {\end:al:env }
653 % {}{}%
654 % \Configure{#1}
655 % {\IgnorePar\HtmlParOff
656 % \ifvmode \EndP \else \EndP\fi
657 % \ifmathltx
658 % \Tg<mrow>\def\end:mathalign{\Tg</mrow>}%
659 % \else
660 % \Configure{@math}{div}\DviMath
661 % \def\end:mathalign{\EndDviMath \DisplayMathfalse}%
662 % \DisplayMathtrue
663 % \fi
664 % \HCode{\string\matrix\l:brace}}
665 % {\HCode{\r:brace}\end:mathalign\HtmlParOn}
666 % {\ifnum \HRow> 1\HCode{\string\cr\Hnewline}\fi}
667 % {}
668 % {\HCode{\ifnum \HCol>1 \a:math:amp\fi
669 % \ifnum 1<\HMultispan
670 % ?span/multispan-in-jsmath?
671 % \space\HMultispan\space\fi}}%
672 % {} %
673 % }
674 % \:tempc{align}{align}
675 % \:tempc{alignat}{alignat}
676 % \:tempc{xalignat}{xalignat}
677 % \:tempc{xxalignat}{xxalignat}
678 % \:tempc{flalign}{flalign}
679 % \:tempc{align*}{align*}
680 % \:tempc{alignat*}{alignat*}
681 % \:tempc{xalignat*}{xalignat*}
682 % \:tempc{flalign*}{flalign*}
683 % >>>
684
685
686 jsMath doesn't support hfil... hence the following
687
688 \<extra align col sep\><<<
689 \ifodd\HCol\space\else
690 \string\kern \space 2em\space
691 \fi
692 >>>
693
694 Yet another venue through eqalign
695
696 \<configure jsmath amsmath\><<<
697 \def\:tempc#1#2{%
698 \ConfigureEnv{#1}
699 {\def\end:al:env{}\ifmmode\else
700 \ifvmode\else \def\end:al:env{\par\ShowPar\IgnoreIndent}
701 \fi\fi}
702 {\end:al:env }
703 {}{}%
704 \Configure{#1}
705 {\IgnorePar\HtmlParOff
706 \ifvmode \EndP \else \EndP \fi
707 \ifmathltx
708 \Tg<mrow>\def\end:mathalign{\Tg</mrow>}%
709 \else
710 \Configure{@math}{div}\DviMath
711 \def\end:mathalign{\EndDviMath \DisplayMathfalse}%
712 \DisplayMathtrue
713 \fi
714 \HCode{\string\eqalignno\l:brace}}
715 {\HCode{\r:brace}\end:mathalign\HtmlParOn}
716 {\ifnum \HRow> 1\HCode{\string\cr\Hnewline}\fi}
717 {}
718 {\HCode{\ifnum \HCol>1 \a:math:amp\fi
719 \ifnum 1<\HMultispan
720 ?span/multispan-in-jsmath?
721 \space\HMultispan\space\fi}}%
722 {} %
723 }
724 \:tempc{align}{align}
725 \:tempc{alignat}{alignat}
726 \:tempc{xalignat}{xalignat}
727 \:tempc{xxalignat}{xxalignat}
728 \:tempc{flalign}{flalign}
729 \:tempc{align*}{align*}
730 \:tempc{alignat*}{alignat*}
731 \:tempc{xalignat*}{xalignat*}
732 \:tempc{flalign*}{flalign*}
733 >>>
734
735 %%%%%%%%%%%%%%%%%%
736 \section{Over and Under}
737 %%%%%%%%%%%%%%%%%%
738
739
740 \<configure jsmath fontmath\><<<
741 |<jsmath plain,fontmath|>
742 >>>
743
744 \<configure jsmath plain\><<<
745 |<jsmath plain,fontmath|>
746 >>>
747
748
749 \<jsmath plain,fontmath\><<<
750 \Configure{overrightarrow}
751 {\HCode{\string\overrightarrow\l:brace}\:gobble}
752 {\HCode{\r:brace}}
753 \Configure{overleftarrow}
754 {\HCode{\string\overleftarrow\l:brace}\:gobble}
755 {\HCode{\r:brace}}
756 >>>
757
758
759 \<configure jsmath amsmath\><<<
760 \Configure{underrightarrow}
761 {\HCode{\string\mathop\l:brace}\:gobble}
762 {\HCode{\r:brace\string\limits
763 \string_\string\longrightarrow\space}}
764 \Configure{underleftarrow}
765 {\HCode{\string\mathop\l:brace}\:gobble}
766 {\HCode{\r:brace\string\limits
767 \string_\string\longleftarrow\space}}
768 >>>
769
770
771
772 \<configure jsmath amsmath\><<<
773 \Configure{overleftrightarrow}
774 {\HCode{\string\mathop\l:brace}\:gobble}
775 {\HCode{\r:brace\string\limits
776 \string^\string\longleftrightarrow\space}}
777 \Configure{underleftrightarrow}
778 {\HCode{\string\mathop\l:brace}\:gobble}
779 {\HCode{\r:brace\string\limits
780 \string_\string\longleftrightarrow\space}}
781 >>>
782
783 \<configure jsmath amsmath\><<<
784 \def\:tempc#1{
785 {\HCode{\string\mathop\l:brace}#1%
786 \HCode{\r:brace\string\limits
787 \string^\l:brace\hbox\l:brace....\r:brace\r:brace}}}
788 \HLet\ddddot\:tempc
789 \def\:tempc#1{
790 {\HCode{\string\mathop\l:brace}#1%
791 \HCode{\r:brace\string\limits
792 \string^\l:brace\hbox\l:brace...\r:brace\r:brace}}}
793 \HLet\dddot\:tempc
794 >>>
795
796
797 \<configure jsmath amsmath\><<<
798 \def\:tempc#1#2{%
799 \HCode{\string\mathop\l:brace}#2%
800 \HCode{\r:brace\string\limits
801 \string^\l:brace}#1\HCode{\r:brace}}
802 \HLet\overset\:tempc
803 \def\:tempc#1#2{%
804 \HCode{\string\mathop\l:brace}#2%
805 \HCode{\r:brace\string\limits
806 \string_\l:brace}#1\HCode{\r:brace}}
807 \HLet\underset\:tempc
808 \def\:tempc#1#2#3{%
809 \HCode{\l:brace\l:brace\r:brace}#1%
810 \HCode{\l:brace}#3%
811 \HCode{\r:brace}#2\HCode{\r:brace}}
812 \HLet\sideset\:tempc
813 >>>
814
815
816
817 \<configure jsmath amsmath\><<<
818 \renewcommand{\xrightarrow}[2][]{%
819 \HCode{\string\mathop\l:brace \string\longrightarrow \r:brace\string\limits
820 \string_\l:brace}#1\HCode{\r:brace\string^\l:brace}%
821 #2\HCode{\r:brace}}
822 \renewcommand{\xleftarrow}[2][]{%
823 \HCode{\string\mathop\l:brace \string\longleftarrow \r:brace\string\limits
824 \string_\l:brace}#1\HCode{\r:brace\string^\l:brace}%
825 #2\HCode{\r:brace}}
826 >>>
827
828
829 The following definition is needed because \verb=\multispan= is not recognized by jsMath
830
831
832 \<configure jsmath amsmath\><<<
833 \def\hdots@for#1#2{%
834 \tmp:cnt=#2\relax
835 \ifnum \tmp:cnt>0 .%
836 \loop
837 \advance\tmp:cnt by -1\relax
838 \ifnum \tmp:cnt>0 \HCode{\string&amp;}.%
839 \repeat
840 \fi
841 }
842 >>>
843
844 %%%%%%%%%%%%%%%%%%
845 \section{Symbols}
846 %%%%%%%%%%%%%%%%%%
847
848
849 \<configure jsmath amsmath\><<<
850 \def\:tempc#1{\HCode{\kern18mu
851 {\string\rm\space mod}\string\,\string\,}#1}
852 \HLet\mod=\:tempc
853 \def\:tempc#1{\HCode{\kern18mu }(#1)}
854 \HLet\pod=\:tempc
855 \def\:tempc#1{\HCode{\kern18mu
856 \string\mathbin{\string\rm\space mod}\string\,\string\,}#1}
857 \HLet\bmod\:tempc
858 \def\:tempc#1{\HCode{\kern18mu }(\HCode{{\string\rm\space mod}\kern6mu\space} #1)}
859 \HLet\pmod=\:tempc
860 >>>
861
862
863
864
865 %%%%%%%%%%%%%%%%%%
866 \section{Boxed}
867 %%%%%%%%%%%%%%%%%%
868
869 \<configure html-jsmath amsmath\><<<
870 \Configure{boxed}
871 {\ifmathltx \HCode{\string\class\l:brace boxed\r:brace\l:brace}%
872 \else \HCode{<span class="boxed">}\IgnorePar\fi}
873 {\ifmathltx \HCode{\r:brace}%
874 \else \HCode{</span>}\fi}
875 \Css{.boxed{border: 1px solid black; padding-left:2px;
876 padding-right:2px;}}
877 >>>
878
879
880
881
882
883 \<configure html-jsmath amsmath\><<<
884 \Configure{boxed}
885 {\ifmathltx \HCode{\string\class\l:brace boxed\r:brace\l:brace}%
886 \else \HCode{<span class="boxed">}\IgnorePar\fi}
887 {\ifmathltx \HCode{\r:brace}%
888 \else \HCode{</span>}\fi}
889 \Css{.boxed{border: 1px solid black; padding-left:2px;
890 padding-right:2px;}}
891 >>>
892
893
894
895 %%%%%%%%%%%%%%%%%%
896 \endinput
897 %%%%%%%%%%%%%%%%%%
898
899