Debian Codegraph @

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

raw
1 % $Id: tex4ht-mathplayer.tex 65 2010-11-17 19:16:45Z karl $
2 % compile 3 times: latex tex4ht-mathplayer
3 % or xhlatex tex4ht-mathplayer "html,3,sections+"
4 %
5 % Copyright (C) 2009-2010 TeX Users Group
6 % Copyright (C) 1997-2009 Eitan M. Gurari
7 % Released under LPPL 1.3c+.
8 % See tex4ht-cpright.tex for license text.
9
10 %%%%%%%%%%%%%%%%%% load style files %%%%%%%%%%%%%%%%%%%%%%%%%%
11
12 \ifx \HTML\UnDef
13 \def\HTML{mathplayer}
14 \def\CONFIG{\jobname}
15 \def\MAKETITLE{\author{Eitan M. Gurari}}
16 \def\next{\input mktex4ht.4ht \endinput}
17 \expandafter\next
18 \fi
19
20 \input{common}
21 \input{tex4ht-cpright}
22
23 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
24 \chapter{Preamble}
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26
27 \<mathplayer\><<<
28 % mathplayer.4ht (|version), generated from |jobname.tex
29 % Copyright (C) 2009-2010 TeX Users Group
30 % Copyright (C) |CopyYear.2002. Eitan M. Gurari
31 |<TeX4ht copywrite|>
32 >>>
33
34 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
35 \chapter{Start Here}
36 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37
38 %%%%%%%%%%%%%%%%%
39 \section{Header}
40 %%%%%%%%%%%%%%%%
41
42 \<configure mathplayer Preamble\><<<
43 \edef\Preamble{\Preamble,xht}
44 \Configure{ext}{xht}
45 >>>
46
47 % \Configure{mathml}{m:}
48
49
50 \<dtd lang\><<<
51 \expandafter
52 \ifx \csname a:dtd-lang\endcsname\relax EN\else
53 \csname a:dtd-lang\endcsname
54 \fi
55 >>>
56
57 \<configure mathplayer tex4ht\><<<
58 \Configure{DOCTYPE}
59 {\HCode{<!DOCTYPE html PUBLIC
60 "-//W3C//DTD XHTML 1.1 plus MathML 2.0//|<dtd lang|>"\Hnewline
61 "http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd"\Hnewline
62 [\Hnewline
63 <!ENTITY \% MATHML.prefixed "INCLUDE">\Hnewline
64 <!ENTITY \% MATHML.prefix "m">\Hnewline
65 ]\Hnewline
66 >\Hnewline }}
67 \Configure{@BODY}
68 {\ifvmode \EndP\fi \IgnorePar\HCode{<script type="text/javascript">\Hnewline<!--\Hnewline
69 |<check for ie 5.5 and mathplayer|>\Hnewline-->\Hnewline
70 </script>\Hnewline
71 }\par\ShowPar}
72 \Configure{@HTML}
73 {xmlns:m="http://www.w3.org/1998/Math/MathML"\Hnewline
74 % xmlns:dsi="http://www.dessci.com/mathml" \Hnewline
75 }
76 %\let\dsi:=\empty
77 >>>
78
79
80 application/xhtml+xml
81
82
83
84 \<check for ie 5.5 and mathplayer\><<<
85 if( navigator.appName=="Microsoft Internet Explorer" \Hnewline
86 && navigator.platform=="Win32" \Hnewline
87 ){ \Hnewline
88 if( parseFloat(navigator.appVersion.substr( \Hnewline
89 navigator.appVersion.indexOf("MSIE ")+5))>="5.5" \Hnewline
90 ){
91 try { \Hnewline
92 var oMP = new ActiveXObject("MathPlayer.Factory.1"); \Hnewline
93 } \Hnewline
94 catch(e) { alert("Can't find Design Science's MathPalyer" + \Hnewline
95 "(http://www.dessci.com/webmath/mathplayer)");} \Hnewline
96 } else { \Hnewline
97 alert("Requires MSIE version 5.5 or later"); \Hnewline
98 } } \Hnewline
99 >>>
100
101 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
102 \section{Wrapping in Tables}
103 %%%%%%%%%%%%%%%%%%%%%%%%%%%%
104
105 The attribute \verb+nowrap="nowrap"+ in table cells prevents
106 Mathplayer from displaying them its own way, and one gets minimal
107 cells, overlapped: it ought to be avoided altogether.
108
109 \<configure mathplayer tex4ht\><<<
110 \Configure{halignTD} {}{}
111 {<}{\ifmathml \HCode{ columnalign="left"}\else
112 \HCode{ style="text-align:left" }\fi}
113 {-}{\ifmathml \HCode{ columnalign="center"}\else
114 \HCode{ style="text-align:center" }\fi}
115 {>}{\ifmathml \HCode{ columnalign="right"}\else
116 \HCode{ style="text-align:right" }\fi}
117 {^}{\ifmathml \HCode{ rowalign="top"}\else
118 \HCode{ style="vertical-align:top" }\fi}
119 {=}{\ifmathml \HCode{ rowalign="baseline"}\else
120 \HCode{ style="vertical-align:baseline" }\fi}
121 {||}{\ifmathml \HCode{ rowalign="center"}\else
122 \HCode{ style="vertical-align:middle" }\fi}
123 {_}{\ifmathml \HCode{ rowalign="bottom"}\else
124 \HCode{ style="vertical-align:bottom" }\fi}
125 {p}{\ifmathml \HCode{ columnalign="left"}\else
126 \HCode{ style="text-align:left"}\fi}
127 {}
128 >>>
129
130
131
132
133
134
135
136 % %%%%%%%%%%%%%%%%%%%%%
137 % \section{Cross References}
138 % %%%%%%%%%%%%%%%%%%%%%
139
140 %
141
142 %
143
144 % \<configure mathplayer tex4htNO\><<<
145 % \LinkCommand\mtxt:link{\a:mathml maction,%
146 % actiontype="link" \dsi: href, id,
147 % class="label"|<mtext ref decoration|>,,}
148 % \LinkCommand\msp:link{\a:mathml maction,%
149 % actiontype="link" \dsi: href, id,
150 % class="label"|<mstyle ref decoration|>,,}
151 % \def\Link{\ifmathml
152 % \ifmtext |<end mtext|>\HCode{</\a:mathml mtext>}%
153 % \expandafter\expandafter\expandafter\mtxt:link
154 % \else \expandafter\expandafter\expandafter\msp:link\fi
155 % \else \expandafter\M:Link\fi}
156 % \def\EndLink{\ifmathml
157 % \ifmtext |<end mtext|>|<end mtext ref decoration|>%
158 % \Endmtxt:link \HCode{<\a:mathml mtext\Hnewline
159 % class="endlabel">}|<start mtext|>%
160 % \else \HCode{|<end mstyle ref decoration|></\a:mathml
161 % maction><!--endlabel-->}\fi
162 % \else \expandafter\M:EndLink\fi}
163 % >>>
164
165 %
166
167 %
168
169 %
170
171 %
172
173 %
174
175 %
176 % \<mtext ref decorationNO\><<<
177 % ><\a:mathml mtext mathbackground="yellow"%
178 % >>>
179
180 % \<end mtext ref decorationNO\><<<
181 % \HCode{</\a:mathml mtext>}%
182 % >>>
183
184 % \<mstyle ref decorationNO\><<<
185 % ><\a:mathml mstyle mathbackground="yellow"%
186 % >>>
187
188 % \<end mstyle ref decorationNO\><<<
189 % </\a:mathml mstyle>%
190 % >>>
191
192 %
193 % \begin{verbatim}
194 % JUST BACKGROUND (one could add colour, and it would be fine to include the
195 % labels, if any)
196 % <m:mstyle \a:mathml mathbackground="yellow"> <m:maction
197 % actiontype="link" \dsi: href="#x1-2r1" class="label"><m:mrow
198 % ><m:mn>1</m:mn><!--tex4ht:ref: equ1 --></m:mrow></m:maction></m:mstyle >
199
200 % HIGHLIGHT ON MOUSEOVER
201 % <m:maction
202 % actiontype="highlight" \dsi: color="pink" ><m:maction
203 % actiontype="link" \dsi: href="#x1-2r1" class="label"><m:mtext
204 % background="yellow" >1<!--tex4ht:ref:
205 % equ1 --></m:mtext></m:maction></m:maction>
206
207 % TOOLTIP CLUE ON MOUSEOVER
208 % <m:mrow>
209 % <m:maction actiontype="tooltip" ><m:maction
210 % actiontype="link" \dsi: href="#x1-2r1" class="label"><m:mrow ><m:mn
211 % background="yellow" >1</m:mn></m:mrow></m:maction>
212 % <m:mtext>click to jump!</m:mtext>
213 % <!--tex4ht:ref: equ1 --></m:maction><!--endlabel--></m:mrow>
214
215 % * <m:mtext m:mathbackground="yellow" > disables background colour in all
216 % the (math-)links - this one coming from a typo in mathplayer.4ht, inserting
217 % m: before mathbackground;
218
219 % m: also problematic on actiontype
220 % \end{verbatim}
221
222 % \<start mtext\><<<
223 % \ht:special{t4ht@,&\#x00A0;}%
224 % >>>
225 % \<end mtext\><<<
226 % \ht:special{t4ht@,}%
227 % >>>
228
229 %
230
231 % The area of the clickable links can be enlarged with a cpde similar to
232 % the following one.
233
234 % \begin{verbatim}
235 % \let\svLink=\Link
236 % \let\svEndLink=\EndLink
237 % \Odef\Link[#1]#2#3{%
238 % \svLink[#1]{#2}{#3}%
239 % \ifmathml\ifmtext\else \HCode{<m:mpadded width="4">}\fi\fi}
240 % \def\EndLink{%
241 % \ifmathml\ifmtext\else \HCode{</m:mpadded>}\fi\fi
242 % \svEndLink}
243 % \end{verbatim}
244
245
246 %%%%%%%%%%%%%%%%%%
247 \section{Namespace Prefixes}
248 %%%%%%%%%%%%%%%%%%
249
250 \<configure mathplayer tex4ht\><<<
251 \:CheckOption{xht} \if:Option
252 \else \:CheckOption{xml} \if:Option
253 \else
254 \Configure{DviMath}
255 {\a:DviMathML \mathmltrue
256 \ifOption{mml-fonts}{}{|%\mml:htfsym|%\NoFonts}%
257 \IgnoreRule \HCode{<!--l.
258 \the\inputlineno-->}\HCode{<\a:mathml math\Hnewline}%
259 |<disable a:mathml for math attr|>%
260 \HCode{\csname a:math-xmlns\endcsname \Hnewline \a:@math>}%
261 |<end disable a:mathml for math attr|>\a:math
262 |<sv dvimath par|>\IgnorePar}
263 {\Tg</\a:mathml math>\EndIgnoreRule
264 \ifOption{mml-fonts}{}{|%\ext:htfsym|%\EndNoFonts}%
265 \mathmlfalse \b:DviMathML |<recall dvimath par|>}
266 \fi\fi
267 >>>
268
269
270 \<recall dvimath par\><<<
271 \sv:ignore
272 >>>
273
274 \<sv dvimath par\><<<
275 \edef\sv:ignore{\if:nopar
276 \noexpand\IgnorePar\else \noexpand\ShowPar\fi}%
277 >>>
278
279 \<disable a:mathml for math attr\><<<
280 \let\sva:mathml=\a:mathml \let\a:mathml=\empty
281 >>>
282
283 \<end disable a:mathml for math attr\><<<
284 \let\a:mathml=\sva:mathml
285 >>>
286
287
288 %%%%%%%%%%%%%%%%%%
289 \section{Color}
290 %%%%%%%%%%%%%%%%%%
291
292 \<configure mathplayer color\><<<
293 \let\a:txt:textcolor\a:textcolor
294 \let\b:txt:textcolor\b:textcolor
295 \Configure{textcolor}
296 {\ifmathml
297 \Configure{color}%
298 {\Configure{SetHColor}
299 {\HCode{<m:mstyle color="\HColor">}}}%
300 \else \a:txt:textcolor \fi
301 }
302 {\ifmathml \HCode{</m:mstyle>}\else \b:txt:textcolor \fi}
303 >>>
304
305
306 \endinput