%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% This is plate.sty file
%% Copyright(C) 1998 by Yoshiki OTOBE.
%% However, anyone may use it for any purpose without any permission.
%% I think there would exist bugs in this package.
%% If you find any bugs in the commands defined, please repair them
%% by yourself rather than ask me.
%% After that please distribute it.
%% I will thank you if you tell me what is wrong.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\SetTextWidth#1{\settextwidth{#1}}
\def\SetTextWidthByRatio#1{\settextwidthbyratio{#1}}
\def\SetTextWidthByNumberOfChar#1{\settextwidthbynumberofchar{#1}}
\def\SetNumberOfChar#1{\setnumberofchar{#1}}
\def\SetNumberOfCharWith#1#2{\setnumberofcharwith{#1}{#2}}
\def\SetTextHeight#1{\settextheight{#1}}
\def\SetNumberOfLineWith#1#2{\setnumberoflinewith{#1}{#2}}
\def\SetNumberOfLine#1{\setnumberofline{#1}}
\def\settextwidth#1{%
	\dimen2\textwidth% preserve current text width
	\textwidth#1%
	\if@twocolumn
		\columnwidth\textwidth
		\advance\columnwidth-\columnsep
		\divide\columnwidth\tw@
		\hsize\columnwidth
		\linewidth\columnwidth
	\else
		\columnwidth\textwidth
		\hsize\columnwidth
		\linewidth\columnwidth
	\fi
	\dimen1\paperwidth%
	\advance\dimen1 by -#1%
	\divide\dimen1 by 2%
	\advance\dimen1 by -\hoffset%
	\advance\dimen1 by -1in%
	\oddsidemargin\dimen1%
	\evensidemargin\dimen1%
	\advance\dimen2 by -#1% difference of two text width
	\divide\dimen2 by 2% difference of new and old margin
	\advance\marginparwidth by \dimen2}
\def\settextwidthbyratio#1{%
	\dimen9=#1\paperwidth%
	\settextwidth{\dimen9}}
\def\settextwidthbynumberofchar#1{%
	\dimen9=#1\Cwd%
	\settextwidth{\dimen9}}
\def\setnumberofcharwith#1#2{%
	\dimen9=\linewidth%
	\newcount\numberofchar%
	\numberofchar=#2%
	\advance\numberofchar by -1%
	\setbox0\hbox{#1}%
	\advance\dimen9 by -#2\wd0
	\divide\dimen9 by \numberofchar%
	\kanjiskip=\dimen9 plus 1pt minus1pt%
	\parindent\dimen9%
	\advance\parindent by \wd0}
\def\setnumberofchar#1{%
	\setnumberofcharwith{\normalsize \char\euc"A1A1}{#1}}
\def\settextheight#1{%
	\dimen1\textheight%
	\textheight#1%
	\advance\dimen1 by -#1%
	\divide\dimen1 by 2%
	\advance\topmargin by \dimen1% set the main part center.
	\advance\footskip by \dimen1}%
\def\setnumberoflinewith#1#2{%
	\let\preserveddocument\document%
	\def\document{\preserveddocument\mainpartofsetnumberoflinewith{#1}{#2}}%
	\mainpartofsetnumberoflinewith{#1}{#2}}
\def\mainpartofsetnumberoflinewith#1#2{%
	\setbox0=\hbox{#1}%
	\newcount\numberofline%
	\numberofline=#2%
	\advance\numberofline by -1%
	\topskip\ht0%
	\dimen9=\textheight%
	\advance\dimen9 by -\topskip%
	\divide\dimen9 by \numberofline%
	\lineskiplimit-16383pt
	\baselineskip\dimen9}
\def\setnumberofline#1{%
	\setnumberoflinewith{\normalsize \char\euc"A1A1}{#1}}
