% LateX2e Style File privately prepared for "Kyoto RIMS Kokyuroku"
%  to be published by Research Institure for Mathematical Sciences, Kyoto Univ.
%
% rims-e.sty
%      version 3.3: Mar. 2019 modified by M.Fujimura
%      version 3.2: Oct. 2015 modified by T.Saito
%      version 3.1: Nov. 2002 modified by H.Murao of CS.UEC, Japan.
%	.conversion from rims.sty
%      version 3.0: Jan. 2002 by Tomokatsu Saito saito@@a2z.co.jp
%
% Usage::
%
%   Template of LaTeX file:
%
%   \documentclass[...]{artcile}
%   \usepackage{rims19e}
%%%%   \usepackage[Option]{rims19e}
%%%%	where Option is list of the following:
%%%%	FVerb, useeps, theorem
%   \title{...}
%   \author{author's_name\affil{affiliation}%
%	[ \and author's_name\affil{affiliation}%
%	  ... ]
%   }
%   \endaddress{author's_affiliation\address{author's_address}%
%                 \kanjidata{author's_name[in Kanji character]}%
%        [\and author's_affiliation\address{author's_address}%
%            ...]
%   }
%   \begin{document}
%
%   \end{document}
%
%   Editor must prepare "headline.tex'', which contains the following items:
%
%   \title{Title}
%   \author{1st-author\affil{affiliation}\mail{E-mail address}%
%		\and
%	    2nd-author\affil{affiliation}\mail{E-mail address}%
%            \ename{English name}\eaffil{English} ...}
%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%HM	\newif\ifLang
\newif\iffancybox
\newif\ifgraphics
\newif\iftheorem
%%HM	\DeclareOption{English}{\Langtrue}
\DeclareOption{FVerb}{\fancyboxtrue}
\DeclareOption{useeps}{\graphicstrue}
\DeclareOption{theorem}{\theoremtrue}
\ProcessOptions\relax
\iffancybox\RequirePackage{fancybox}\fi
\ifgraphics\RequirePackage[dvips]{graphics}\fi
\iftheorem\RequirePackage{theorem}\fi
%
%%  Page dimensions
%
\newcounter{@paper}	%%HM addition
\setcounter{@paper}{1}%
\setlength\paperheight{296mm}
\setlength\paperwidth{210mm}
%%HM%\tombowtrue \tombowdatetrue
%%HM\tombowfalse
%%HM\setlength{\@tombowwidth}{.1\p@}%
%%HM\@bannertoken{%
%%HM  \jobname\space:\space\number\year/\number\month/\number\day
%%HM   (\number\hour:\number\minute)}
%%HM%\maketombowbox
\textheight=226mm
\textwidth=160mm
\topmargin=-7mm
\oddsidemargin=-1mm
%\setlength{\hoffset}{-0.5in}
\setlength{\evensidemargin}{\oddsidemargin}
\footnotesep=9pt
%
  \global\parindent=1.5em \global\leftmargini=1.5em
  \global\leftmarginii=1.25em \global\leftmarginiii=1.0em
  \global\leftmarginiv=1.0em \global\leftmarginv=1.0em
  \global\baselineskip=12pt
  \gdef\the@ck{Acknowledgements}
  \gdef\the@ref{References}
  \global\let\@endaddress\@empty %%%% Fujimura
  \global\let\endaddress\relax %%%% Fujimura
  \iftheorem
  \theoremstyle{break} \newtheorem{Th}{Theorem}
  \theoremstyle{break} \newtheorem{Pro}[Th]{Proposition}
  \theoremstyle{break} \newtheorem{Lem}[Th]{Lemma}
  \theoremstyle{break} \newtheorem{Cor}[Th]{Corollary}
  \theoremstyle{break} \newtheorem{Def}[Th]{Definition}
  \theoremstyle{break} \newtheorem{Hyp}[Th]{Hypothesis}
  \theoremstyle{break} \newtheorem{Nte}{Notation}
  \theoremstyle{break} \newtheorem{Exp}{Example}
  \theoremstyle{break} \newtheorem{Rem}{Remark}
  \theoremstyle{break} \newtheorem{Prob}{Problem}
  \theoremstyle{break} \newtheorem{Alg}{Algorithm}
  \newenvironment{Proof}%
  {\par{\bf Proof }}{\hfill\hbox{\rule[-2pt]{3pt}{6pt}}\par}
  \fi
  \renewcommand\figurename{Figure}
  \renewcommand\listfigurename{List of Figures}
  \renewcommand\tablename{Table}
  \renewcommand\listtablename{List of Tables}
%
%% Define some macros
%
\ifgraphics%
  \def\Eps#1{\includegraphics{#1}}
\fi
\iffancybox%
  \newenvironment{FVerb}[1]%
{\VerbatimEnvironment%
  \begin{Sbox}\begin{minipage}{#1}\begin{Verbatim}}%
      {\end{Verbatim}\end{minipage}\end{Sbox}%
  \setlength{\fboxsep}{3mm}\vspace*{4mm}\fbox{\TheSbox}}
\fi
\long\def\ifundefined#1#2#3{%
 \expandafter\ifx\csname #1\endcsname\relax #2\else #3\fi}
%%\def\affil#1{\\[-1.5ex]\small #1}
\def\affil#1{\\ #1}
\def\address#1{\\#1} %%%%%%%%%%%%%%%%% Fujimura
\def\mail#1{\\E-mail address: {\tt #1}} %%%%%%%%%%%%%%%%% Fujimura
\def\kanjidata#1{\\ \ \hfill{#1}\\} %%%%%%%%%%%%%%%%%%%%%% Fujimura
%%\def\ename#1{\\[-1.5ex]\footnotesize\scshape #1}
%%\def\eaffil#1{\\[-1.5ex]\footnotesize\scshape #1}
\def\ename#1{\\[-1.5ex]\normalsize\scshape #1}
\def\eaffil#1{\\[-0.5ex]\normalsize\scshape #1}
\def\author#1{\gdef\@author{#1}}
\def\endaddress#1{\gdef\@endaddress{#1}} %%%%%%%%%%%% Fujimura
\def\etitle#1{\gdef\@etitle{#1}}
\def\thefootnote{\arabic{footnote})}
%\def\art#1{\gdef\@art{#1}}
\def\year#1{\gdef\@year{#1}}
\gdef\StartPage#1{\gdef\@SPage{#1}}
\gdef\EndPage#1{\gdef\@epage{#1}}
\def\vol#1{\gdef\@vol{#1}}
\def\num#1{\gdef\@num{#1}}
\def\dg{\textbf}
\def\abstractname{Abstract}
\gdef\received#1{\gdef\@received{#1}}
\gdef\revised#1{\gdef\@revised{#1}}
%
% Define some fonts
%
% AMSFonts and AMSSymbols
\font\msbmbbs=msbm10
\font\msbmbb=msbm10 scaled \magstep1
\def\Bbb#1{\mbox{\msbmbb\relax#1}}
\def\Bbbs#1{\mbox{\msbmbbs\relax#1}}
\def\JSSAC{\textit{JSS\hspace{-0.2ex}A\hspace{-0.3ex}C} }
%
\newcommand{\C}{\Bbb C}
\newcommand{\R}{\Bbb R}
\newcommand{\Q}{\Bbb Q}
\newcommand{\Z}{\Bbb Z}
\newcommand{\N}{\Bbb N}
\newcommand{\SC}{\hbox{\footnotesize \Bbb C}}
\newcommand{\SR}{\hbox{\footnotesize \Bbb R}}
\newcommand{\SQ}{\hbox{\footnotesize \Bbb Q}}
\newcommand{\SZ}{\hbox{\footnotesize \Bbb Z}}
\newcommand{\SN}{\hbox{\footnotesize \Bbb N}}
\newcommand{\qed}{\hbox{\rule[-2pt]{3pt}{6pt}}}
%
\def\thebibliography#1{
  \section*{\hfil\the@ref\hfill}
  \list {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}
    \leftmargin\labelwidth
    \advance\leftmargin\labelsep\parsep=0pt
    \usecounter{enumi}}
  \def\newblock{\hskip .11em plus .33em minus .07em}
  \sloppy\clubpenalty4000\widowpenalty4000\sfcode`\.=1000
  \relax}
\def\endthebibliography{\global\advance\@listdepth\m@ne\endtrivlist}
\def\acknowledgements#1{\section*{\hbox to\hsize{\hss\the@ck\hss}}#1}
\def\endacknowledgements{\par}
%%HM addition
\def\ps@eplain{%
  \def\@oddhead{}
  \def\@oddfoot{\footnotesize\hfil{\Roman{PartNumber}-\thepage}\hfil}
}
\def\ps@rims{%
%%HM ...
\ifEditor%
  \def\@oddhead{\setcounter{TotalPage}{\value{page}}%
	\addtocounter{TotalPage}{-1}%
	\addtocounter{TotalPage}{\@SPage}%
	\footnotesize\hfil\textit{\theTotalPage}}
  \def\@evenhead{\setcounter{TotalPage}{\value{page}}%
	\addtocounter{TotalPage}{-1}%
	\addtocounter{TotalPage}{\@SPage}%
	\footnotesize\textit{\theTotalPage}\hfil}
  \def\@oddfoot{\footnotesize\hfil{\Roman{PartNumber}-\thepage}\hfil}%
  \def\@evenfoot{\footnotesize\hfil{\Roman{PartNumber}-\thepage}\hfil}%
\else
  \def\@oddfoot{\footnotesize\hfil{\thepage}\hfil}%
  \def\@evenfoot{\footnotesize\hfil{\thepage}\hfil}%
\fi
%%... end of HM
}
\def\maketitle{%
  \ifundefined{@year}{\gdef\@year{200X}}{}
  \ifundefined{@vol}{\gdef\@vol{XX}}{}
  \ifundefined{@num}{\gdef\@num{XX}}{}
  \ifundefined{@SPage}{\gdef\@SPage{1}}{}
  \ifundefined{@epage}{\gdef\@epage{XXX}}{}
  \par
  \begingroup
  \def\thefootnote{\fnsymbol{footnote}}%
  \def\@makefnmark{\hbox to 3pt{$^{\@thefnmark}$\hss}}%
  \ifEditor\thispagestyle{eplain}\else\thispagestyle{plain}\fi
  \@maketitle%
  \@thanks%
  \endgroup
  \setcounter{footnote}{0}
  \let\maketitle=\relax
  \let\@maketitle=\relax
  \let\thanks=\relax
  }
\def\@maketitle{%
%  \let\mail\thanks  %%%%%%%%%%%%%%%% commented out by Fujimura
  \null
%%%%
  \begin{center}
    {\LARGE \bf \@title \par}
   \ifundefined{\@etitle}{}%
    {\Large (\@etitle) \par}\vskip 1.5em%
%%HM    {\Large \lineskip .5em \begin{tabular}[t]{c}\@author\end{tabular}\vskip .5em}
   \renewenvironment{tabular}[2][]{\begin{center}}{\end{center}} %%%%% Fujimura
   {\Large \lineskip .5em \begin{tabular}[t]{c}\@author\end{tabular}\vskip .5em}
%    \ifundefined{@received}{}%
%    {\vskip 1.5em \footnotesize\sc (Received \@received %
%      \ifundefined{@revised}{)}{\ \ \footnotesize\sc Revised \@revised)}
%      }
  \end{center}
  \par
  \vskip 1.5em}
%%%%%%%%%%%%%%%% Author's data on the end papge %%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%% Fujimura %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  \AtEndDocument{%
      \renewenvironment{tabular}[2][]{\begin{minipage}{\textwidth}}%
                                     {\end{minipage}}%
        \vskip 3em
        \noindent\begin{tabular}{l}\@endaddress\end{tabular}%
    }
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\@twosidetrue
%
%% Editors Session
%
\newcounter{PP}
\newcounter{TotalPage}		%%HM
\newcounter{PartNumber}		%%HM
\newif\ifPage%
\newif\ifEditor%
\newif\ifEndWithEvenP%
\IfFileExists{../vol.tex}{\Editortrue}{\Editorfalse}
\IfFileExists{Page.tex}{\Pagetrue}{\Pagefalse \Editorfalse}
\def\NoPage{%
  \newwrite\OutTouch\immediate\openout\OutTouch=NoPage.tex\closeout\OutTouch}
%%HM\def\OddStart{\relax}
\def\ignore#1{{#1}}
\global\let\ndocument\document%
\global\let\nenddocument\enddocument%
\ifEditor
	\input ../vol.tex
\fi
\ifPage
  \input Page.tex
\fi
\ifEditor\EndWithEvenPtrue\else\EndWithEvenPfalse\fi
%%% specification of RIMS
\EndWithEvenPfalse
%%\IfFileExists{headline.tex}{\ifEditor{\include{headline}}\fi}{}
\ifEditor{\typeout{******** Editor Mode ********}%
  \newwrite\OutPut
  \immediate\openout\OutPut=Page.tex
  \gdef\partnumberout#1{%
    \immediate\write\OutPut{\string
      \setcounter{PartNumber}{#1}}}
  \gdef\spageout#1{%
    \immediate\write\OutPut{\string
      \StartPage{#1}}}
  \gdef\epageout#1{%
    \immediate\write\OutPut{\string
      \EndPage{#1}}}
  \long\gdef\document{%
    \ndocument%
    \pagestyle{rims}
    \partnumberout{\thePartNumber}
%%HM    \setcounter{page}{\@SPage}
    \setcounter{TotalPage}{\@SPage}
    \maketitle
%%HM    \spageout{\thepage}}
    \spageout{\theTotalPage}}
  \gdef\enddocument{%
%%HM    \epageout{\thepage}
    \setcounter{TotalPage}{\value{page}}
    \addtocounter{TotalPage}{\@SPage}
    \addtocounter{TotalPage}{-1}
    \epageout{\theTotalPage}
    \closeout\OutPut
%%HM    \IfFileExists{NextOdd.tex}{\ifodd\thepage{\clearpage��}\fi}{}
    \ifEndWithEvenP{\ifodd\value{page}{\clearpage��}\fi}\fi
    \newcount\PP
    \newwrite\Plist
%%HM    \PP=\thepage
    \setcounter{TotalPage}{\value{page}}
    \addtocounter{TotalPage}{\@SPage}
    \addtocounter{TotalPage}{-1}
    \PP=\theTotalPage
    \advance \PP 1
    \immediate\openout\Plist=Next.pp
    \immediate\write\Plist{%
      \number\PP}
    \closeout\Plist
    \nenddocument}
}\fi
\etitle{}
\makeatother
