66.4 PsTricks

<..pstricks.4ht..>
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % pstricks.4ht                          2014-07-12-22:36 %
 % Copyright (C) 1997--2009       Eitan M. Gurari         %
 <.TeX4ht copyright.>
 <.pstricks pspicture.>
 <.rput pspicture.>
 <.pstricks configs.>
 \ifx\psset@linecap\:UnDef
    <.pre 2006 pstricks.>
 \else
    <.shared 2006/2008 pstricks.>
    \ifx \pst@LaTeX@Setup\:UnDef
       <.since 2008 pstricks.>
    \else
       <.since 2006 pstricks.>
    \fi
 \fi
 \Hinput{pstricks}
 \endinput
 -_-_-

<..pst-all.4ht..>
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 % pst-all.4ht                          2014-07-12-22:36 %
 % Copyright (C) 2003--2009       Eitan M. Gurari         %
 <.TeX4ht copyright.>
 \Hinput{pst-all}
 \endinput
 -_-_-

<..pstricks configs..>
 \pend:def\psframebox@ii{\a:pspicture}
 \append:def\psframebox@ii{\b:pspicture}
 -_-_-
 
 \long\def\:tempc#1#2{%
   \Picture+{}%
     \edef\pst@mathflag{%
        \ifpsmathbox\ifmmode\ifinner 1\else 2\fi\else \z@\fi\else \z@\fi}%
     \setbox\pst@hbox=\hbox{%
          \ifcase\pst@mathflag\or$\m@th\textstyle\or$\m@th\displaystyle\fi
          {\pst@thisbox\the\everypsbox#2}%
          \ifnum\pst@mathflag>\z@$\fi}%
    #1\EndPicture}
 \HLet\pst@makenotverbbox\:tempc -_-_-

<..pstricks pspicture..>
 \pend:def\pst@picture{\global\let\pst:EndPicture\EndPicture
     \let\EndPicture=\empty}
 \expand:after{\let\fi@star=}\csname fi\endcsname
 \NewConfigure{pspicture}{2}
 \HAssign\ps:level=0
 -_-_-

<..pre 2006 pstricks..>
 \def\endpspicture{%
 \pst@killglue
 \endgroup
 \egroup
 \ifdim\wd\pst@hbox=\z@\else
    \:warning{Hidden \string\@pstrickserr
         {Extraneous space in the pspicture environment}}%
 \fi
 \ht\pst@hbox=\pst@dimd
 \dp\pst@hbox=-\pst@dimb
 \setbox\pst@hbox=\hbox{%
 \kern-\pst@dima
 \ifx\pst@tempa\@empty\else
 \advance\pst@dimd-\pst@dimb
 \pst@dimd=\pst@tempa\pst@dimd
 \advance\pst@dimd\pst@dimb
 \lower\pst@dimd
 \fi
 \box\pst@hbox
 \kern\pst@dimc}%
 \if@star\setbox\pst@hbox=\hbox{\clipbox@@\z@}\fi@star
 <.pspicture img.>%
 \endgroup}
 -_-_-

<..since 2006 pstricks..>
 \def\endpspicture{%
   \pst@killglue
   \global\pst@shift=\psk@shift% in fact of the following endgroup
   \endgroup
   \egroup
   \ifdim\wd\pst@hbox=\z@\else
      \:warning{Hidden \string\@pstrickserr
         {Extraneous space in the pspicture environment}}%
   \fi
   \ht\pst@hbox=\pst@dimd
   \dp\pst@hbox=-\pst@dimb
   \setbox\pst@hbox=\hbox{%
     \kern-\pst@dima
     \pst@dimd-\pst@shift
     \advance\pst@dimd\pst@dimb
     \lower\pst@dimd%
     \box\pst@hbox%
     \kern\pst@dimc}%
   \if@star\setbox\pst@hbox=\hbox{\clipbox@@\z@}\fi@star
   <.pspicture img.>%
   \endgroup%
   \global\psk@shift\z@% restore value
 }
 -_-_-

<..since 2008 pstricks..>
 \def\endpspicture{%
   \pst@killglue
 %  \global\pst@shift=\psk@shift% in fact of the following endgroup
   \endgroup
   \egroup
   \ifdim\wd\pst@hbox=\z@\else
      \:warning{Hidden \string\@pstrickserr
         {Extraneous space in the pspicture environment}}%
   \fi
   \ht\pst@hbox=\pst@dimd
   \dp\pst@hbox=-\pst@dimb
   \setbox\pst@hbox=\hbox{%
     \kern-\pst@dima
     \pst@dimd-\pst@shift
     \advance\pst@dimd\pst@dimb
     \lower\pst@dimd%
     \box\pst@hbox%
     \kern\pst@dimc}%
   \if@star\setbox\pst@hbox=\hbox{\clipbox@@\z@}\fi@star
   <.pspicture img.>%
   \endgroup%
   \psset@shift{0}% reset value
 %  \global\psk@shift\z@% restore value
 }
 -_-_-

<..pspicture img..>
 \ifnum \ps:level=0
    \let\EndPicture\pst:EndPicture
    \global\let\pst:EndPicture=\:UnDef
    \a:pspicture\box\pst@hbox\b:pspicture
 \else
    \xdef\pspicture:dim{\the\wd\pst@hbox,
          \the\ht\pst@hbox, \the\ht\pst@hbox}%
    \box\pst@hbox
 \fi
 -_-_-

<..rput pspicture..>
 \def\rput@iv(#1){\pst@killglue \gHAdvance\ps:level by 1
      \pst@makebox{\gHAdvance\ps:level by -1 \rput@v{#1}}}
 \def\rput@v#1{\begingroup
    \use@par
    \if@star\pst@starbox\fi
    \pst@makesmall\pst@hbox
    \pst@rotate\psk@rot\pst@hbox
    \ifnum \ps:level=0
       \expandafter\ifx \csname pspicture:dim\endcsname\relax
          \ht:everypar{}\psput@{#1}\pst@hbox
       \else
          <.rput fix.>%
       \fi
    \else
       \psput@{#1}\pst@hbox
    \fi
 \endgroup \ignorespaces}
 -_-_-

A search on ‘\psput@{#1}\pst@hbox’ show a few other locations needing a similar code: \Rput, \uput, and \cput. When it is coming to paragraph breaks, they are all problematic (because they move text around?).

<..rput fix..>
 \def\psput@cartesian##1{%
    \hbox to \pst@dimg{{\vbox to \pst@dimh{\vss\box##1}\hss}}}%
 \global\let\pspicture:dim=\:UnDef
 \let\sv:leavevmode=\leavevmode
 \def\leavevmode{%
    \let\leavevmode=\sv:leavevmode
    <.rput warning.>%
    \let\EndPicture\pst:EndPicture
    \global\let\pst:EndPicture=\:UnDef
    \a:pspicture \leavevmode}%
 \psput@{#1}\pst@hbox\b:pspicture
 -_-_-

<..rput warningNO..>
 \ifdim \pst@dimg<2pt
    \:warning{pspicture might fail within \noexpand\rput
         (width=\the\pst@dimg\space height=\the\pst@dimh)}%
 \else \ifdim \pst@dimh<2pt
    \:warning{pspicture might fail within \noexpand\rput
         (width=\the\pst@dimg\space height=\the\pst@dimh)}%
 \fi\fi
 -_-_-