\def\ifundefined#1{\expandafter\ifx\csname#1\endcsname\relax}

\ifundefined{newcommand}
			% define DrawPicture for TeX
\long\gdef\DrawPicture#1#2#3
 {\centerline
	{\vbox to #1pt
		{\hbox to #2pt
		{\special{impress #3}}
		}
	}
 }

\else
			% define DrawPicture for LaTeX

% output some impress data at current location on page
\newcommand{\Impress}[1]
{
  \makebox(0,0){\special{impress #1}}
}

% put a picture on page (use for multiple pictures across page)
\newcommand{\PutPicture}[3]
{
  \begin{picture}(#1,#2)
    \put(0,#2){\Impress{#3}}
  \end{picture}
}

% put a centered picture on page (use for single picture across page)
\newcommand{\DrawPicture}[3]
{
  \begin{center}
    \PutPicture{#1}{#2}{#3}
  \end{center}
}

\fi
