4.7 Math

<..configure docbook-math tex4ht..>
 \Configure{$$}{\EndP\PicDisplay}{\EndPicDisplay}
    {\everymath{}\everydisplay{}}
 \Configure{$}{\PicMath}{\EndPicMath}{}
 \Configure{PicMath}
   {\Tg<inlineequation>}{\Tg</inlineequation>}{}{}
 \let\MathPar\empty
-_-_-

<..configure docbook-math tex4ht..>+
 \Configure{PicDisplay}
   {\edef\MathPar{\ifvmode par-\fi}\IgnorePar\EndP\ShowPar\endgraf
    \HCode{<equation role="\MathPar math-display"><mathphrase>}}
   {\HCode{</mathphrase></equation>}\ShowPar}
   {}  {\space role="\MathPar math-display" }
-_-_-

<..try inline par..>
 \ShowPar\par{\HCondtrue\noindent}%
-_-_-

<..configure docbook tex4ht ..>
 \Configure{Picture+}{}{}
 \Configure{Picture*}{}{}
 \Configure{IMG}
   {\ht:special{t4ht=<graphic\Hnewline fileref="}}
   {\ht:special{t4ht="}}
   {}
   {}
   {\ht:special{t4ht=></graphic>}}
 \Configure{pic-halign}{}
-_-_-

<..configure docbook tex4ht..>+
 \Configure{Picture+}{}{}
 \Configure{Picture*}{}{}
 \Configure{IMG}
   {\ht:special{t4ht=<inlinemediaobject><imageobject><imagedata\Hnewline
                                                        fileref="}}
   {\ht:special{t4ht="}}
   {}
   {}
   {\ht:special{t4ht=></imagedata></imageobject></inlinemediaobject>}}
 \Configure{pic-halign}{}
-_-_-

<..configure docbook tex4ht..>+
 \Configure{PictureAlt*+}
    {\let\sv:HtmlPar=\HtmlPar   \let\HtmlPar=\empty
      <.postscript for /Picture.>%
      <.tex halign and cr/crcr.>%
      \NoFonts\csname PauseMathClass\endcsname \SUBOff \SUPOff
      \let\HCode=\:gobble     \offinterlineskip
      \let\EndPicture=\empty
      \ht:special{t4ht@[}%
    }
    {\ht:special{t4ht@]}%
      \let\HCode=\:HCode
      \let\EndPicture=\:UnDef \let\HtmlPar=\sv:HtmlPar \SUBOn \SUPOn
      \csname EndPauseMathClass\endcsname \EndNoFonts
      <.tex4ht halign and cr/crcr.>%
      <.delay postscript.>%
    }
-_-_-

<..postscript for /Picture..>
 \def\PsCode##1{{\ht:special{\PsCodeSpecial##1}}}%
-_-_-

<..tex halign and cr/crcr..>
 \iffalse{\fi
 \let\sv:halign=\halign
 \let\sv:cr=\cr
 \let\sv:crcr=\crcr
 \iffalse}\fi
 \RecallTeXcr \let\halign =\TeXhalign
-_-_-

<..tex4ht halign and cr/crcr..>
 \iffalse{\fi
 \let\halign=\sv:halign
 \let\cr=\sv:cr
 \let\crcr=\sv:crcr
 \iffalse}\fi
-_-_-

<..delay postscript..>
 \let\PsCode=\relax
-_-_-

<..configure docbook-math tex4ht WAIT..>
 
 \Configure{halignTR}
    {\HCode{ style="vertical-align:baseline;"}}
 \Configure{halignTBL}
 % %   {t}{\HCode{ valign="top"}}
 % %   {b}{\HCode{ valign="baseline"}}
 % %   {c}{\HCode{ valign="middle"}}
     {}
 
 \Configure{halign}
    {\EndP\halignTB{halign}}   {\HCode{</table>}}
    \R:HA\r:HA\D:HA\d:HA
 \Configure{pic-halign}{}
 \Configure{halignTD} {}{}
    {<}{\HCode{ style="white-space:nowrap; text-align:left;"}}
    {-}{\HCode{ style="white-space:nowrap; text-align:center;"}}
    {>}{\HCode{ style="white-space:nowrap; text-align:right;"}}
    {^}{\HCode{ style="vertical-align:top; white-space:nowrap;"}}
    {=}{\HCode{ style="vertical-align:baseline; white-space:nowrap;"}}
    {|}{\HCode{ style="vertical-align:middle; white-space:nowrap;"}}
    {_}{\HCode{ style="vertical-align:bottom; white-space:nowrap;"}}
    {p}{\HCode{ style="white-space:wrap; text-align:left;"}\Protect\a:HColWidth}
    {m}{\HCode{ style="white-space:nowrap; text-align:left; vertical-align:middle;"}}
    {b}{\HCode{ style="white-space:nowrap; text-align:left; vertical-align:baseline;"}}
    {}
 
 
 
 \ifx \a:imgdir\:UnDef
    \let\a:imgdir=\empty
    \catcode‘\:=12
       \expandafter
       \def\csname :temp\endcsname#1imgdir:#2,#3!*?: {%
          \if !#2!\else \expandafter
                           \def\csname a:imgdir\endcsname{#2}\fi}
       \expandafter\csname :temp\expandafter\endcsname
          \Preamble ,imgdir:,!*?: %
    \catcode‘\:=11
    \Log:Note{for addressing images in
        a subdirectory,  use the command line option ‘imgdir:.../’}
 \fi
 
-_-_-

<..configure docbook-math latex WAIT..>
    \ConfigureEnv{array}
      {\IgnorePar\EndP\Tg<div class="pic-array">\Picture*{}$$}
      {$$\EndPicture\Tg</div>}{}{}
-_-_-

<..configure docbook-math array WAIT..>
    \ConfigureEnv{array}
      {\IgnorePar\EndP\Tg<div class="pic-array">\Picture*{}$$}
      {$$\EndPicture\Tg</div>}{}{}
-_-_-

<..configure docbook graphics..>
 \Configure{graphics}
   {}
   {\HCode{<inlinemediaobject><imageobject><imagedata
                    width="\the\Gin@req@width"
                    fileref="\Gin@base\Gin@ext"
       ></imagedata></imageobject></inlinemediaobject>}%
    }
-_-_-

<..configure docbook graphics ..>
 \Configure{graphics}
   {}
   {\HCode{<graphic width="\the\Gin@req@width"  fileref="\Gin@base\Gin@ext"
       ></graphic>}%
    }
-_-_-

<..configure docbook-math latex..>
 \Configure{[]}
    {\PicDisplay $$\everymath{}\everydisplay{}}
    {$$\EndPicDisplay}
 \Configure{()}{\protect\PicMath$}{$\protect\EndPicMath}
-_-_-

<..configure docbook-mml tex4ht..>+
 \Configure{$$}
    {\Configure{@math}{<.disp math.>}\DviMath}
    {\EndDviMath{\csname HCondtrue\endcsname\noindent}}
    {}
 \Configure{@math}{<.disp math.>} \let\math:mode=\a:@math
 \Configure{DviMath}
     {\a:DviMathML \mathmltrue
        \mml:htfsym \NoFonts%
        \IgnoreRule
        \HCode{<!--l. \the\inputlineno--><math\Hnewline
                 xmlns="http://www.w3.org/1998/Math/MathML">}\a:math
        <.sv dvimath par.>\IgnorePar}
     {\HCode{</math>} \EndIgnoreRule
      \ext:htfsym \EndNoFonts%
      \mathmlfalse \b:DviMathML <.recall dvimath par.>}
 \Configure{DviMathML}
    {\HCode{<\ifx \math:mode\a:@math \else inline\fi
              equation \Hnewline \expandafter\:rend \a:@math==//>}}
    {\HCode{</\ifx \math:mode\a:@math \else inline\fi equation>}}
 \def\:rend#1=#2=#3//{\if !#1!\else role=#2\fi}
-_-_-

<..disp math..>
 display="block"
-_-_-

<..recall dvimath par..>
 \sv:ignore
-_-_-

<..sv dvimath par..>
 \edef\sv:ignore{\if:nopar
     \noexpand\IgnorePar\else \noexpand\ShowPar\fi}%
-_-_-

<..configure docbook fontmath..>
 \Configure{mathit}{\HCode{<emphasis role="it">}}
                   {\HCode{</emphasis>}}
 \Configure{mathbf}{\HCode{<emphasis role="bf">}}
                   {\HCode{</emphasis>}}
 \Configure{mathtt}{\HCode{<emphasis role="tt">}}
                   {\HCode{</emphasis>}}
 \Configure{mathsf}{\HCode{<emphasis role="sf">}}
                   {\HCode{</emphasis>}}
 \Configure{mathrm}{\HCode{<emphasis role="rm">}}
                   {\HCode{</emphasis>}}
-_-_-

<..configure docbook latex..>+
 \Configure{textbf}{<.par within font.>\HCode{<emphasis role="bf">}}
                   {\HCode{</emphasis>}<.end par within font.>}
 \Configure{textit}{<.par within font.>\HCode{<emphasis role="it">}}
                   {\HCode{</emphasis>}<.end par within font.>}
 \Configure{textrm}{<.par within font.>\HCode{<emphasis role="rm">}}
                   {\HCode{</emphasis>}<.end par within font.>}
 \Configure{textup}{<.par within font.>\HCode{<emphasis role="up">}}
                   {\HCode{</emphasis>}<.end par within font.>}
 \Configure{textsc}{<.par within font.>\HCode{<emphasis role="sc">}}
                   {\HCode{</emphasis>}<.end par within font.>}
 \Configure{textsf}{<.par within font.>\HCode{<emphasis role="sf">}}
                   {\HCode{</emphasis>}<.end par within font.>}
 \Configure{textsl}{<.par within font.>\HCode{<emphasis role="sl">}}
                   {\HCode{</emphasis>}<.end par within font.>}
 \Configure{texttt}{<.par within font.>\HCode{<emphasis role="tt">}}
                   {\HCode{</emphasis>}<.end par within font.>}
 \Configure{emph}{<.par within font.>\HCode{<emphasis>}}
                 {\HCode{</emphasis>}<.end par within font.>}
-_-_-

<..par within font..>
 \leavevmode\SaveEndP\bgroup
 \Configure{HtmlPar}
    {\HCode{<!--br role="newline" /-->}}
    {\HCode{<!--br role="newline" /-->}}
    {}{}%
-_-_-

<..end par within font..>
 \egroup \RecallEndP
-_-_-