% LateX Class File for ``JJSCS''
%    published by Japanese Society of Computational Statistics
%
% jscs.cls  version 0.9.2:  June. 2003
%    modified from jscs.sty by Tsuneshi OBATA obata@csis.oita-u.ac.jp
% jscs.sty    version 0.5.2: Apr.1993 
%    by Naoto NIKI niki@ms.kagu.sut.ac.jp
%
% Usage::
%   options{defaults}:
%     \def\publyear{200x}       % year of publishing
%     \def\startpage{1}         % start page number
%     \def\endpage{AUTOMATIC}   % end page number
%     \def\volume{xx}           % volume 
%     \def\issuenumber{xx}      % number (now no effect)
%     \def\received{}           % month and year when received  
%     \def\revised{}            % month and year when revised  
%     \def\ehead{J.J.Soc....}   % header for even pages
%     \def\ohead{Compiled ...}  % header for odd pages
%     \def\within{}             % seq num of theorems has \within num 
%     \def\notupper{}           % title consists of capitals unless set  
%   declaration of document style:
%     \documentstyle[jscs]{article}
%
\ProvidesClass{jscs}[2003/06/05]

\RequirePackage{latexsym}
\LoadClassWithOptions{article}

\hoffset=1cm % These values shift the printing position.
\voffset=0pt % Adjust them for your printer.
%
%%  Page dimensions
\oddsidemargin=0pt
\evensidemargin=0pt
\textwidth=140mm
\textheight=200mm
\parindent=2em
\baselineskip=12pt
%
\catcode`\@=11
%
%% Backend
%
\long\def\ifundefined#1#2#3{%
 \expandafter\ifx\csname #1\endcsname\relax #2\else #3\fi}
\def\default#1#2{\expandafter\ifx\csname #1\endcsname\relax
 #2\else\csname #1\endcsname\fi}
%
\def\@fnsymbol#1{
  \ifcase #1\or *\or \dagger \or \ddagger 
     \or \mathchar "278\or \mathchar "27B\or \|
     \or **\or \dagger \dagger \or \ddagger \ddagger
     \or \null
  \else \@ctrerr \fi \relax} % add 10-th symbol \null
%
\def\nomarkthanks#1{
  \begingroup 
    \def\protect{\noexpand \protect \noexpand }
    \xdef \@thanks{\@thanks \protect \footnotetext[10]{#1}}
  \endgroup}
%% For editing use
\edef\jcsyear{\default{publyear}{200x}}
\edef\jcspage{\default{startpage}{1}}
\def\jcsendpage{\default{endpage}{\pageref{end@page}}}
\edef\jcsvol{\default{volume}{xx}}
\edef\jcsnum{\default{issuenumber}{xx}}
\setcounter{page}{\jcspage}
\expandafter\mark{
 {\default{ehead}{J.~Jpn.~Soc.~Comput.~Statist., Vol.~\jcsvol, \jcsyear}}
 {\default{ohead}{Compiled on \today}}}
%
%% Header and Footer
\def\pagebox#1{\hbox to 4em{#1}}
\def\ps@myheadings{\let\@mkboth\markboth
 \def\@oddhead{\small\pagebox{\hss}
  \hfil\rm\rightmark\hfil\pagebox{\hss}}
 \def\@oddfoot{\hss\rm-- \thepage{} --\hss}
 \def\@evenhead{\small\pagebox{\hss}
  \hfil\rm\leftmark\hfil\pagebox{\hss}}
 \let\@evenfoot\@oddfoot
 \def\sectionmark##1{}
 \def\subsectionmark##1{}}
\def\ps@titleheadings{\let\@mkboth\markboth
 \advance\headheight1.5ex\advance\headsep-1.5ex
 \def\@oddhead{{\it J.~Jpn.~Soc.~Comp.~Statist.},
  {\bf\jcsvol}(\jcsyear), \jcspage--\jcsendpage\hfil}
 \def\@oddfoot{}
 \def\@evenhead{}
 \def\@evenfoot{}
 \def\sectionmark##1{}
 \def\subsectionmark##1{}}
\@twosidetrue
\pagestyle{myheadings}
%
%% Title style
\def\affil#1{\thanks{#1} }
\ifundefined{notupper}{%
 \def\title#1{\gdef\@title{\uppercase{#1}}}
}{\relax}
\def\author#1{\gdef\@author{#1}}
\def\keywords#1{\gdef\@keywords{#1}}
\def\pages#1#2#3#4#5{\gdef\@pages{%
	Text (#1), References (#2), Tables (#3), Figures (#4), Total (#5)}}
\def\abbrtitle#1{\gdef\@abbrtitle{#1}}
\def\correspond#1{\gdef\@correspond{#1}}
%
\def\maketitle{\par
 \begingroup
  \def\thefootnote{\fnsymbol{footnote}}
  \def\@makefnmark{\hss$^{\@thefnmark}$} 
  \newpage
  \global\@topnum\z@\@maketitle
  \thispagestyle{titleheadings}\@thanks
 \endgroup
 \setcounter{footnote}{0}
 \let\maketitle\relax\let\@maketitle\relax
 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}
 \gdef\affil##1{(##1)}
 \gdef\and{ \\}
 \let\thanks\relax}
\def\@maketitle{\newpage\null
% Footnote style
  \def\@makefntext##1{\parindent 1em\noindent%
    \hbox to 0em{\@makefnmark}\@tempdima\columnwidth\advance%
    \@tempdima-2em\parbox[t]{\@tempdima}{##1}}
%
 \begin{center}
  {\large\bf\@title\par}\vskip5ex
  {\bf\lineskip.5em \begin{tabular}[t]{c}
    \@author\end{tabular}\par}
 \end{center}\par 
  \ifundefined{@keywords}{\message{JSCS Warning: No keywords.}}
   {\nomarkthanks{{\it Key words}: \@keywords}}
 \vskip1.5ex}
%
%% Abstract
\def\abstract{\small \begin{center}
    {\bf ABSTRACT\vspace{-.5em}\vspace{0pt}} 
  \end{center}  
  \list {}{\listparindent 2em \itemindent \listparindent 
    \rightmargin \leftmargin \parsep 0pt plus 1pt}
  \item []}
%
\def\endabstract{\endquotation\vskip 2.4em }
%
%% Section style
\def\@afterheading{
  \global \@nobreakfalse \everypar 
  {\if@nobreak \global \@nobreakfalse \clubpenalty \@M 
     \if@afterindent \else{\setbox 0=\lastbox }\fi 
  \else \clubpenalty \@clubpenalty\everypar {}\fi }}
\def\@sect#1#2#3#4#5#6[#7]#8{
  \ifnum #2>\c@secnumdepth \def \@svsec {}
  \else \refstepcounter {#1}
    \edef \@svsec {\csname the#1\endcsname .\hskip 0.5em}\fi 
  \@tempskipa #5\relax 
  \ifdim \@tempskipa >\z@ 
    \begingroup #6\relax \@hangfrom {\hskip #3\relax \@svsec} 
       {\interlinepenalty\@M #8\par } \endgroup 
    \csname #1mark\endcsname{#7}
    \addcontentsline {toc}{#1}{
      \ifnum #2>\c@secnumdepth
      \else \protect \numberline {\csname the#1\endcsname .\hskip 0.5em}\fi #7} 
  \else \def\@svsechd {#6\hskip #3\@svsec #8
    \csname #1mark\end csname{#7}
    \addcontentsline {toc}{#1}{
      \ifnum#2>\c@secnumdepth 
      \else \protect \numberline{\csname the#1\endcsname .\hskip 0.5em}\fi #7}}\fi
  \@xsect{#5}}
\def\section{\global\@noskipsecfalse
  \@startsection {section}{1}{\z@ }
   {-3.5ex plus -1ex minus -.2ex}{.8ex plus .2ex}{\bf }}
\def\subsection{\@startsection {subsection}{2}{\z@ }
  {2ex plus 0.5ex minus .2ex}{.4ex plus .1ex}{\bf }}
\def\subsubsection{\@startsection {subsubsection}{3}{\z@ }
  {1.5ex plus 0.3ex minus .1ex}{.2ex plus .1ex}{\bf }}
\def\appendix{\par\setcounter{section}{0}
  \setcounter{subsection}{0} \def\thesection{\Alph{section}.}}
%
\def\thebibliography#1{
\section*{\hbox to\hsize{\hss REFERENCES\hss}}
 \small
 \list{}{\labelwidth=0pt\leftmargin=2em
   \itemindent=-\leftmargin\parsep=0pt\itemsep=2pt
   \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\the@ck{Acknowledgements}
\def\acknowledgements#1{\section*{\hbox to\hsize{\hss\the@ck\hss}}#1}
\def\endacknowledgements{\par}
%
%% Equations
\abovedisplayskip=10.0pt plus 2.5pt minus 5.0pt
\abovedisplayshortskip=0.0pt plus 2.5pt
\belowdisplayskip=10.0pt plus 2.5pt minus 5.0pt
\belowdisplayshortskip=6.0pt plus 3.0pt minus 2.5pt
%
\def\eqnarray{\stepcounter{equation}\let\@currentlabel=\theequation
 \global\@eqnswtrue\global\@eqcnt\z@\tabskip\@centering 
 \let\\=\@eqncr $$\halign to \displaywidth\bgroup\@eqnsel 
 \hskip\@centering $\displaystyle\tabskip\z@{##}$&\global
 \@eqcnt\@ne\hfil ${{}##{}}$\hfil&\global\@eqcnt\tw@
 $\displaystyle\tabskip\z@{##}$
 \hfil\tabskip\@centering &\llap{##}\tabskip\z@\cr}
%
% AMSFonts and AMSSymbols
\ifundefined{Bbb}{\let\Bbb\bf}{}
\ifundefined{nmid}{
 \def\bc@ncel#1#2{\ooalign
  {$\hfil #1\mkern -1mu/\hfil $\crcr$#1#2$}}
 \def\notmid{\mathrel {\mathpalette \bc@ncel \mid }}
 \let\nmid\notmid
}{}
%
%% Table and Figure
\def\fnum@table{Table \thetable}
\def\fnum@figure{Fig.~\thefigure}
\long\def\@makecaption#1#2{\vskip10pt\setbox\@tempboxa\hbox{#1:\quad #2}
 \ifdim\wd\@tempboxa>\hsize #1:\quad #2\par
 \else\hbox to\hsize{\hfil\box\@tempboxa\hfil}\fi}
\def\fps@table{tbp}
\def\fps@figure{tbp}
%
%% Theorems
\def\@begintheorem#1#2{\it \trivlist
    \item [\hskip \labelsep {\bf #1\ #2}]}
%
\ifundefined{within}{%
 \newtheorem{theorem}{Theorem}
 \newtheorem{proposition}{Proposition}
 \newtheorem{definition}{Definition}
 \newtheorem{algorithm}{Algorithm}
 \newtheorem{lemma}{Lemma}
 \newtheorem{example}{Example}
 \newtheorem{corollary}{Corollary}
 \newtheorem{remark}{Remark}
}{%
 \newtheorem{theorem}{Theorem}[\within]
 \newtheorem{proposition}{Proposition}[\within]
 \newtheorem{definition}{Definition}[\within]
 \newtheorem{algorithm}{Algorithm}[\within]
 \newtheorem{lemma}{Lemma}[\within]
 \newtheorem{example}{Example}[\within]
 \newtheorem{corollary}{Corollary}[\within]
 \newtheorem{remark}{Remark}[\within]
}
%
\def\proof{\par\noindent {\it Proof.\hskip 0.5em}}
\def\qed{\nopagebreak\hfill\ensuremath{\Box}\par}
%
%% End of Document
\def\enddocument{\@checkend{document}
 \ifundefined{received}{\relax}
   {\par\vskip10pt minus 4pt\flushright{(Received \received%
    \ifundefined{revised}{)}{; Revised \revised)}}}
 \def\@currentlabel{1}\label{end@page}
 \clearpage\@twosidefalse
 \begingroup\if@filesw\immediate\closeout\@mainaux
 \def\global\@namedef##1##2{}
 \def\newlabel{\@testdef r}
 \def\bibcite{\@testdef b}\@tempswafalse\makeatletter
 \input\jobname.aux
 \if@tempswa\@warning{Label(s) may have changed. 
 Rerun to get cross-references right}\fi\fi\endgroup\deadcycles\z@\@@end}
%
\catcode`\@=\active
%----------------- end of file ------------
