3.15 Math

Don’t put \:xhtml{\IgnorePar\EndP} on the following; \PicDisplay should handle it.

<..configure html4-math latex..>
 \Configure{[]}
    {\bgroup
        \protect\nested:math
        \PicDisplay
        $$\everymath{}\everydisplay{}}
    {$$\EndPicDisplay \egroup <.try inline par.>}
 \Configure{()}{\bgroup
       \protect\nested:math
       \protect\PicMath
        $}
    {$ \protect\EndPicMath \egroup}
 \def\nested:math{<.nested pic math.>}
-_-_-

The above should be sensitive to cases like the following one.

\[ \parbox[t]{2in} { \[.\] }\]

<..nested pic math..>
 \def\[{\bgroup \def\]{$$\egroup}$$}%
 \def\({\bgroup \def\){$\egroup}$}%
-_-_-

<..configure html4-math latex..>+
 \Configure{@TITLE}{\Configure{()}{$}{$}}
-_-_-

<..configure html4-math th4..>
 \:CheckOption{th4}\if:Option
    \Configure{[]}
       {\PicDisplay $$\everymath{}\everydisplay{}}
       {$$\EndPicDisplay <.try inline par.>}
    \Configure{()}{\PicMath$}{$\EndPicMath}
 \fi
-_-_-

<..picmath plain,latex..>
 \Configure{$$}{\:xhtml{\EndP}\PicDisplay}{\EndPicDisplay}
    {\everymath{}\everydisplay{}}
 <.pic math formulas.>
 <.pic math + tex formulas.>
-_-_-

<..pic math formulas..>
 \:CheckOption{pic-m} \if:Option
    \Configure{$}{\PicMath}{\EndPicMath}{}
 \else
    \Log:Note{for pictorial $...$ environments,
         use the command line option ‘pic-m’ (not recommended!!)}
 \fi
-_-_-

<..pic math + tex formulas..>
 \:CheckOption{pic-m+} \if:Option
    \def\Alt:Math#1${\tmp:toks{$#1$}%
       \Picture*[<.pic math alt.>]{ style="text-align:middle"}$#1$\EndPicture$}
    \def\Alt:Display#1$${\tmp:toks{$$#1$$}%
       \Picture*[<.pic math alt.>]{}$$#1$$\EndPicture$$}
    \def\Alt:lMath#1\){\tmp:toks{\(#1\)}%
       \Picture*[<.pic math alt.>]{ style="text-align:middle"}$#1$\EndPicture}
    \def\Alt:lDisplay#1\]{\tmp:toks{\[#1\]}%
       \Picture*[<.pic math alt.>]{}$$#1$$\EndPicture}
    \Configure{$}{}{}{\expandafter\Alt:Math}
    \Configure{$$}{}{}{\expandafter\Alt:Display}
 %   \Configure{()}{\Alt:lMath}{}
 %   \Configure{[]}{\Alt:lDisplay}{}
 \else
    \Log:Note{for pictorial $...$ and
        $$...$$ environments with latex alt,
        use the command line option ‘pic-m+’ (not safe!!)}
 \fi
-_-_-

<..configure html4 latex..>+
 \def\PictureAltex{\afterassignment\set:Img\tmp:toks}
 \def\set:Img{\Picture*[<.pic math alt.>]{}\the\tmp:toks\EndPicture}
-_-_-

<..pic math alt..>
 \special{t4ht*=&&amp;}%
 \special{t4ht*="&quot;}%
 \special{t4ht*=<&lt;}%
 \special{t4ht*=>&gt;}%
    \HCode{\the\tmp:toks}%
 \special{t4ht*=}%
-_-_-