1
% compile 3 timws: latex tex4ht-mathplayer
2
% or xhlatex tex4ht-mathplayer "html,3,sections+"
4
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
5
% tex4ht-mathplayer.tex %
6
% Copyright (C) 2002-- Eitan M. Gurari %
8
% This work may be distributed and/or modified under the %
9
% conditions of the LaTeX Project Public License, either %
10
% version 1.3 of this license or (at your option) any %
11
% later version. The latest version of this license is %
13
% http://www.latex-project.org/lppl.txt %
14
% and version 1.3 or later is part of all distributions %
15
% of LaTeX version 2003/12/01 or later. %
17
% This work has the LPPL maintenance status "maintained".%
19
% This Current Maintainer of this work %
20
% is Eitan M. Gurari. %
22
% If you modify this file your changing the signature %
23
% in \message{(signature)} below will be appreciated. %
25
% gurari@cse.ohio-state.edu %
26
% http://www.cse.ohio-state.edu/~gurari %
27
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28
\message{(<signature>)}
30
%%%%%%%%%%%%%%%%%% load style files %%%%%%%%%%%%%%%%%%%%%%%%%%
35
\def\MAKETITLE{\author{Eitan M. Gurari}}
36
\def\next{\input mktex4ht.4ht \endinput}
40
%%%%%%%%%%%%%%%%%%%%% definitions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42
\newcount\tmpcnt \tmpcnt\time \divide\tmpcnt 60
43
\edef\temp{\the\tmpcnt}
44
\multiply\tmpcnt -60 \advance\tmpcnt \time
46
\edef\version{\the\year-\ifnum \month<10 0\fi
47
\the\month-\ifnum \day<10 0\fi\the\day
48
-\ifnum \temp<10 0\fi \temp
49
:\ifnum \tmpcnt<10 0\fi\the\tmpcnt}
52
\ifnum #1=\year #1\space\space\space\space\space\space
53
\else #1--\the\year\fi
56
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
58
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
61
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
62
% mathplayer.4ht |version %
63
% Copyright (C) |CopyYear.2002. Eitan M. Gurari %
69
\<TeX4ht copyright\><<<
71
% This work may be distributed and/or modified under the %
72
% conditions of the LaTeX Project Public License, either %
73
% version 1.3 of this license or (at your option) any %
74
% later version. The latest version of this license is %
76
% http://www.latex-project.org/lppl.txt %
77
% and version 1.3 or later is part of all distributions %
78
% of LaTeX version 2003/12/01 or later. %
80
% This work has the LPPL maintenance status "maintained".%
82
% This Current Maintainer of this work %
83
% is Eitan M. Gurari. %
85
% If you modify this program your changing its signature %
86
% with a directive of the following form will be %
88
% \message{signature} %
90
% gurari@cse.ohio-state.edu %
91
% http://www.cse.ohio-state.edu/~gurari %
92
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
93
\immediate\write-1{version |version}
97
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
99
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
105
\<configure mathplayer Preamble\><<<
106
\:CheckOption{xht} \if:Option
107
\Configure{html}{xht}
108
\else \:CheckOption{xml} \if:Option
109
\Configure{html}{xml}
111
\Configure{html}{html}
112
\Configure{mathml}{m:}
119
\ifx \csname a:dtd-lang\endcsname\relax EN\else
120
\csname a:dtd-lang\endcsname
124
\<configure mathplayer tex4ht\><<<
125
\Configure{VERSION}{}
126
\:CheckOption{xht} \if:Option
127
|<DOCTYPE and namespaces for xml and xht|>
128
\else \:CheckOption{xml} \if:Option
129
|<DOCTYPE and namespaces for xml and xht|>
132
{\HCode{<!DOCTYPE html PUBLIC
133
"-//W3C//DTD XHTML 1.1 plus MathML 2.0//|<dtd lang|>"\Hnewline
134
% "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd"\Hnewline
135
"http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd"\Hnewline
138
{xmlns:m="http://www.w3.org/1998/Math/MathML"\Hnewline
139
xmlns:dsi="http://www.dessci.com/mathml" \Hnewline}
142
<object id="MathPlayer"
143
classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987"
145
<?import namespace="m" implementation="\#MathPlayer" ?>\Hnewline
146
<!--http://www.dessci.com/webmath/mathplayer/-->\Hnewline
149
{\HCode{<script language="javascript">\Hnewline<!--\Hnewline
150
|<check for ie 5.5 and mathplayer|>\Hnewline-->\Hnewline
153
\Configure{math-xmlns}{}
157
\<DOCTYPE and namespaces for xml and xht\><<<
159
{\HCode{<!DOCTYPE html PUBLIC
160
"-//W3C//DTD XHTML 1.1 plus MathML 2.0//|<dtd lang|>"\Hnewline
161
"http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd"\Hnewline
162
% "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd"\Hnewline
163
% [<!ENTITY mathml "http://www.w3.org/1998/Math/MathML">]\Hnewline
166
{xmlns:dsi="http://www.dessci.com/mathml" \Hnewline}
170
\<configure mathplayer tex4ht\><<<
171
\:CheckOption{xht} \if:Option
172
\else \:CheckOption{xml} \if:Option
175
{\Configure{@math}{display="inline"}\DviMath}
176
{\EndDviMath\HCode{<span></span>}}{}
180
Without the extra span mathplayer overlaps the table entries.
184
\<check for ie 5.5 and mathplayer\><<<
185
if( navigator.appName=="Microsoft Internet Explorer" \Hnewline
186
&& navigator.platform=="Win32" \Hnewline
187
&& parseFloat(navigator.appVersion.substr( \Hnewline
188
navigator.appVersion.indexOf("MSIE ")+5))>="5.5" \Hnewline
191
var oMP = new ActiveXObject("MathPlayer.Factory.1"); \Hnewline
193
catch(e) { alert("Can't find Design Science's MathPalyer" + \Hnewline
194
"(http://www.dessci.com/webmath/mathplayer)");} \Hnewline
196
alert("Requires MSIE version 5.5 or later"); \Hnewline
200
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
201
\section{Wrapping in Tables}
202
%%%%%%%%%%%%%%%%%%%%%%%%%%%%
204
The attribute \verb+nowrap="nowrap"+ in table cells prevents
205
Mathplayer from displaying them its own way, and one gets minimal
206
cells, overlapped: it ought to be avoided altogether.
208
\<configure mathplayer tex4ht\><<<
209
\Configure{halignTD} {}{}
210
{<}{\ifmathml \HCode{ columnalign="left"}\else
211
\HCode{ align="left" }\fi}
212
{-}{\ifmathml \HCode{ columnalign="center"}\else
213
\HCode{ align="center" }\fi}
214
{>}{\ifmathml \HCode{ columnalign="right"}\else
215
\HCode{ align="right" }\fi}
216
{^}{\ifmathml \HCode{ rowalign="top"}\else
217
\HCode{ valign="top" }\fi}
218
{=}{\ifmathml \HCode{ rowalign="baseline"}\else
219
\HCode{ valign="baseline" }\fi}
220
{||}{\ifmathml \HCode{ rowalign="center"}\else
221
\HCode{ valign="middle" }\fi}
222
{_}{\ifmathml \HCode{ rowalign="bottom"}\else
223
\HCode{ valign="bottom" }\fi}
224
{p}{\ifmathml \HCode{ columnalign="left"}\else
225
\HCode{ align="left"}\fi}
235
%%%%%%%%%%%%%%%%%%%%%
236
\section{Cross References}
237
%%%%%%%%%%%%%%%%%%%%%
240
\<configure mathplayer tex4ht\><<<
241
\LinkCommand\mtxt:link{\a:mathml maction,%
242
actiontype="link" dsi:href, id,
243
\a:mathml class="label"|<mtext ref decoration|>,,}
244
\LinkCommand\msp:link{\a:mathml maction,%
245
actiontype="link" dsi:href, id,
246
\a:mathml class="label"|<mstyle ref decoration|>,,}
248
\ifmtext |<end mtext|>\HCode{</\a:mathml mtext>}%
249
\expandafter\expandafter\expandafter\mtxt:link
250
\else \expandafter\expandafter\expandafter\msp:link\fi
251
\else \expandafter\M:Link\fi}
252
\def\EndLink{\ifmathml
253
\ifmtext |<end mtext|>|<end mtext ref decoration|>%
254
\Endmtxt:link \HCode{<\a:mathml mtext\Hnewline
255
\a:mathml class="endlabel">}|<start mtext|>%
256
\else \HCode{|<end mstyle ref decoration|></\a:mathml
257
maction><!--endlabel-->}\fi
258
\else \expandafter\M:EndLink\fi}
261
\<mtext ref decoration\><<<
262
><\a:mathml mtext mathbackground="yellow"%
265
\<end mtext ref decoration\><<<
266
\HCode{</\a:mathml mtext>}%
269
\<mstyle ref decoration\><<<
270
><\a:mathml mstyle mathbackground="yellow"%
273
\<end mstyle ref decoration\><<<
279
JUST BACKGROUND (one could add colour, and it would be fine to include the
281
<m:mstyle \a:mathml mathbackground="yellow"> <m:maction
282
actiontype="link" dsi:href="#x1-2r1" class="label"><m:mrow
283
><m:mn>1</m:mn><!--tex4ht:ref: equ1 --></m:mrow></m:maction></m:mstyle >
285
HIGHLIGHT ON MOUSEOVER
287
actiontype="highlight" dsi:color="pink" ><m:maction
288
actiontype="link" dsi:href="#x1-2r1" class="label"><m:mtext
289
background="yellow" >1<!--tex4ht:ref:
290
equ1 --></m:mtext></m:maction></m:maction>
292
TOOLTIP CLUE ON MOUSEOVER
294
<m:maction actiontype="tooltip" ><m:maction
295
actiontype="link" dsi:href="#x1-2r1" class="label"><m:mrow ><m:mn
296
background="yellow" >1</m:mn></m:mrow></m:maction>
297
<m:mtext>click to jump!</m:mtext>
298
<!--tex4ht:ref: equ1 --></m:maction><!--endlabel--></m:mrow>
300
* <m:mtext m:mathbackground="yellow" > disables background colour in all
301
the (math-)links - this one coming from a typo in mathplayer.4ht, inserting
302
m: before mathbackground;
304
m: also problematic on actiontype
308
\ht:special{t4ht@,&\#x00A0;}%
316
The area of the clickable links can be enlarged with a cpde similar to
321
\let\svEndLink=\EndLink
324
\ifmathml\ifmtext\else \HCode{<m:mpadded width="4">}\fi\fi}
326
\ifmathml\ifmtext\else \HCode{</m:mpadded>}\fi\fi
332
\section{Namespace Prefixes}
335
\<configure mathplayer tex4ht\><<<
336
\:CheckOption{xht} \if:Option
337
\else \:CheckOption{xml} \if:Option
340
{\a:DviMathML \mathmltrue
341
\ifOption{mml-fonts}{}{|%\mml:htfsym|%\NoFonts}%
342
\IgnoreRule \HCode{<!--l.
343
\the\inputlineno-->}\HCode{<\a:mathml math\Hnewline}%
344
|<disable a:mathml for math attr|>%
345
\HCode{\csname a:math-xmlns\endcsname \Hnewline \a:@math>}%
346
|<end disable a:mathml for math attr|>\a:math
347
|<sv dvimath par|>\IgnorePar}
348
{\Tg</\a:mathml math>\EndIgnoreRule
349
\ifOption{mml-fonts}{}{|%\ext:htfsym|%\EndNoFonts}%
350
\mathmlfalse \b:DviMathML |<recall dvimath par|>}
355
\<recall dvimath par\><<<
359
\<sv dvimath par\><<<
360
\edef\sv:ignore{\if:nopar
361
\noexpand\IgnorePar\else \noexpand\ShowPar\fi}%
364
\<disable a:mathml for math attr\><<<
365
\let\sva:mathml=\a:mathml \let\a:mathml=\empty
368
\<end disable a:mathml for math attr\><<<
369
\let\a:mathml=\sva:mathml