%----------------------------------------%
% 静岡理工科大学紀要スタイルファイル
% by Tomonori Kouya
%
%     Version 0.1, 2001/02/26 : とりあえず作った
%     Version 0.2, 2001/02/27 : ちょっと修正
%     Version 0.3, 2001/02/27 : ちょっと修正(footnote,description環境)
%     Version 0.4, 2004/11/01 : A4版向けに修正
%     Version 0.5, 2005/02/20 : list環境にバグあり，修正
%     Version 0.5a,2005/02/21 : 紀要正式フォーマットに対応
%----------------------------------------%
\NeedsTeXFormat{pLaTeX2e}
\ProvidesFile{sistbul.sty}[2004/11/01 v0.4 : Tomonori Kouya]
\@twocolumntrue % 2段組
\pagestyle{empty}

%----------------------------------------%
% 使い方:
%    \documentclass[a4j]{jarticle} % "[a4j]"は不要。逆に"[b5j]"としてもB5版にはなりません。
%    \usepackage{sistbul.sty} % <--このように読み込んで下さい。
%    \begin{document}
%        \title{論文タイトル(和文)}
%        \etitle{The title of paper(in English)}
%        \author{理工科太郎\affiliation{理工学部 情報システム学科}}
%        \eauthor{Taro RIKOUKA$^{*}$} % ここはちょっとみっともない
%        \date{2001年2月27日} % "2001年2月27日 受理"と脚注に表示される
%        \abstract{%
%            In this environment, the abstract of this paper is written in English.
%        }
%        \maketitle
%        ...(本文)...
%        \section{初めに} % 9ポイントゴチック(ホントは太明朝にしなきゃいけないらしい)
%        本論文の目的\cite{hogehoge}を述べる\footnote{脚注番号も修正済み。}。
%        \subsection{初めにの初めに} % 9ポイントゴチック
%        ...(本文)...
%        \begin{thebibliography}[9] % 1), 2) ...と表示される
%        \bibitem{hogehoge} ....
%        \end{thebibliography}
%    \end{document}
% 注意: pLaTeX2e以上でないと動きませんぜ，旦那。
%----------------------------------------%

%----------------------------------------%
% フォントサイズ設定
% 見出し・・・9ptゴシック
% 本文・・・9pt明朝
%----------------------------------------%
\renewcommand{\normalsize}{%
  \@setfontsize{\normalsize}{\@ixpt}{12.375}%
%  \@setfontsize\normalsize\@xpt{10}%
  \abovedisplayskip 9\p@ \@plus2\p@ \@minus3\p@
  \abovedisplayshortskip \z@ \@plus2\p@
  \belowdisplayshortskip 3\p@ \@plus2\p@ \@minus2\p@
   \belowdisplayskip \abovedisplayskip
   \let\@listi\@listI}
\normalsize
\setbox0\hbox{\char\euc"A1A1}%
\setlength\Cht{\ht0}
\setlength\Cdp{\dp0}
\setlength\Cwd{\wd0}
\setlength\Cvs{\baselineskip}
\setlength\Chs{\wd0}
\renewcommand{\small}{%
  \@setfontsize{\small}{\@viiipt}{11}%
  \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@
  \abovedisplayshortskip \z@ \@plus2\p@
  \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@
  \def\@listi{\leftmargin\leftmargini
              \topsep 4\p@ \@plus2\p@ \@minus2\p@
              \parsep 2\p@ \@plus\p@ \@minus\p@
              \itemsep \parsep}%
  \belowdisplayskip \abovedisplayskip}
\renewcommand{\footnotesize}{%
  \@setfontsize\footnotesize\@viipt{9.5}%
  \abovedisplayskip 6\p@ \@plus1\p@ \@minus2\p@
  \abovedisplayshortskip \z@ \@plus\p@
  \belowdisplayshortskip 2\p@ \@plus\p@ \@minus1\p@
  \def\@listi{\leftmargin\leftmargini
              \topsep 1\p@ \@plus\p@ \@minus\p@
              \parsep 1\p@ \@plus\p@ \@minus\p@
              \itemsep \parsep}%
  \belowdisplayskip \abovedisplayskip}
\renewcommand{\scriptsize}{\@setfontsize\scriptsize\@vipt\@viiipt}
\renewcommand{\tiny}{\@setfontsize\tiny\@vpt\@vipt}
\renewcommand{\large}{\@setfontsize\large\@xiipt{10.5}}
\renewcommand{\Large}{\@setfontsize\Large\@xivpt{12}}
\renewcommand{\LARGE}{\@setfontsize\LARGE\@xviipt{12}}
\renewcommand{\huge}{\@setfontsize\huge\@xxpt{12}}
\renewcommand{\Huge}{\@setfontsize\Huge\@xxvpt{12}}

%----------------------------------------%
% 書式指定: 
%	a4版
%	margine: 上25mm, 下20mm, 左20mm, 右20mm
%	1行24文字・１ページ6行49
%	ページ数なし
%----------------------------------------%
%\setlength\paperheight {297mm}%
%\setlength\paperwidth  {210mm}%

\setlength{\voffset}{0pt}
\setlength{\hoffset}{0pt}
\setlength{\topmargin}{0cm} % 1inch(2.54cm) - 0.04cm
\setlength{\headheight}{0pt} % ヘッダなし
\setlength{\headsep}{0pt} % ヘッダと本文との空きなし
\setlength{\oddsidemargin}{-.54cm} % 1inch(2.54cm) - 0.54cm
\setlength{\evensidemargin}{-.54cm} % 1inch(2.54cm) - 0.54cm
\setlength{\baselineskip}{1.5zw}
\setlength{\parindent}{1zw}
\setlength{\textheight}{54\baselineskip}
\setlength{\textwidth}{55.5zw}
\addtolength{\textheight}{\topskip}

%----------------------------------------%
% fnsymbolの変更
% 	脚注は全て"*"の羅列が前に付く
%----------------------------------------%
\def\@fnsymbol#1{\ensuremath{\ifcase#1\or *\or **\or ***\or
   ****\or *****\or ******\or *******\or ********
   \or ********* \else\@ctrerr\fi}}

%----------------------------------------%
% 脚注・図・表・文献参照番号など
%----------------------------------------%
\@addtoreset{footnote}{page} % 脚注はページごとにリセット
\def\thefootnote{\@fnsymbol\c@footnote}
\renewcommand{\figurename}{Fig.}
\renewcommand{\tablename}{Table }
\def\@cite#1{\textsuperscript{#1)}}
\def\@biblabel#1{\inhibitglue #1) \inhibitglue}

%----------------------------------------%
% タイトル書式
%----------------------------------------%
  \def\etitle#1{\gdef\@etitle{#1}} % 英文タイトル
  \def\eauthor#1{\gdef\@eauthor{#1}} % 著者ローマ字
  \def\date#1{\gdef\@date{#1 受理}} % 日付
  \def\abstract#1{\gdef\@abstract{#1}} % 英文タイトル
  \def\and{\ and\ }
  \newif\ifFirstAffiliation % 最初のAffliationでは\dateを出力
  \let\ifFirstAffliation\iftrue %
  \def\@FirstAffliationTrue{\let\ifFirstAffliation\iftrue}%
  \def\@FirstAffliationFalse{\let\ifFirstAffliation\iffalse}%
  \def\affiliation#1{%
    \ifFirstAffliation
      \protected@xdef\@thanks{\@thanks
	\protect\footnotetext[0]{\@date}}%
      \@FirstAffliationFalse %
      \footnotemark
      \protected@xdef\@thanks{\@thanks
        \protect\footnotetext[\the\c@footnote]{#1}}%
    \else
      \footnotemark
      \protected@xdef\@thanks{\@thanks
        \protect\footnotetext[\the\c@footnote]{#1}}%
    \fi
}
  \西暦
  \renewcommand{\maketitle}{\par
  \begingroup
%    \renewcommand{\thefootnote}{\fnsymbol{footnote}}%
%    \def\@makefnmark{\hbox{\ifydir $\m@th^{\@thefnmark}$
%      \else\hbox{\yoko$\m@th^{\@thefnmark}$}\fi}}%
%     \long\def\@makefntext##1{\parindent 1em\noindent
%       \hbox to1.8em{\hss$\m@th^{\@thefnmark}$}##1}%
%    \if@twocolumn
%      \ifnum \col@number=\@ne \@maketitle
%      \else \twocolumn[\@maketitle]%
%      \fi
%
%    \else
%      \newpage
%      \global\@topnum\z@   % Prevents figures from going at top of page.
%      \@maketitle
%    \fi
     \twocolumn[\@maketitle]%
%     \thispagestyle{jpl@in}\@thanks
     \thispagestyle{empty}\@thanks
  \endgroup
  \setcounter{footnote}{0}%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\p@thanks\relax
  \global\let\@thanks\@empty
  \global\let\@author\@empty
  \global\let\@eauthor\@empty
  \global\let\@date\@empty
  \global\let\@title\@empty
  \global\let\@etitle\@empty
  \global\let\@abstract\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\etitle\relax
  \global\let\eauthor\relax
  \global\let\abstract\relax
  \global\let\date\relax
  \global\let\and\relax
  }
  \def\@maketitle{%
  \newpage\null
  \vskip 2em%
  \begin{center}%
%    \def\@makefnmark{}%
%    \long\def\@makefntext##1{##1}%
%   \let\footnote\@date
%    \def\@makefnmark{\hbox{\ifydir $\m@th^{\@thefnmark}$
%      \else\hbox{\yoko$\m@th^{\@thefnmark}$}\fi}}%
%     \long\def\@makefntext##1{\parindent 1em\noindent
%       \hbox to1.8em{\hss$\m@th^{\@thefnmark}$}##1}%
%  \let\footnote\thanks
    {\Large\bf \@title \par}%
    \vskip 3mm %
    {\large \@etitle \par}%
    \vskip 5mm %
    {\large\lineskip .5em%
      \begin{tabular}[t]{c}%
        \@author
      \end{tabular}\par}%
    \vskip 2mm %
    {\large\begin{tabular}[t]{c}%
        \@eauthor
      \end{tabular}\par}%
  \end{center}%
\begin{quote}Abstract: \@abstract\end{quote}
\thispagestyle{empty}
  \par\vskip 1.5em\thispagestyle{empty}
}

%----------------------------------------%
% 節・小節・・・
%----------------------------------------%
\renewcommand{\section}{\@startsection{section}{1}{\z@}%
   {1.0\Cvs \@plus.5\Cdp \@minus.2\Cdp}%
   {.1\Cvs \@plus.3\Cdp}%
   {\reset@font\normalsize\bfseries}}
\renewcommand{\thesection}{\@arabic\c@section.}
\renewcommand{\subsection}{\@startsection{subsection}{2}{\z@}%
   {.5\Cvs \@plus.5\Cdp \@minus.2\Cdp}%
   {.1\Cvs \@plus.3\Cdp}%
   {\reset@font\normalsize\bfseries}}
\renewcommand{\thesubsection}{\@arabic\c@section.\@arabic\c@subsection}
\renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}%
   {.2\Cvs \@plus.5\Cdp \@minus.2\Cdp}%
   {.1\Cvs \@plus.3\Cdp}%
   {\reset@font\normalsize\bfseries}}
\renewcommand{\paragraph}{\@startsection{paragraph}{4}{\z@}%
   {3.25ex \@plus 1ex \@minus .2ex}%
   {-1em}%
   {\reset@font\normalsize\bfseries}}
\renewcommand{\subparagraph}{\@startsection{subparagraph}{5}{\z@}%
   {3.25ex \@plus 1ex \@minus .2ex}%
   {-1em}%
   {\reset@font\normalsize\bfseries}}
\renewcommand{\appendix}{\par
  \setcounter{section}{0}%
  \setcounter{subsection}{0}%
  \renewcommand{\thesection}{\@Alph\c@section}}

%----------------------------------------%
% リスト
%----------------------------------------%
\def\@listi{\leftmargin\leftmargini
  \parsep 2\p@ \@plus1\p@ \@minus\p@
  \partopsep\z@
  \topsep 12\p@ \@plus1\p@ \@minus4\p@
  \itemsep\z@}
\let\@listI\@listi
\@listi
\def\@listii{\leftmargin\leftmarginii
   \labelwidth\leftmarginii \advance\labelwidth-\labelsep
   \topsep\z@
   \parsep\z@
   \partopsep\z@
   \itemsep\parsep}
\def\@listiii{\leftmargin\leftmarginiii
   \labelwidth\leftmarginiii \advance\labelwidth-\labelsep
   \topsep\z@
   \parsep\z@
   \partopsep\z@
   \itemsep\topsep}
\def\@listiv {\leftmargin\leftmarginiv
              \labelwidth\leftmarginiv
              \advance\labelwidth-\labelsep}
\def\@listv  {\leftmargin\leftmarginv
              \labelwidth\leftmarginv
              \advance\labelwidth-\labelsep}
\def\@listvi {\leftmargin\leftmarginvi
              \labelwidth\leftmarginvi
              \advance\labelwidth-\labelsep}

%----------------------------------------%
% enumerate, itemize, description
%----------------------------------------%
\renewenvironment{enumerate}
  {\ifnum \@enumdepth >\thr@@\@toodeep\else
   \advance\@enumdepth\@ne
   \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
   \list{\csname label\@enumctr\endcsname}{%
      \iftdir
         \topsep\z@
         \parskip\z@ \itemsep\z@ \parsep\z@
         \labelwidth1zw \labelsep.3zw
         \ifnum \@enumdepth=\@ne \leftmargin1zw\relax
           \else\leftmargin\leftskip\fi
         \advance\leftmargin 1zw
      \fi
         \usecounter{\@enumctr}%
         \def\makelabel##1{\hss\llap{##1}}}%
   \fi}{\endlist}
\renewenvironment{itemize}
  {\ifnum \@itemdepth >\thr@@\@toodeep\else
   \advance\@itemdepth\@ne
   \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
   \expandafter
   \list{\csname \@itemitem\endcsname}{%
      \iftdir
         \topsep\z@
         \parskip\z@ \itemsep\z@ \parsep\z@
         \labelwidth1zw \labelsep.3zw
         \ifnum \@itemdepth =\@ne \leftmargin1zw\relax
           \else\leftmargin\leftskip\fi
         \advance\leftmargin 1zw
      \fi
         \def\makelabel##1{\hss\llap{##1}}}%
   \fi}{\endlist}
\renewenvironment{description}{% by okumura haruhiko
  \list{}{%
    \labelwidth=\leftmargin
    \labelsep=1zw
    \advance \labelwidth by -\labelsep
    \let \makelabel=\descriptionlabel}}{\endlist}

