% JSDDADD VERSION 1.00 <2000/06/23>
%
% Copyright (C) JSME
%  Below here, new command for jsddadd.sty for jsmeddpaper.sty. but these 
%  command are also available under normal jarticle style document.
%
%   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   %      maketitle and  others           %(redefinition)
%   %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% [ Various parts such as \@@etitle, \@@keywords, vskip values are
%   customized by Kikuo Fujita, Osaka University ]: 
%
%  my titlepage:
%
% Title has both items in English and Japanese. These items may be placed
% in anywhere before \maketitle.
%
%  \begin{document}
%  \jtitle      \etitle{ .... }
%  \jauthor     \eauthor{ ... }
%  \jthanks     \ethanks{ ... }
%  \jkeywords   \ekeywords { ... }
%  \jabstruct   \eabstruct { ... }
%  \maketitle
%
\makeatletter
\newcount\@abind
\def\jtitle#1{\gdef\@jtitle{#1}}\jtitle{}{}
\def\etitle#1{\gdef\@etitle{#1}}\etitle{}
\def\jauthor#1{\gdef\@jauthor{#1}}\jauthor{}
\def\eauthor#1{\gdef\@eauthor{#1}}\eauthor{}
\def\jaffiliation#1{\long\gdef\@jaffiliation{#1}}\jaffiliation{}
\def\eaffiliation#1{\long\gdef\@eaffiliation{#1}}\eaffiliation{}
\def\jabstract#1{\long\gdef\@jabstract{#1}}\jabstract{}
\def\eabstract#1{\long\gdef\@eabstract{#1}}\eabstract{}
\def\jkeywords#1{\gdef\@jkeywords{#1}}\jkeywords{}
\def\ekeywords#1{\gdef\@ekeywords{#1}}\ekeywords{}
\def\jthanks#1{\gdef\@jthanks{#1}}\jthanks{}
\def\ethanks#1{\gdef\@ethanks{#1}}\ethanks{}
\def\email#1{\gdef\@email{#1}}\email{}
\def\presentation#1{\gdef\@present{#1}}\presentation{}
\let\abstract\eabstract
\let\keywords\ekeywords
\let\title\jtitle
\let\author\jauthor
\let\affiliation\jafiliation
\let\ethanks\eaffiliation
\let\jthanks\jaffiliation
\let\thanks\jaffiliation
%
% re-define maketitle macros for saving memory otherwise this definition 
% is not necessary.
% main format of maketitle is defiened in @maketitle.
%
\newcommand{\maketitle}{\par
\newdimen\titleleft \titleleft 11.5mm

 \newdimen\titlewidth\titlewidth\textwidth\advance\titlewidth-2\titleleft
 \begingroup
   \def\thefootnote{\fnsymbol{footnote}}
   \def\@makefnmark{\hbox to 0pt{$^{\@thefnmark}$\hss}} 
   \if@twocolumn\twocolumn[\@maketitle] 
   \else\newpage\global\@topnum\z@\@maketitle\fi%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%����
%   \thispagestyle{plain}
%  \footnotetext{%\hskip-6mm\kern -1.5em
%     \begin{tabular}[b]{p{4mm}@{}p{67.2mm}}
%     \ifx\@present\empty
%      \ifx\@date\empty\else$^{*}$ & ���e��t\ \@date\\\fi%
%     \else
%      \ifx\@date\empty\else$^{*}$ & \@present �C���e��t\ \@date\\\fi%
%     \fi
%     \@jaffiliation\\
%    \ifx\@email\empty\else & Email:\ {\tt\@email}\fi
%     \end{tabular}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

   \par
  \baselineskip 15.6pt\endgroup
  
 \setcounter{footnote}{0}
 \let\maketitle\relax
 \let\@maketitle\relax
 \let\eaffiliation\relax\gdef\@eafiliation{}
 \let\jaffiliation\relax\gdef\@jafiliation{}
 \gdef\@ethanks{}\gdef\@eauthor{}\gdef\@etitle{}\gdef\@ekeywords{}
 \gdef\@jthanks{}\gdef\@jauthor{}\gdef\@jtitle{}\gdef\@jkeywords{}
 \let\ethanks\relax\let\jthanks\relax
 \let\titlewidth\relax\let\titleleft\relax}
% bold italic `Key Words:' 
\def\keywordsname{\fontkeywords Key Words:}
\font\fontkeywords=cmbxsl10 scaled 900
%
\newcommand{\nospitem}{\itemsep=0pt\parskip=0pt\parsep=0pt\partopsep=0pt}
\def\@@title#1{\hfil\parbox{\titlewidth}{
		\begin{center}\Large\bfseries
		 \renewcommand{\baselinestretch}{1.2}
	       #1\end{center}}\vskip 1em}
\def\@@etitle#1{\hfil\parbox{\titlewidth}{
		\begin{center}\large\bfseries
		 \renewcommand{\baselinestretch}{0.95}
	       #1\end{center}}\vskip 1em}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%�ύX
\def\@@author#1{%
  \hfil\parbox[t]{\titlewidth}{\centering{\begin{tabular}{l}#1\end{tabular}}}
  \vskip 1em}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\@@abstract#1{%
  \begin{list}{}{\setlength{\leftmargin}{17mm}%
  \topsep=0pt \partopsep=0pt \parsep=0pt \listparindent=8pt
  \setlength{\rightmargin}{\leftmargin}\small\baselineskip=10.7pt}
  \item[]\ignorespaces\mbox{}\abind #1 \par\vskip .3em\end{list}}
\def\@@keywords#1{
  \setbox\@tempboxa\hbox{\small\textit{\textbf{Key Words}}~:~~~}
  \begin{list}{\small\textit{\textbf{Key Words}}~:~}
   {\setlength{\leftmargin}{17mm}%
   \topsep=0pt \partopsep=0pt \parsep=0pt \listparindent=9pt
   \setlength{\rightmargin}{\leftmargin}
   \setlength{\labelwidth}{20em}
   \advance \leftmargin \wd\@tempboxa
   \small\baselineskip=11.3pt}
  \item #1 \end{list}\relax}
\newcommand{\abind}{\par\vskip.2\baselineskip\ignorespaces{\hskip 2em}}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%�ύX
\newcommand{\@maketitle}{\newpage\null%
 \@abind=1
 \ifx\@jtitle\empty\else\addvspace{20pt}\@@title{\@jtitle}\fi
 \ifx\@etitle\empty\else\@@etitle{\@etitle}\fi
 \ifx\@jauthor\empty\else\addvspace{5pt}\@@author{\@jauthor}\fi
 \@abind=2
 \ifx\@eauthor\empty\else\@@author{\@eauthor}\fi
 \ifx\@eabstract\empty\else\addvspace{3pt}\@@abstract{{\@eabstract}}\fi
 \ifx\@ekeywords\empty\else\addvspace{9pt}\@@keywords{\@ekeywords}\fi
 \addvspace{28pt}\par}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\mark{{}{}} 
%
%           %%%%%%%%%%%%%%%%%%%%%%%%%
%           %          cite         %(�Ē�`)
%           %%%%%%%%%%%%%%%%%%%%%%%%%
% cite �Q�ƕ����̈��p�ԍ���������������ɂ���. 

% '\@cite#1#2' is replaced based on `supercite.sty` to fit with JSME
% regulation [customized by Kikuo Fujita, Osaka University]:

\renewcommand{\@cite}[2]{\raisebox{1.1ex}{\scriptsize{(#1)}}}
% \renewcommand{\@cite}[2]{\raisebox{1.1ex}{\scriptsize{(#1)\if@tempswa ,#2)\fi}}}
\newcount\@tempcntc
\def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
  \@tempcnta\z@\@tempcntb\m@ne\def\@citea{}\@cite{\@for\@citeb:=#2\do
    {\@ifundefined
       {b@\@citeb}{\@citeo\@tempcntb\m@ne\@citea\def\@citea{)\penalty\@m\ (,}{\bf ?}\@warning
%       {Citation `\@citeb' on page \thepage \space undefined}}%
       {Citation `\@citeb' undefined}}%
    {\setbox\z@\hbox{\global\@tempcntc0\csname b@\@citeb\endcsname\relax}%
     \ifnum\@tempcntc=\z@ \@citeo\@tempcntb\m@ne
       \@citea\def\@citea{,}\hbox{\csname b@\@citeb\endcsname}%
     \else
      \advance\@tempcntb\@ne
      \ifnum\@tempcntb=\@tempcntc
      \else\advance\@tempcntb\m@ne\@citeo
      \@tempcnta\@tempcntc\@tempcntb\@tempcntc\fi\fi}}\@citeo}{#1}}
\def\@citeo{\ifnum\@tempcnta>\@tempcntb\else\@citea\def\@citea{)\penalty\@m\ (}%
  \ifnum\@tempcnta=\@tempcntb\the\@tempcnta\else
   {\advance\@tempcnta\@ne\ifnum\@tempcnta=\@tempcntb \else \def\@citea{)$\sim$(}\fi
    \advance\@tempcnta\m@ne\the\@tempcnta\@citea\the\@tempcntb}\fi\fi}

%
%           %%%%%%%%%%%%%%%%%%%%%%%%%
%           %   @makecaption        %(�Ē�`)
%           %%%%%%%%%%%%%%%%%%%%%%%%%
% '\@makecaption' is replaced [customized by Kikuo Fujita, Osaka
% University]: 
\newlength{\@tmpwidth}

\long\def\@makecaption#1#2{
 \addvspace{6pt}
 \setbox\@tempboxa\hbox{#1 \hspace{1ex} #2}
 \ifdim \wd\@tempboxa >\hsize {
   \setlength{\@tmpwidth}{0.83\hsize} 
   {\begin{center}
      \begin{tabular}{@{}lp{\@tmpwidth}@{}} #1 & #2 \end{tabular}
    \end{center}}
 } \else
   \hbox to\hsize{\hfil\box\@tempboxa\hfil} 
 \fi
 \addvspace{6pt}}

% �}�\�̕\�����{��� '�}  ', '�\ ' �Ƃ���B
%\def\fnum@figure{�} \thefigure}
%\def\fnum@table{�\ \thetable}
\def\fnum@figure{Fig. \thefigure}
\def\fnum@table{Table \thetable}
%
%           %%%%%%%%%%%%%%%%%%%%%%%%%
%           %   mtcation mfcation   %(�V��`)
%           %%%%%%%%%%%%%%%%%%%%%%%%%
% table, figure ���̊O�Ő}�\�̕\����`����B
\def\mfcaption#1{\par
  \refstepcounter{figure}
  \addcontentsline{lof}{figure}%
  {\protect\numberline{\thefigure}{#1}}
  \begingroup
    \@parboxrestore\normalsize
    \@makecaption{\fnum@figure}{\ignorespaces #1}\par\vskip\baselineskip
  \endgroup}
%
\def\mtcaption#1{\par
  \refstepcounter{table}
  \addcontentsline{lot}{table}%
  {\protect\numberline{\thetable}{#1}}
  \begingroup
    \@parboxrestore\normalsize
    \@makecaption{\fnum@table}{\ignorespaces #1}\par
  \endgroup}
%
%           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%           %      indention   (environment)     %(�V��`)
%           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% USAGE:  preamble �� \includeonly{indention} ����B
%
% DEFINITION:
%  environment <<indention>> and <<\inditem>>
%
% DESCRIPTION & APPLIED SAMPLE
%
% \begin{indention}
%   \inditem{{\tt mmmm}something}
%   ....
% \end{indention}
% 
% SAMPLE:
% 
% ��`�����C���f���g�R�}���h�̗�ł��B�C���f���g�� 2cm �Ƃ���
% \begin{indention}{2cm}
%   indention ���Ɏ��������钷�����w�肵�ċL�q����� �{����肻�̑傫����
%   ����������Ă��܂��B���̒��ō��ڂ��L�q���邱�Ƃ��ł��܂��B
%   \inditem{{\tt itemize}��}
%   inditem �� indention �����ł̂ݎg�p�ł��鍀�ڋL�q�ł��B�������P���
%   �܂��B���̈����͊e���ڂ̐擪�Ƀ��x���Ƃ��ĕt���ďo�͂��܂��B
%   indention �����l�X�g���邱�Ƃ��ł��܂��B
%   \begin{indention}{2cm}
%     ���̂悤�ɂ���Ɏ��������s���܂��B�ŏ��̍s�̎����������Ȃ��Ƃ��ɂ� 
%     $backslash$noindent ��擪�ɓ����Ƃ悢�ł��傤�B
%   \end{indention}
%   �����ŁC������ indention �������āC��O�̃C���f���g�ɖ߂�܂����B
% \end{indention}
% ����őS���̃C���f���g�����I��܂����B
% 
\def\indention#1{\par\advance\leftskip #1
  \def\inditem##1{
  \dimen1\leftskip\advance\dimen1 -1ex
  \hskip -\leftskip\makebox[\dimen1][r]{##1\hskip 1ex}}}
\let\endindention=\par
%
%           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%           %      enumerate   (environment)     %
%           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% �㉺�̊Ԋu�⍀�ڊԂ̋󔒂��Ȃ���������
%
% USAGE:  �g�p�@�� LaTeX �ɓ����B
%
\def\enumerate{\ifnum \@enumdepth >3 \@toodeep\else
    \advance\@enumdepth \@ne 
    \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
    \list{\csname label\@enumctr\endcsname}
    {\usecounter{\@enumctr}\def\makelabel##1{\hss\llap{##1}}
    \topsep=0pt\itemsep=0pt\parskip=0pt\parsep=0pt\partopsep=0pt}\fi}
%
%           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%           %      itemize     (environment)     %
%           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% �㉺�̊Ԋu�⍀�ڊԂ̋󔒂��Ȃ���������
%
% USAGE:  �g�p�@�� LaTeX �ɓ����B
%
\def\itemize{\ifnum \@itemdepth >3 \@toodeep\else
    \advance\@itemdepth \@ne
    \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
    \list{\csname\@itemitem\endcsname}%
    {\def\makelabel##1{\hss\llap{##1}}
    \topsep=0pt\itemsep=0pt\parskip=0pt\parsep=0pt\partopsep=0pt}\fi}
%
%           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%           %      enumlist    (environment)     %
%           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% enumrate �� description ��g�ݍ������悤�Ȋ�
% adapted �ɓ��a�l,'LaTeX ���R����',�G�a�V�X�e���g���[�f�B���O,(1991),129
%
% USAGE:  preamble �� \includeonly{enumlist} ����B
%
% DEFINITION:
%  environment <<enumlist>> and <<\ellist>>
%
% DESCRIPTION & APPLIED SAMPLE
%
% \begin{enumlist}
%   \ellist{{\tt mmmm}something}  <-- \item can not do this. use \ellist.
%   ....
% \end{enumlist}
% 
% SAMPLE:
% 
% \begin{enumlist}
%   \ellist{{\tt itemize}��}
%   itemize���́C�e���ڂ̐擪�Ƀ��x���Ƃ��ċL����t���C�S�̂���⎚������
%   �ďo�͂��܂��B
% 
%   itemize���̒��ɍX�ɁCitemize��������l�X�e�B���O���\�ł��B�l�X�e
%   �B���O���s�Ȃ��ƃ��x����$\bullet$��{\bfseries --}��$\ast$��$\cdot$�ƂȂ�܂��B
%   \ellist{{\tt enumrate}��}
%   enumrate ���́Citemize ���ƈقȂ�e���ڂɔԍ���U��܂��Benumrate 
%   ����4���x���܂ł̃l�X�e�B���O���\�ł��B
%   \ellist{{\tt description}��}
%   description ���ł́C�e���ڂɁC���[�U�[�����ږ���t���܂��B���ږ��̓�
%   �x���ƂȂ�܂����C\item �R�}���h�̃I�v�V���������Ƃ��Ďw�肵�܂��B���x
%   ���͉p��ł͑������ŁC���{��ł́C�S�`�b�N�̂ŏo�͂���܂��B���̂�ύX
%   ����ɂ͏��̕ύX�R�}���h�����ڒ��Ɋ܂߂�Ƃ悢�ł��傤�B
%   \ellist{}
%   ����́C�����̂Ȃ� \verb!\ellist!�R�}���h�̗�ł��B
%   \ellist{{\tt enumlist}��}
%   enumlist���́C�����Ŏn�߂Ē�`���ꂽ�ӏ��������ł��B�l�X�e�B���O��
%   �ł��܂���B���̗��{\tt enumlist}���ł�����Ă��܂��B
% \end{enumlist}
%
\def\enumlist{%
  \newcounter\mycount
  \list{}{\leftmargin 7em\labelsep 1em\labelwidth\leftmargin
  \advanced\labelwidth-\labelsep\usecounter{mycount}}\item[]}
\def\ellist#1{\def\makelabel{\bfseries\Roman{mycount}. #1\hfil}}%
\let\endenumlist=\endlist
%
%           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%           %              dhline                %(�V��`)
%           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% �\�g�ŁA����������p����B������ς���ꍇ�ɂ� arrayrulewidth �̔{����
% �ω�������Ηǂ��B
%
\def\dhline{\noalign{\ifnum0=`}\fi%
   \hrule \@height 3\arrayrulewidth \futurelet
   \@tempa\@xhline}
%
%           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%           %    �e��L��(�ėp)                  %(�V��`)
%           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% ��
\def\yen{{\setbox0=\hbox{Y}Y\kern-.97\wd0\vbox{\hrule height.1ex width.98\wd0
\kern.33ex\hrule height.1ex width.98\wd0\kern.45ex}}}
%% ��
\def\degc{\raisebox{0.2em}{\(^{\circ}\)}\hspace{-.1em}C}
%% Klab symbol
\font\rbm=cmbxti10
\def\KLab{{\Large\bfseries K}\kern-0.4ex{\rbm L\kern-.28em\raise.6ex\hbox{A}\kern-.1em B}}
\def\signif#1{\gdef\@signif{#1}}\signif{}
%\signif{\KLab}
%
%           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%           %    �e��L��(math ����p)         %(�V��`)
%           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% style of differncial equation
\def\dif#1#2{{\displaystyle\frac{d{#1}}{d{#2}}}}
\def\ddif#1#2{{\displaystyle\frac{d^2{#1}}{d{#2}^2}}}
\def\pdif#1#2{{\displaystyle\frac{\partial{#1}}{\partial{#2}}}}
\def\pddif#1#2{{\displaystyle\frac{\partial^2{#1}}{\partial{#2}^2}}}
%
%
%
% referred 1[column output ]-in-2[column document].sty
%
\let\@origin@lpar\par                   % original definition of \par
\newdimen\@fullwidthfootnote \newsavebox{\@fullwdp@gebox}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newdimen\lastp@geheight \lastp@geheight=10mm
\newsavebox{\lastp@gebox}
%
% define \endabstract
%
\long\def\endabstract#1{\gdef\@endabstract{#1}} % permit paragraphs
%
% to create enough space of footnote to align columns of the last page
%
\def\lastpagehr#1{\global\lastp@geheight=#1%
 \@ifundefined{maxsize}{}{\global\advance\maxsize-#1}% for supertab.sty
 \global\sbox{\lastp@gebox}{%
  \hspace*{0.05\textwidth}
  \noindent
  \begin{minipage}{.9\textwidth}
   \vspace*{0.8em}%
   \begin{center}
    \rule{0.4\textwidth}{0.2pt}
   \end{center}   
   \vspace{1ex}
  \end{minipage}}%
%
% insert footnote with abstract if enough room left
%                 without abstract otherwise
%
  \@tempdima\ht\lastp@gebox \advance\@tempdima\dp\lastp@gebox
 \ifdim\@tempdima>\lastp@geheight
  \@tempdima\lastp@geheight \global\lastp@geheight=0pt
 \else
  \global\advance\lastp@geheight -\@tempdima
  \@tempdima\lastp@geheight \global\lastp@geheight\textheight
 \fi
  \def\footnoterule{\null}% force it to \null at the last page
  \insert\footins{\footnotesize
  \interlinepenalty\interfootnotelinepenalty
  \splittopskip\footnotesep
  \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
  \hsize\textwidth \@parboxrestore
   \ifdim\lastp@geheight=\z@\else\usebox{\lastp@gebox}\fi%
  \vspace*{\@tempdima}}}
  
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%�ǉ�
%           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%           %    �P�y�[�W�ځi�G�N�X�g���A�u�X�g���N�g�j�p  %(�V��`)
%           %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% �g�p���@
%
% \bexabst
% �G�N�X�g���A�u�X�g���N�g�̓��e
% \eexabst�i��\clearpage���Ă����j
%
\newcommand{\bexabst}{%
\def\thesection {A\arabic{section}}
\renewcommand{\theequation}{A\arabic{equation}}
\def\thefigure{A\@arabic\c@figure}
\def\thetable{A\@arabic\c@table}
}
\newcommand{\eexabst}{%
\setcounter{section}{0}
\setcounter{equation}{0}
\setcounter{figure}{0}
\setcounter{table}{0}
\def\thesection {\arabic{section}}
\renewcommand{\theequation}{\arabic{equation}}
\def\thefigure{\@arabic\c@figure}
\def\thetable{\@arabic\c@table}
\clearpage
}

