% the aim here was to get nice captions that are indented
% as in iop style but it doesn't work.

\def\listfigurename{List of Figures}
\def\figurename{Figure}
\newcounter{figtype}
\def\listoffigures{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \fi\section*{List of Figures\@mkboth
 {LIST OF FIGURES}{LIST OF FIGURES}}\@starttoc{lof}\if@restonecol\twocolumn
 \fi}
\def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
\def\listoftables{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \fi\section*{List of Tables\@mkboth
 {LIST OF TABLES}{LIST OF TABLES}}\@starttoc{lot}\if@restonecol\twocolumn
 \fi}
\newcommand{\Figure}[1]{\setcounter{figtype}{1}%
    \def\figspace{}\def\figcap{\caption{#1}}%
    \futurelet\next\@figplace}
\def\@figplace{\ifx\next[\let\next=\@figpl
                 \else\let\next=\@fignopl\fi\next}
\def\@figpl[#1]{\begin{figure}[#1]
   \figspace
   \figcap
   \end{figure}}
\def\@fignopl{\begin{figure}
   \figspace
   \figcap
   \end{figure}}

\newcommand{\sidecap}[3]{\setcounter{figtype}{2}%
    \setlength{\figdepth}{#1}\def\@figindent{#2}%
    \def\sidedc@p{\caption{#3}}%
    \futurelet\next\@sidecapplace}
\def\@sidecapplace{\ifx\next[\let\next=\@sidecappl
                 \else\let\next=\@sidecapnopl\fi\next}
\def\@sidecappl[#1]{\begin{figure}[#1]
    \vbox to\figdepth{\vfill
    \sidedc@p}%
    \setcounter{figtype}{1}\end{figure}}
\def\@sidecapnopl{\begin{figure}
    \vbox to\figdepth{\vfill
    \sidedc@p}%
    \setcounter{figtype}{1}\end{figure}}
%
\newcommand{\side}[3]{\setcounter{figtype}{3}%
    \setlength{\figdepth}{#1}\setlength{\figwidth}{15pc}
    \setlength{\secfigwidth}{15pc}
    \def\firstc@p{\caption{#2}}\def\secondc@p{\caption{#3}}
    \futurelet\next\@sideplace}
\def\@sideplace{\ifx\next[\let\next=\@sidepl
                 \else\let\next=\@sidenopl\fi\next}
\def\@sidepl[#1]{\begin{figure}[#1]
    \vspace*{1.5pc}\vspace*{\figdepth}
    \parbox[t]{\figwidth}{\firstc@p}\hspace*{1pc}%
    \parbox[t]{\secfigwidth}{\secondc@p}
    \setcounter{figtype}{1}\end{figure}}
\def\@sidenopl{\begin{figure}
    \vspace*{1.5pc}\vspace*{\figdepth}
    \parbox[t]{\figwidth}{\firstc@p}\hspace*{1pc}%
    \parbox[t]{\secfigwidth}{\secondc@p}
    \setcounter{figtype}{1}\end{figure}}
%
\newcommand{\varside}[4]{\setcounter{figtype}{3}%
    \setlength{\figdepth}{#1}\setlength{\figwidth}{#2}%
    \setlength{\secfigwidth}{30pc}
    \addtolength{\secfigwidth}{-\figwidth}
    \def\firstc@p{\caption{#3}}\def\secondc@p{\caption{#4}}
    \futurelet\next\@sideplace}

\def\thefigure{\@arabic\c@figure}
\def\fps@figure{htbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{\figurename~\thefigure}
\def\figure{\@float{figure}}
\let\endfigure\end@float
\@namedef{figure*}{\@dblfloat{figure}}
\@namedef{endfigure*}{\end@dblfloat}
\def\thetable{\@arabic\c@table}
\def\fps@table{htbp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\fnum@table{\tablename~\thetable}
\def\table{\@float{table}}
\let\endtable\end@float
\@namedef{table*}{\@dblfloat{table}}
\@namedef{endtable*}{\end@dblfloat}


