%-- figureps  -----------------------------------
% ps file  option
%\newif\ifpsfile
%\newif\ifsotogawa
%\def\setsotogawa{\sotogawatrue\psfilefalse}
%\def\setpsfile{\psfiletrue\sotogawafalse}
%        \setsotogawa
% ps file  \setpsfile
%\setsotogawa
%----------------------
\RequirePackage{epsbox}
%\usepackage{epsbox}
\newcounter{figureps} %figurecounter
\newif\ifZunumber
%---------------------------------------
% \Figps{ps_file_name}(width,hight)[option for psbox]{moji}
\long\def\Figps#1(#2,#3)[#4]#5{%
	\vspace{1cm}
	\ifZunumber\refstepcounter{figureps}\fi\nobreak%
	\begin{center}\begin{picture}(#2,#3)%
	\put(0,0){\psbox[#4]{#1}}#5%
	\draftframe(#2,#3)
	\end{picture}%\end{center}\nobreak%
	\ifZunumber\vspace{.5cm}\nobreak
	\par\leavevmode\noindent
	\mbox{��} \arabic{figureps}\fi%
	\protect\label{#1}%	
	\end{center}%
	\ifZunumber\vspace{.5cm}\fi}
% \TwoFigps{ps_file_name,ps_filename2}(width,hight,2psbox-yoko,2-sbox-tate)
%[option for psbox,ps2box]{moji}
\long\def\TwoFigps#1#2(#3,#4,#5,#6)[#7,#8]#9{%
	\vspace{1cm}
	\ifZunumber\refstepcounter{figureps}\fi\nobreak%
	\begin{center}\begin{picture}(#3,#4)%
	\put(0,0){\psbox[#7]{#1}}#9%
	\put(#5,#6){\psbox[#8]{#2}}
	\draftframe(#3,#4)
	\end{picture}%\end{center}\nobreak%
	\ifZunumber\vspace{.5cm}\nobreak
	\par\leavevmode\noindent
	\mbox{��} \arabic{figureps}\fi%
	\protect\label{#1}%	
	\end{center}%
	\ifZunumber\vspace{.5cm}\fi}
%---------------------------------------
% \Figps(width,hight)[label]{moji}
\long\def\Figpssoto(#1,#2)[#3]#4{%
	%\vspace{1cm}
	\ifZunumber\refstepcounter{figureps}\fi\nobreak%
	\begin{center}\begin{picture}(#1,#2)%
	#4% \put(0,0){aaa}
	\draftframe(#1,#2)
	\end{picture}%\end{center}\nobreak%
	\ifZunumber\vspace{.5cm}\nobreak
	\par\leavevmode\noindent
	\mbox{��} \arabic{figureps}\fi%
	\protect\label{#3}%
	\end{center}%
	\vspace{.5cm}}
\let\Fig=\Figpssoto % default is sotogawa
%-------------------
\long\def\Figpstwo#1(#2,#3)(#4,#5)[#6]#7{%
	\vspace{1cm}
	\ifZunumber\refstepcounter{figureps}\fi\nobreak%
	\begin{center}\begin{picture}(#2,#3)%
	\put(#4,#5){\psbox[#6]{#1}}#7%
	\draftframe(#2,#3)
	\end{picture}%\end{center}\nobreak%
	\ifZunumber\vspace{.5cm}\nobreak
	\par\leavevmode\noindent
	\mbox{��} \arabic{figureps}\fi%
	\protect\label{#1}%
	\end{center}%
	\ifZunumber\vspace{.5cm}\fi}
%\makeatletter	%style file
\newcounter{figfactor}
\setcounter{figfactor}{1000}
\newcounter{figscale}
\setcounter{figscale}{7} %default A4
\def\setul{\figw=\number\c@figfactor\figfw %
		\figw=\number\c@figscale\figw %
		\unitlength=\figw}
\def\setFigA{\setcounter{figscale}{7}\setul} %for A4
\def\setFigB{\setcounter{figscale}{6}\setul} %&for B5
\newdimen\figfw
\newdimen\figw
\figfw=266 sp
\figw=\number\c@figfactor\figfw 
\figw=\number\c@figscale\figw 
\unitlength=\figw
\def\ul{\unitlength}
%  default=1000
\def\setfigfactor#1{\setcounter{figfactor}{#1}%
			\figw=\number\c@figfactor\figfw %
			\figw=\number\c@figscale\figw %
			\unitlength=\figw}
%\makeatother	%style file
%draftframe
\def\draftframe(#1,#2){} %default
\newdimen\x
\newcounter{z}
\def\uabs#1{\x=#1sp \setcounter{z}{\number\x}\addtocounter{z}{1}}
\newcounter{draftxx}
\newcounter{draftyy}
\def\draftset{\def\draftframe(##1,##2){\uabs{##1}%
		\setcounter{draftxx}{\value{z}}%
		\uabs{##2}\setcounter{draftyy}{\value{z}}%
	\multiput(0,0)(1,0){\thedraftxx}{\line(0,1){##2}}%
	\multiput(0,0)(0,1){\thedraftyy}{\line(1,0){##1}}
	\put(0,##2){\line(1,0){##1}}\put(##1,0){\line(0,1){##2}}}}
\def\draftunset{\def\draftframe(##1,##2){}}
%----------------------------
\endinput
%----------------------------

% psfile type
% (command\Fig)
% \setpsfile \setsotogawa file
% file
\def\setsotogawa{%
% \Fig(width,hight)[label]{moji}
\long\def\Fig(##1,##2)[##3]##4{%
	\vspace{1cm}\refstepcounter{figureps}\nobreak%
	\begin{center}\begin{picture}(##1,##2)%
	##4% \put(0,0){aaa}
	\draftframe(##1,##2)
	\end{picture}%\end{center}\nobreak%
	\vspace{.5cm}\nobreak

	\noindent
	\mbox{ \arabic{figureps}}%
	\protect\label{##3}%
	\end{center}%
	\vspace{.5cm}}
}
\def\setpsfile{%
% \Figps{ps_file_name}(width,hight)[option for psbox]{moji}
\long\def\Fig##1(##2,##3)[##4]##5{%
	\vspace{1cm}\refstepcounter{figureps}\nobreak%
	\begin{center}\begin{picture}(##2,##3)%
	\put(0,0){\psbox[##4]{##1}}##5%
	\draftframe(##2,##3)
	\end{picture}%\end{center}\nobreak%
	\vspace{.5cm}\nobreak

	\noindent
	\mbox{ \arabic{figureps}}%
	\protect\label{##1}%
	\end{center}%
	\vspace{.5cm}}
}
\endinput
%style file include makeatletter/other

