diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/tex4ht/ooffice-mml.4ht')
-rw-r--r-- | Master/texmf-dist/tex/generic/tex4ht/ooffice-mml.4ht | 405 |
1 files changed, 354 insertions, 51 deletions
diff --git a/Master/texmf-dist/tex/generic/tex4ht/ooffice-mml.4ht b/Master/texmf-dist/tex/generic/tex4ht/ooffice-mml.4ht index 73627fb2a0d..40a86539baa 100644 --- a/Master/texmf-dist/tex/generic/tex4ht/ooffice-mml.4ht +++ b/Master/texmf-dist/tex/generic/tex4ht/ooffice-mml.4ht @@ -1,6 +1,6 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% ooffice-mml.4ht 2005-10-22-10:51 % -% Copyright (C) 2001--2005 Maarten Wisse % +% ooffice-mml.4ht 2006-12-04-15:27 % +% Copyright (C) 2001--2006 Maarten Wisse % % James Naughton % % Eitan M. Gurari % % % @@ -31,7 +31,7 @@ % gurari@cse.ohio-state.edu % % http://www.cse.ohio-state.edu/~gurari % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\immediate\write-1{version 2005-10-22-10:51} +\immediate\write-1{version 2006-12-04-15:27} \exit:ifnot{Preamble,% amsmath,% array,% @@ -55,9 +55,11 @@ tex4ht} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \Configure{math-xmlns} { - xmlns:math="http://www.w3.org/1998/Math/MathML" + xmlns:math="http://www.w3.org/1998/Math/MathML"\Hnewline + xmlns:xlink="http://www.w3.org/1999/xlink" } -\HAssign\math:obj=0 +\:CheckOption{oo1}\if:Option + \HAssign\math:obj=0 \Configure{DviMath} {\a:DviMathML \mathmltrue \ifOption{mml-fonts}{}{\NoFonts}% @@ -91,14 +93,70 @@ tex4ht} manifest:full-path="\jobname-m\math:obj /"/> }% - \Configure{DOCTYPE} - {\HCode{<!DOCTYPE \a:mathml math PUBLIC - "-//OpenOffice.org//DTD Modified W3C MathML 1.01//\expandafter + \:CheckOption{oo1}\if:Option + \Configure{DOCTYPE}{\HCode{<!DOCTYPE \a:mathml math PUBLIC + "-//OpenOffice.org//DTD Modified W3C MathML 1.01//\expandafter \ifx \csname a:dtd-lang\endcsname\relax EN\else \csname a:dtd-lang\endcsname \fi " - "math.dtd">\Hnewline}}% + "math.dtd">\Hnewline} +}% +\else + \Configure{DOCTYPE}{\HCode{<!DOCTYPE \a:mathml math PUBLIC + "-//W3C//DTD MathML 2.0//\expandafter +\ifx \csname a:dtd-lang\endcsname\relax EN\else + \csname a:dtd-lang\endcsname +\fi +" + "math.dtd">\Hnewline} +}% +\fi +\:CheckOption{-xttl} \if:Option + \Log:Note{Use the `-xttl' command line option to + avoid xttl post processing} +\else + \:CheckOption{oo1}\if:Option + \Configure{DOCTYPE}{% + \HCode{<!DOCTYPE \a:mathml math PUBLIC + "-//OpenOffice.org//DTD Modified W3C MathML 1.01//\expandafter +\ifx \csname a:dtd-lang\endcsname\relax EN\else + \csname a:dtd-lang\endcsname +\fi +" + "math.dtd">\Hnewline} +% + \HCode{<?xtpipes file="oo-math.4xt" ?>\Hnewline +<!-- \jobname-m\math:obj +\space + by TeX4ht from \jobname.tex line \the\inputlineno\space + 2006-12-04-15:27\Hnewline + (http://www.cse.ohio-state.edu/\string ~gurari/TeX4ht/) + -->\Hnewline +}% + }% + \else + \Configure{DOCTYPE}{%% + \HCode{<!DOCTYPE \a:mathml math PUBLIC + "-//W3C//DTD MathML 2.0//\expandafter +\ifx \csname a:dtd-lang\endcsname\relax EN\else + \csname a:dtd-lang\endcsname +\fi +" + "math.dtd">\Hnewline} +% + \HCode{<?xtpipes file="oo-math.4xt" ?>\Hnewline +<!-- \jobname-m\math:obj +\space + by TeX4ht from \jobname.tex line \the\inputlineno\space + 2006-12-04-15:27\Hnewline + (http://www.cse.ohio-state.edu/\string ~gurari/TeX4ht/) + -->\Hnewline +}% + }% + \fi +\fi +% \Configure{HTML}{}{\noindent}% \Configure{BODY}{}{}% % @@ -107,7 +165,8 @@ tex4ht} \IgnorePar \HPage{}% \Tg<\a:mathml math\Hnewline - \csname a:math-xmlns\endcsname \Hnewline \a:@math>\a:math + \csname a:math-xmlns\endcsname \Hnewline + >\a:math } {\Tg</\a:mathml math>% \EndHPage{}\sv:ignore @@ -115,6 +174,164 @@ tex4ht} \EndIgnoreRule \ifOption{mml-fonts}{}{\EndNoFonts}% \mathmlfalse \b:DviMathML } +\Configure{$$} + {\Configure{@math}{% \a:mathml display="block" +}\IgnorePar + \ifvmode\EndP + \else\EndP \HCode{<!--tex4ht:inline-->}\fi + \HCode{<text:p text:style-name="display-math">}% + \CenteredFrametrue \DviMath \CenteredFramefalse } + {\EndDviMath\HCode{</text:p>}\ShowPar\par + {\csname HCondtrue\endcsname\noindent}} + {\DisplayMathtrue} + +\else + \HAssign\math:obj=0 +\Configure{DviMath} + {\a:DviMathML \mathmltrue + \ifOption{mml-fonts}{}{\NoFonts}% + \HCode{<!--l. \the\inputlineno-->% +}\IgnoreRule + \gHAdvance\math:obj by 1 +\NextFile{\jobname-m\math:obj +.4om}% +\bgroup + \HCode{\ifCenteredFrame + <draw:frame + draw:style-name="df1" + draw:name="mobj-\math:obj"\Hnewline + text:anchor-type="paragraph" + draw:z-index="0">% + <draw:object\Hnewline + xlink:href="./\jobname-m\math:obj +"\Hnewline + xlink:type="simple" + xlink:show="embed" + xlink:actuate="onLoad" />% +</draw:frame>% +\else + <draw:frame + draw:style-name="f1" + draw:name="mobj-\math:obj"\Hnewline + text:anchor-type="as-char" + draw:z-index="0">% + <draw:object\Hnewline + xlink:href="./\jobname-m\math:obj +"\Hnewline + xlink:type="simple" + xlink:show="embed" + xlink:actuate="onLoad" />% +</draw:frame>% +\fi + }% + \OOmanifest{<manifest:file-entry + manifest:media-type="text/xml" + manifest:full-path="\jobname-m\math:obj +/content.xml"/>\Hnewline +<manifest:file-entry + manifest:media-type="text/xml" + manifest:full-path="\jobname-m\math:obj +/settings.xml"/>\Hnewline +<manifest:file-entry + manifest:media-type="application/vnd.sun.xml.math" + manifest:full-path="\jobname-m\math:obj +/"/> +}% + \:CheckOption{oo1}\if:Option + \Configure{DOCTYPE}{\HCode{<!DOCTYPE \a:mathml math PUBLIC + "-//OpenOffice.org//DTD Modified W3C MathML 1.01//\expandafter +\ifx \csname a:dtd-lang\endcsname\relax EN\else + \csname a:dtd-lang\endcsname +\fi +" + "math.dtd">\Hnewline} +}% +\else + \Configure{DOCTYPE}{\HCode{<!DOCTYPE \a:mathml math PUBLIC + "-//W3C//DTD MathML 2.0//\expandafter +\ifx \csname a:dtd-lang\endcsname\relax EN\else + \csname a:dtd-lang\endcsname +\fi +" + "math.dtd">\Hnewline} +}% +\fi +\:CheckOption{-xttl} \if:Option + \Log:Note{Use the `-xttl' command line option to + avoid xttl post processing} +\else + \:CheckOption{oo1}\if:Option + \Configure{DOCTYPE}{% + \HCode{<!DOCTYPE \a:mathml math PUBLIC + "-//OpenOffice.org//DTD Modified W3C MathML 1.01//\expandafter +\ifx \csname a:dtd-lang\endcsname\relax EN\else + \csname a:dtd-lang\endcsname +\fi +" + "math.dtd">\Hnewline} +% + \HCode{<?xtpipes file="oo-math.4xt" ?>\Hnewline +<!-- \jobname-m\math:obj +\space + by TeX4ht from \jobname.tex line \the\inputlineno\space + 2006-12-04-15:27\Hnewline + (http://www.cse.ohio-state.edu/\string ~gurari/TeX4ht/) + -->\Hnewline +}% + }% + \else + \Configure{DOCTYPE}{%% + \HCode{<!DOCTYPE \a:mathml math PUBLIC + "-//W3C//DTD MathML 2.0//\expandafter +\ifx \csname a:dtd-lang\endcsname\relax EN\else + \csname a:dtd-lang\endcsname +\fi +" + "math.dtd">\Hnewline} +% + \HCode{<?xtpipes file="oo-math.4xt" ?>\Hnewline +<!-- \jobname-m\math:obj +\space + by TeX4ht from \jobname.tex line \the\inputlineno\space + 2006-12-04-15:27\Hnewline + (http://www.cse.ohio-state.edu/\string ~gurari/TeX4ht/) + -->\Hnewline +}% + }% + \fi +\fi +% +\Configure{HTML}{}{\noindent}% +\Configure{BODY}{}{}% +% + \edef\sv:ignore{\if:nopar + \noexpand\IgnorePar\else \noexpand\ShowPar\fi}% +\IgnorePar + \HPage{}% +\Tg<\a:mathml math\Hnewline + \csname a:math-xmlns\endcsname \Hnewline + >\a:math + } + {\Tg</\a:mathml math>% + \EndHPage{}\sv:ignore +\egroup +\EndIgnoreRule + \ifOption{mml-fonts}{}{\EndNoFonts}% + \mathmlfalse \b:DviMathML } +\Configure{$$} + {\Configure{@math}{% \a:mathml display="block" +}\IgnorePar + \ifvmode\EndP + \else\EndP \HCode{<!--tex4ht:inline-->}\fi + \HCode{<text:p text:style-name="display-math">}% + \CenteredFrametrue \DviMath \CenteredFramefalse } + {\EndDviMath + \HCode{</text:p>} + \ShowPar\par + {\csname HCondtrue\endcsname\noindent}} + {\DisplayMathtrue} + +\fi \Configure{halignTD} {}{} {<}{\ifmathml \HCode{ columnalign="left"}\else L\fi} @@ -135,20 +352,12 @@ tex4ht} {m}{\ifmathml\else m\fi} %{\HCode{valign-middle align-left}} {b}{\ifmathml\else n\fi} %{\HCode{valign-baseline align-left}} {} -\Configure{$$} - {\Configure{@math}{\a:mathml display="block"}\IgnorePar - \ifvmode\EndP - \else\EndP \HCode{<!--tex4ht:inline-->}\fi - \HCode{<text:p text:style-name="display-math">}\DviMath} - {\EndDviMath\HCode{</text:p>}\ShowPar\par - {\csname HCondtrue\endcsname\noindent}} - {\DisplayMathtrue} \NewConfigureOO{display-math} \ConfigureOO{display-math} {<style:style style:name="display-math" style:family="paragraph" - style:parent-style-name="Text body">\Hnewline - <style:properties + style:parent-style-name="Text-body">\Hnewline + <\style:par:properties fo:text-align="center" style:auto-text-indent="false" style:justify-single-word="false"/>\Hnewline @@ -166,14 +375,55 @@ tex4ht} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{latex} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - \OOstyles{\Hnewline + \:CheckOption{oo1}\if:Option + \OOstyles{\Hnewline <style:style style:name="f1" - style:family="graphics" + style:family="graphic" style:parent-style-name="Formula" >\Hnewline <style:properties style:vertical-pos="middle" style:vertical-rel="text"/>\Hnewline </style:style>\Hnewline} + +\else + \OOstyles{\Hnewline + <style:style style:name="f1" + style:family="graphic" + style:parent-style-name="Formula" + >\Hnewline + <style:graphic-properties + style:vertical-pos="middle" + style:vertical-rel="text"/>\Hnewline + </style:style>\Hnewline} +\OOstyles{\Hnewline + <style:style style:name="df1" + style:family="graphic" + style:parent-style-name="Formula"> + <style:graphic-properties + style:wrap="none" + style:vertical-pos="middle" + style:vertical-rel="paragraph-content" + style:horizontal-pos="center" + style:horizontal-rel="paragraph-content" + fo:background-color="transparent" + style:background-transparency="100\%"> + </style:graphic-properties> + </style:style>\Hnewline +} + +\fi +\OOstyles{\Hnewline + <style:style style:name="Formula" + style:family="graphic"> + <style:graphic-properties + text:anchor-type="as-char" + svg:y="0in" + fo:margin-left="0.1mm" + fo:margin-right="0.1mm" + style:vertical-pos="middle" + style:vertical-rel="text"/> + </style:style>\Hnewline +} \let\AllColMargins\empty \ConfigureEnv{array} {\PushStack\Col:Marg\AllColMargins @@ -233,7 +483,8 @@ tex4ht} <text:p text:style-name="equ-p">}% % \Configure{$$} - {\Configure{@math}{}\IgnorePar\EndP\DviMath} + {\Configure{@math}{}\IgnorePar\EndP + \CenteredFrametrue \DviMath \CenteredFramefalse } {\EndDviMath\EndP}{}% % \IgnorePar} @@ -252,7 +503,7 @@ tex4ht} style:name="equ-p" style:family="paragraph" style:parent-style-name="Standard">\Hnewline - <style:properties + <\style:par:properties fo:text-align="center" style:justify-single-word="false"/>\Hnewline </style:style>\Hnewline @@ -262,7 +513,7 @@ tex4ht} style:name="equ-num-p" style:family="paragraph" style:parent-style-name="Standard">\Hnewline - <style:properties + <\style:par:properties fo:text-align="end" style:justify-single-word="false"/>\Hnewline </style:style>\Hnewline @@ -270,7 +521,7 @@ tex4ht} \OOstyles{% <style:style style:name="equation" style:family="table">\Hnewline - <style:properties + <\style:tableproperties style:rel-width="88\%" fo:margin-left="1cm" fo:margin-right="0cm" @@ -280,10 +531,13 @@ tex4ht} </style:style>\Hnewline } \Configure{[]} - {\Configure{@math}{\a:mathml display="block"}\IgnorePar + {\Configure{@math}{% \a:mathml display="block" +}\IgnorePar \ifvmode\EndP \else\EndP \HCode{<!--tex4ht:inline-->}\fi - \HCode{<text:p text:style-name="display-math">}\DviMath$$\DisplayMathtrue} + \HCode{<text:p text:style-name="display-math">}% + \CenteredFrametrue \DviMath \CenteredFramefalse + $$\DisplayMathtrue} {$$\EndDviMath\HCode{</text:p>}\ShowPar\par {\csname HCondtrue\endcsname\noindent}} {} @@ -296,7 +550,7 @@ tex4ht} \else \HCode{<text:line-break/>}\fi} \def\:nbsp{\ifmtext \leavevmode\special{t4ht@+\string&{35}x00A0{59}}x% \else\ifmathml - \Tg<\a:mathml mspace />\else \ht:special{t4ht@+<text{58}s/>}% + \Tg<\a:mathml mspace />\else \ht:special{t4ht@+<text{58}s/>}x% \fi\fi} \Configure{overline} {\bgroup\ifmathml \HCode{<\a:mathml mover accent="false"\Hnewline @@ -323,15 +577,22 @@ accent="true">&\#x0332;</\a:mathml mo></\a:mathml munder>}% \else \HCode{</text:span>}\fi \egroup} \Configure{left} {} - {\HCode{<\a:mathml mrow><\a:mathml mo>\expandafter - \ifx \csname \string#1:lr del\endcsname\relax #1\else - \csname \string#1:lr del\endcsname\fi - </\a:mathml mo\space><\a:mathml mrow>}} + {\HCode{<\a:mathml mrow>\expandafter + \ifx \csname \string#1:lr del\endcsname\relax + <\a:mathml mo form="prefix">#1</\a:mathml mo\space>\else + \expandafter\ifx \csname \string#1:lr del\endcsname\empty \else + <\a:mathml mo form="prefix">\csname + \string#1:lr del\endcsname</\a:mathml mo>\fi + \fi<\a:mathml mrow>}} \Configure{right} - {\HCode{</\a:mathml mrow><\a:mathml mo>\expandafter - \ifx \csname \string#1:lr del\endcsname\relax #1\else - \csname \string#1:lr del\endcsname\fi - </\a:mathml mo>}} + {\HCode{</\a:mathml mrow>\expandafter + \ifx \csname \string#1:lr del\endcsname\relax + <\a:mathml mo form="postfix">#1</\a:mathml mo>\else + \expandafter\ifx \csname \string#1:lr del\endcsname\empty \else + <\a:mathml mo form="postfix">\csname + \string#1:lr del\endcsname</\a:mathml mo>\fi + \fi + }} {\HCode{</\a:mathml mrow>}} @@ -389,7 +650,8 @@ accent="true">&\#x0332;</\a:mathml mo></\a:mathml munder>}% {}% % \Configure{$$} - {\Configure{@math}{}\IgnorePar\EndP\DviMath} + {\Configure{@math}{}\IgnorePar\EndP + \CenteredFrametrue \DviMath \CenteredFramefalse } {\EndDviMath\EndP}{}% % } @@ -402,6 +664,21 @@ accent="true">&\#x0332;</\a:mathml mo></\a:mathml munder>}% % \ShowPar\par{\HCondtrue\noindent}% } +\Configure{equation*} + {\ifvmode \IgnorePar\fi \EndP + \HCode{<text:p text:style-name="display-math">}% +% + \Configure{$$} + {\Configure{@math}{}\IgnorePar\EndP + \CenteredFrametrue \DviMath \CenteredFramefalse } + {\EndDviMath\EndP}{}% +% + \IgnorePar + } + {\ifvmode \IgnorePar\fi\EndP + \HCode{</text:p>}% +% + \IgnoreIndent\par} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -416,20 +693,28 @@ accent="true">&\#x0332;</\a:mathml mo></\a:mathml munder>}% + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{plain} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \Configure{left} {} - {\HCode{<\a:mathml mrow><\a:mathml mo>\expandafter - \ifx \csname \string#1:lr del\endcsname\relax #1\else - \csname \string#1:lr del\endcsname\fi - </\a:mathml mo\space><\a:mathml mrow>}} + {\HCode{<\a:mathml mrow>\expandafter + \ifx \csname \string#1:lr del\endcsname\relax + <\a:mathml mo form="prefix">#1</\a:mathml mo\space>\else + \expandafter\ifx \csname \string#1:lr del\endcsname\empty \else + <\a:mathml mo form="prefix">\csname + \string#1:lr del\endcsname</\a:mathml mo>\fi + \fi<\a:mathml mrow>}} \Configure{right} - {\HCode{</\a:mathml mrow><\a:mathml mo>\expandafter - \ifx \csname \string#1:lr del\endcsname\relax #1\else - \csname \string#1:lr del\endcsname\fi - </\a:mathml mo>}} + {\HCode{</\a:mathml mrow>\expandafter + \ifx \csname \string#1:lr del\endcsname\relax + <\a:mathml mo form="postfix">#1</\a:mathml mo>\else + \expandafter\ifx \csname \string#1:lr del\endcsname\empty \else + <\a:mathml mo form="postfix">\csname + \string#1:lr del\endcsname</\a:mathml mo>\fi + \fi + }} {\HCode{</\a:mathml mrow>}} @@ -450,6 +735,10 @@ accent="true">&\#x0332;</\a:mathml mo></\a:mathml munder>}% + + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{array} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -522,17 +811,17 @@ accent="true">&\#x0332;</\a:mathml mo></\a:mathml munder>}% - - - %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \ConfigureHinput{rlbabel} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \Configure{[]} - {\Configure{@math}{\a:mathml display="block"}\IgnorePar + {\Configure{@math}{% \a:mathml display="block" +}\IgnorePar \ifvmode\EndP \else\EndP \HCode{<!--tex4ht:inline-->}\fi - \HCode{<text:p text:style-name="display-math">}\DviMath$$\DisplayMathtrue} + \HCode{<text:p text:style-name="display-math">}% + \CenteredFrametrue \DviMath \CenteredFramefalse + $$\DisplayMathtrue} {$$\EndDviMath\HCode{</text:p>}\ShowPar\par {\csname HCondtrue\endcsname\noindent}} {} @@ -756,5 +1045,19 @@ accent="true">&\#x0332;</\a:mathml mo></\a:mathml munder>}% + + + + + + + + + + + + + + \endinput |