Don’t put \:xhtml{\IgnorePar\EndP} on the following; \PicDisplay should
handle it.
\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} { \[.\] }\]
\def\[{\bgroup \def\]{$$\egroup}$$}%
\def\({\bgroup \def\){$\egroup}$}%
-_-_-
\Configure{@TITLE}{\Configure{()}{$}{$}}
-_-_-
\:CheckOption{th4}\if:Option
\Configure{[]}
{\PicDisplay $$\everymath{}\everydisplay{}}
{$$\EndPicDisplay <.try inline par.>}
\Configure{()}{\PicMath$}{$\EndPicMath}
\fi -_-_-
\:CheckOption{pic-m} \if:Option
\Configure{$}{\PicMath}{\EndPicMath}{}
\else
\Log:Note{for pictorial $...$ environments,
use the command line option ‘pic-m’ (not recommended!!)}
\fi
-_-_-
\: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 -_-_-
\def\PictureAltex{\afterassignment\set:Img\tmp:toks}
\def\set:Img{\Picture*[<.pic math alt.>]{}\the\tmp:toks\EndPicture} -_-_-
\special{t4ht*=&&}%
\special{t4ht*=""}%
\special{t4ht*=<<}%
\special{t4ht*=>>}%
\HCode{\the\tmp:toks}%
\special{t4ht*=}%
-_-_-