1
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
% ooffice-mml.4ht 2005-03-12-15:14 %
3
% Copyright (C) 2001--2005 Maarten Wisse %
4
% 2002--2005 James Naughton %
6
% This program can redistributed and/or modified under %
7
% the terms of the LaTeX Project Public License %
8
% Distributed from CTAN archives in directory %
9
% macros/latex/base/lppl.txt; either version 1 of the %
10
% License, or (at your option) any later version. %
12
% If you modify this program your changing its signature %
13
% with a directive of the following form will be %
15
% \message{signature} %
17
% Maarten.Wisse@urz.uni-heidelberg.de %
18
% http://home.wanadoo.nl/pmwisse %
20
% james.naughton@st-edmund-hall.oxford.ac.uk %
22
% Modified by Eitan M. Gurari 2001--2005 %
23
% gurari@cse.ohio-state.edu %
24
% http://www.cse.ohio-state.edu/~gurari %
25
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26
\immediate\write-1{version 2005-03-12-15:14}
27
\exit:ifnot{Preamble,%
35
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
36
\ConfigureHinput{Preamble}
37
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38
\Configure{mathml}{math:}
40
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
42
\endinput\empty\empty\empty\empty\empty\empty
43
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
45
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
46
\ConfigureHinput{tex4ht}
47
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
48
\Configure{math-xmlns}
50
xmlns:math="http://www.w3.org/1998/Math/MathML"
54
{\a:DviMathML \mathmltrue
55
\ifOption{mml-fonts}{}{\NoFonts}%
56
\HCode{<!--l. \the\inputlineno-->%
58
\gHAdvance\math:obj by 1
59
\NextFile{\jobname-m\math:obj
62
\HCode{<draw:object\Hnewline
64
draw:name="mobj-\math:obj"
66
text:anchor-type="as-char"
67
xlink:href="\#./\jobname-m\math:obj
71
xlink:actuate="onLoad" />%
73
\OOmanifest{<manifest:file-entry
74
manifest:media-type="text/xml"
75
manifest:full-path="\jobname-m\math:obj
76
/content.xml"/>\Hnewline
78
manifest:media-type="text/xml"
79
manifest:full-path="\jobname-m\math:obj
80
/settings.xml"/>\Hnewline
82
manifest:media-type="application/vnd.sun.xml.math"
83
manifest:full-path="\jobname-m\math:obj
87
{\HCode{<!DOCTYPE \a:mathml math PUBLIC
88
"-//OpenOffice.org//DTD Modified W3C MathML 1.01//\expandafter
89
\ifx \csname a:dtd-lang\endcsname\relax EN\else
90
\csname a:dtd-lang\endcsname
93
"math.dtd">\Hnewline}}%
94
\Configure{HTML}{}{\noindent}%
97
\edef\sv:ignore{\if:nopar
98
\noexpand\IgnorePar\else \noexpand\ShowPar\fi}%
101
\Tg<\a:mathml math\Hnewline
102
\csname a:math-xmlns\endcsname \Hnewline \a:@math>\a:math
104
{\Tg</\a:mathml math>%
105
\EndHPage{}\sv:ignore
108
\ifOption{mml-fonts}{}{\EndNoFonts}%
109
\mathmlfalse \b:DviMathML }
110
\Configure{halignTD} {}{}
111
{<}{\ifmathml \HCode{ columnalign="left"}\else
113
{-}{\ifmathml \HCode{ columnalign="center"}\else
115
{>}{\ifmathml \HCode{ columnalign="right"}\else
117
{^}{\ifmathml \HCode{ rowalign="top"}\else
119
{=}{\ifmathml \HCode{ rowalign="baseline"}\else
121
{|}{\ifmathml \HCode{ rowalign="center"}\else
123
{_}{\ifmathml \HCode{ rowalign="bottom"}\else
125
{p}{\ifmathml \HCode{ columnalign="left"}\else
127
{m}{\ifmathml\else m\fi} %{\HCode{valign-middle align-left}}
128
{b}{\ifmathml\else n\fi} %{\HCode{valign-baseline align-left}}
131
{\Configure{@math}{\a:mathml display="block"}\IgnorePar
133
\else\EndP \HCode{<!--tex4ht:inline-->}\fi
134
\HCode{<text:p text:style-name="display-math">}\DviMath}
135
{\EndDviMath\HCode{</text:p>}\ShowPar\par
136
{\csname HCondtrue\endcsname\noindent}}
138
\NewConfigureOO{display-math}
139
\ConfigureOO{display-math}
140
{<style:style style:name="display-math"
141
style:family="paragraph"
142
style:parent-style-name="Text body">\Hnewline
144
fo:text-align="center"
145
style:auto-text-indent="false"
146
style:justify-single-word="false"/>\Hnewline
147
</style:style>\Hnewline}
149
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
151
\endinput\empty\empty\empty\empty\empty\empty
152
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
157
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
158
\ConfigureHinput{latex}
159
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
161
<style:style style:name="f1"
162
style:family="graphics"
163
style:parent-style-name="Formula"
165
<style:properties style:vertical-pos="middle"
166
style:vertical-rel="text"/>\Hnewline
167
</style:style>\Hnewline}
168
\let\AllColMargins\empty
170
{\PushStack\Col:Marg\AllColMargins
171
\bgroup\Configure{$}{}{}{}}
172
{\egroup \PopStack\Col:Marg\AllColMargins}
175
{\ifmathml <\a:mathml mtr\Hnewline class="hline">
176
\else <table:table-row \Hnewline table:style-name="hline-row">%
178
{\ifmathml <\a:mathml mtd><math:mo> \string&\#x0332; </math:mo></\a:mathml mtd>
180
\else <table:table-cell table:style-name="hline-cell"
181
table:value-type="string">%
182
<text:p text:style-name="hline-p-hr" />%
183
</table:table-cell>\Hnewline
185
{\ifmathml </\a:mathml mtr>
186
\else </table:table-row>\Hnewline
189
{\ifmathml <\a:mathml mtr\Hnewline class="cline">
190
\else <table:table-row \Hnewline table:style-name="cline-row">\Hnewline
192
{\ifmathml <\a:mathml mtd></\a:mathml mtd>
193
\else <table:table-cell table:style-name="cline-cell">%
194
<text:p text:style-name="cline-p" />%
195
</table:table-cell>\Hnewline
197
{\ifmathml <\a:mathml mtd><math:mo> \string&\#x0332; </math:mo></\a:mathml mtd>
199
\else <table:table-cell table:style-name="cline-cell">%
200
<text:p text:style-name="cline-p-hr" />%
201
</table:table-cell>\Hnewline
203
{\ifmathml </\a:mathml mtr>
204
\else </table:table-row>\Hnewline
207
{\ifmathml <\a:mathml mtr\Hnewline class="vspace" style="font-size:\HBorderspace">
208
\else <tr\Hnewline class="vspace" style="font-size:\HBorderspace">%
210
{\ifmathml <\a:mathml mtd\Hnewline></\a:mathml mtd>
211
\else <td\Hnewline>\string </td>%
213
{\ifmathml </\a:mathml mtr>
218
{\IgnorePar\ifvmode\else \HCode{<!--tex4ht:inline-->}\fi
219
\EndP \HCode{<table:table table:style-name="equation">%
220
<table:table-column table:style-name="equ-col" />\Hnewline
221
<table:table-column table:style-name="equ-num-col" />\Hnewline
223
<table:table-cell table:style-name="equ-cell">%
224
<text:p text:style-name="equ-p">}%
227
{\Configure{@math}{}\IgnorePar\EndP\DviMath}
228
{\EndDviMath\EndP}{}%
231
{\ifvmode \IgnorePar\fi\EndP
232
\HCode{</text:p></table:table-cell>\Hnewline
233
<table:table-cell table:style-name="equ-num-cell">%
234
<text:p text:style-name="equ-num-p">}%
236
{\HCode{</text:p></table:table-cell>\Hnewline
237
</table:table-row></table:table>}%
238
\ShowPar\par{\HCondtrue\noindent}%
244
style:family="paragraph"
245
style:parent-style-name="Standard">\Hnewline
247
fo:text-align="center"
248
style:justify-single-word="false"/>\Hnewline
249
</style:style>\Hnewline
253
style:name="equ-num-p"
254
style:family="paragraph"
255
style:parent-style-name="Standard">\Hnewline
258
style:justify-single-word="false"/>\Hnewline
259
</style:style>\Hnewline
262
<style:style style:name="equation"
263
style:family="table">\Hnewline
265
style:rel-width="88\%"
267
fo:margin-right="0cm"
268
fo:margin-top="0.3cm"
269
fo:margin-bottom="0.3cm"
270
table:align="margins"/>\Hnewline
271
</style:style>\Hnewline
274
{\Configure{@math}{\a:mathml display="block"}\IgnorePar
276
\else\EndP \HCode{<!--tex4ht:inline-->}\fi
277
\HCode{<text:p text:style-name="display-math">}\DviMath$$\DisplayMathtrue}
278
{$$\EndDviMath\HCode{</text:p>}\ShowPar\par
279
{\csname HCondtrue\endcsname\noindent}}
282
{\ifmtext \ht:special{t4ht@,}%
283
\HCode{</\a:mathml mtext><\a:mathml
284
mtext class="newline">}%
285
\ht:special{t4ht@,&\#x00A0;}%
287
\else \HCode{<text:line-break/>}\fi}
288
\def\:nbsp{\ifmtext \leavevmode\special{t4ht@+\string&{35}x00A0;}x%
290
\Tg<\a:mathml mspace />\else \ht:special{t4ht=<text:s/>}%
293
{\bgroup\ifmathml \HCode{<\a:mathml mover accent="false"\Hnewline
294
\mml:class="mml-overline"><\a:mathml mrow>}%
296
\HCode{<text:span text:style-name="overline">}\fi}
297
{\ifmathml \HCode{</\a:mathml mrow><\a:mathml mo\Hnewline
298
accent="true">&\#x00AF;</\a:mathml mo>%
300
\else \HCode{</text:span>}\fi\egroup}
301
\Configure{underline}
303
\ifmathml \HCode{<\a:mathml munder \a:mathml accentunder="false"\Hnewline
304
\mml:class="mml-underline"><\a:mathml mrow>}%
306
\else \expandafter\everymath
307
\expandafter{\expandafter\everymath
308
\expandafter{\the\everymath}}%
309
\let\o::@underline:\o:@@underline:
310
\def\o:@@underline:{\let\o:@@underline:\o::@underline:}%
311
\HCode{<text:span text:style-name="underline">}\fi}
312
{\ifmathml \HCode{</\a:mathml mrow><\a:mathml mo\Hnewline
313
accent="true">&\#x0332;</\a:mathml mo></\a:mathml munder>}%
314
\else \HCode{</text:span>}\fi \egroup}
317
{\HCode{<\a:mathml mrow><\a:mathml mo>\expandafter
318
\ifx \csname \string#1:lr del\endcsname\relax #1\else
319
\csname \string#1:lr del\endcsname\fi
320
</\a:mathml mo\space><\a:mathml mrow>}}
322
{\HCode{</\a:mathml mrow><\a:mathml mo>\expandafter
323
\ifx \csname \string#1:lr del\endcsname\relax #1\else
324
\csname \string#1:lr del\endcsname\fi
326
{\HCode{</\a:mathml mrow>}}
329
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
331
\endinput\empty\empty\empty\empty\empty\empty
332
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
356
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
357
\ConfigureHinput{amsmath}
358
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
360
{\ifvmode \IgnorePar\fi\EndP
361
\HCode{<table:table table:style-name="equation">%
362
<table:table-column table:style-name="equ-col" />\Hnewline
363
<table:table-column table:style-name="equ-num-col" />\Hnewline
365
<table:table-cell table:style-name="equ-cell">%
366
<text:p text:style-name="equ-p">}%
369
{\HCode{<\a:mathml mtable\Hnewline
370
class="equation"><\a:mathml mtr><\a:mathml mtd>}\IgnorePar
372
{\HCode{</\a:mathml mtd></\a:mathml mtr></\a:mathml mtable>}}
375
{\ifnum\HCol=2 \IgnorePar
376
\HCode{</\a:mathml mtd><\a:mathml mtd>}\fi }
380
{\Configure{@math}{}\IgnorePar\EndP\DviMath}
381
{\EndDviMath\EndP}{}%
384
{\ifvmode \IgnorePar\fi\EndP \HCode{</text:p></table:table-cell>\Hnewline
385
<table:table-cell table:style-name="equ-num-cell">%
386
<text:p text:style-name="equ-num-p">}%
388
{\ifvmode \IgnorePar\fi\EndP \HCode{</text:p></table:table-cell>\Hnewline
389
</table:table-row></table:table>}%
391
\ShowPar\par{\HCondtrue\noindent}%
394
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
396
\endinput\empty\empty\empty\empty\empty\empty
397
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
407
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
408
\ConfigureHinput{plain}
409
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
412
{\HCode{<\a:mathml mrow><\a:mathml mo>\expandafter
413
\ifx \csname \string#1:lr del\endcsname\relax #1\else
414
\csname \string#1:lr del\endcsname\fi
415
</\a:mathml mo\space><\a:mathml mrow>}}
417
{\HCode{</\a:mathml mrow><\a:mathml mo>\expandafter
418
\ifx \csname \string#1:lr del\endcsname\relax #1\else
419
\csname \string#1:lr del\endcsname\fi
421
{\HCode{</\a:mathml mrow>}}
424
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
426
\endinput\empty\empty\empty\empty\empty\empty
427
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
438
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
439
\ConfigureHinput{array}
440
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
441
\let\AllColMargins\empty
443
{\PushStack\Col:Marg\AllColMargins
444
\bgroup\Configure{$}{}{}{}}
445
{\egroup \PopStack\Col:Marg\AllColMargins}
448
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
450
\endinput\empty\empty\empty\empty\empty\empty
451
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
511
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
512
\ConfigureHinput{rlbabel}
513
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
515
{\Configure{@math}{\a:mathml display="block"}\IgnorePar
517
\else\EndP \HCode{<!--tex4ht:inline-->}\fi
518
\HCode{<text:p text:style-name="display-math">}\DviMath$$\DisplayMathtrue}
519
{$$\EndDviMath\HCode{</text:p>}\ShowPar\par
520
{\csname HCondtrue\endcsname\noindent}}
523
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
525
\endinput\empty\empty\empty\empty\empty\empty
526
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%