% 東北学院大学・工学会　工学部研究報告スタイルファイル
%                                          M.KUMAGAI 2013/11/13

\makeatletter
\oddsidemargin -5.4mm
\evensidemargin -5.4mm
\topmargin -5.1mm
\headheight 0mm
\headsep 0mm
\textwidth 170mm
\textheight 256.4mm
\columnsep 8mm

% タイトルなどの定義設定
\def\jtitle#1{\def\@jtitle{#1}}
\def\jsubtitle#1{\def\@jsubtitle{#1}}
\def\etitle#1{\def\@etitle{#1}}
\def\esubtitle#1{\def\@esubtitle{#1}}
\long\def\abstract#1{\def\@abstract{#1}}
\def\keywords#1{\def\@keywords{#1}}
\def\authors#1{\def\@authors{#1}}
\def\affiliations#1{\def\@affiliations{#1}}

\def\framemark{\def\@framemark{1}\typeout{--- margin frame displayed ---}}
%\def\authoritem#1#2#3{\hbox{\vbox to 1.5\baselineskip{\hbox{#1}\vss\hbox{#2}}}}
\def\authoritem#1#2#3{\def\thefootnote{#3}\begin{tabular}{c}#1\footnotemark[1]\\#2\end{tabular}}
\def\affiliationitem#1#2{\def\thefootnote{#1}\footnotetext{#2}}

\def\EnglishStyle{\def\@engstyle{1}\typeout{--- English style format ---}}

\def\typeofpaper#1{\def\@typeofpaper{#1}}
\typeofpaper{指定なし}

% タイトル作成
\def\maketitle{%
  \twocolumn[\centering%
  \begin{minipage}{160mm}\centering\vskip 10mm%
  \@ifundefined{@engstyle}{% JP
    {\LARGE {\bf {\@jtitle}}}\\
    \@ifundefined{@jsubtitle}{}{{\vskip 0.5\baselineskip \Large {\bf {\@jsubtitle}}}\\}\vskip 1.0\baselineskip
    {\Large {\bf {\@etitle}}}\\
    \@ifundefined{@esubtitle}{}{{\vskip 0.5\baselineskip \large {\bf {\@esubtitle}}}\\\vskip 1.0\baselineskip}
  }{% ENG
    {\LARGE {\bf {\@etitle}}\def\thefootnote{*}\footnotemark[1]}\\
    \@ifundefined{@esubtitle}{}{{\vskip 0.5\baselineskip \Large {\bf {\@esubtitle}}}\\\vskip 1.0\baselineskip}
  }%
  \@ifundefined{@engstyle}{
    \def\authoritem##1##2##3{\def\thefootnote{##3}\begin{tabular}{c}##1\footnotemark[1]\\##2\end{tabular}}
  }{
    \def\authoritem##1##2##3{\def\thefootnote{##3}\begin{tabular}{c}##2\footnotemark[1]\end{tabular}}
  }
  \@authors\\
  \end{minipage}\\\vskip 2\baselineskip%
  %
  \begin{minipage}{160mm}\noindent{\bf Abstract:~ }
  \@ifundefined{@abstract}{\typeout{=== WARNING: NO ABSTRACT(max.200 words) ===}No abstract. Abstract must be written within 200 words.}{%
  \@abstract}\par\vskip \baselineskip%
  \noindent{\bf Keywords:~ }
  \@ifundefined{@keywords}{\typeout{=== WARNING: NO KEYWORD(max.5 keywords) ===}No keywords. }{%
  \@keywords}
  \end{minipage}\\\vskip 2\baselineskip
  ]%
  \@ifundefined{@engstyle}{
    \@affiliations
  }{
    \def\thefootnote{*}\footnotetext{\@jtitle}
    \def\authoritem##1##2##3{\def\thefootnote{##3}\footnotetext{##1}}
    \@authors
  }
  \setcounter{page}{1}
  \def\thefootnote{*\arabic{footnote}}\setcounter{footnote}{0}
  %
  \@ifundefined{@engstyle}{
    \def\reffig##1{{\bf 図\ref{##1}}}
    \def\reffigure##1{{\bf 図\ref{##1}}}
    \def\reftab##1{{\bf 表\ref{##1}}}
    \def\refeqn##1{(\ref{##1})}
  }{
    \def\reffig##1{{\bf Fig.\,\ref{##1}}}
    \def\reffigure##1{{\bf Figure\,\ref{##1}}}
    \def\reftab##1{{\bf Table\,\ref{##1}}}
    \def\refeqn##1{(\ref{##1})}
    \renewcommand{\figurename}{Fig.}
    \renewcommand{\tablename}{Table }
  }
}

\def\topfraction{0.99}
\def\bottomfraction{0.99}
\def\textfraction{0.01}
\def\floatpagefraction{0.99}
\def\dbltopfraction{0.99}
\def\dblfloatpagefraction{0.99}


\input{fancybox.sty}
\def\marginframe{%
\put(  0,  0){\circle{2}}
\put(210,  0){\circle{2}}
\put(  0,297){\circle{2}}
\put(210,297){\circle{2}}
%
\put(20,20){\dashbox(170,257){}}
\put(  0,100){\vector( 1,0){20}}\put(9,103){20mm}
\put(210,100){\vector(-1,0){20}}\put(191,103){20mm}
\put( 65,  0){\vector( 0,1){20}}\put(70,15){20mm}
\put( 95,297){\vector(0,-1){20}}\put(100,279){20mm(1ページ目以外)}
%
\put(105,15){\vector( 1,0){4}}
\put(105,15){\vector(-1,0){4}}
\put(110,15){8mm}
}
\def\marginframefirst{%
\multiput( 25,267)(0,-3){30}{\line(0,1){2}}
\multiput(185,267)(0,-3){30}{\line(0,1){2}}
\multiput( 20,267)(3, 0){57}{\line(1,0){2}}
%
\put(  0,250){\vector( 1,0){25}}\put(9,253){25mm}
\put(210,250){\vector(-1,0){25}}\put(191,253){25mm}
\put( 85,297){\vector(0,-1){30}}\put(90,269){30mm(1ページ目タイトル上端)}
%
}

\def\typeframe#1{\frame{$\vcenter{\kern1.0mm\hbox to27mm{\hss\frame{\vbox to6.5mm{\vss\hbox to25mm{\hss #1\hss}\vss}}\hss}\kern1.0mm}$}}
\fancyput(-25.4mm,-271.6mm){%
\setlength{\unitlength}{1mm}\begin{picture}(210,297)(0,0)
\@ifundefined{@framemark}{}{\marginframe%
\multiput(101,10)(0,3){89}{\line(0,1){2}}%
\multiput(109,10)(0,3){89}{\line(0,1){2}}}
\end{picture}
}
\thisfancyput(-25.4mm,-271.6mm){%
\setlength{\unitlength}{1mm}\begin{picture}(210,297)(0,0)%
\put(20,268.4){\typeframe{\bf \@typeofpaper}}%
\@ifundefined{@framemark}{}{\marginframe\marginframefirst%
\multiput(101,10)(0,3){40}{\line(0,1){2}}%
\multiput(109,10)(0,3){40}{\line(0,1){2}}}
\end{picture}%
}

% セクション類のパラメータ調整
% jarticle.clsより
\renewcommand{\section}{\@startsection{section}{1}{\z@}%
   {1\Cvs \@plus.2\Cvs \@minus.1\Cvs}%
   {.2\Cvs \@plus.1\Cvs}%
   {\reset@font\Large\bfseries}}
\renewcommand{\subsection}{\@startsection{subsection}{2}{\z@}%
   {0.75\Cvs \@plus.2\Cvs \@minus.1\Cvs}%
   {.1\Cvs \@plus.05\Cvs}%
   {\reset@font\large\bfseries}}
\renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{\z@}%
   {0.5\Cvs \@plus.05\Cvs \@minus.05\Cvs}%
   {0.01\Cvs \@plus.01\Cvs}%
   {\reset@font\normalsize\bfseries}}

% 参考文献形式
\renewcommand{\@biblabel}[1]{[#1]}
\renewcommand{\@cite}[2]{[#1\if@tempswa , #2\fi]}

\pagestyle{empty}
\makeatother
