%% ieicej-draft.sty --- IEICEJ DRAFT STYLE for ieicej.sty version 1.2
%%  for LaTeX version 2.09
%% IEICEJ ドラフト原稿スタイルファイル
%% Copyright (C) 1999 Jun Takahashi and Taiji Yamada <taiji@aihara.co.jp>

\typeout{ieicej-draft.sty; Version 0.1 [June 16 1999]}

\newif\if@paper \@papertrue
\newif\if@letterpaper \@letterpaperfalse
\newif\if@letter \@letterfalse

\def\ds@paper{% \@papertrue
 \gdef\hd@type{論文}%
 \gdef\@type{P}}% paper
\def\ds@invited{\@papertrue
 \gdef\hd@type{招待論文}%
 \gdef\@type{P}}% invited paper
\def\ds@comment{\@papertrue
 \gdef\hd@type{解説論文}%
 \gdef\@type{P}}% comment paper
\def\ds@letterpaper{\@letterpapertrue\@paperfalse
 \gdef\hd@type{レター論文}%
 \gdef\@type{LP}}% letterpaper
\def\ds@letter{\@lettertrue\@paperfalse
 \gdef\hd@type{レター}%
 \gdef\@type{L}}% letter

\def\hd@type{論文}
\def\@type{P}% paper

\newif\if@lofloat \@lofloatfalse
\def\ds@lofloat{\@lofloattrue}
\newif\if@endfloat \@endfloatfalse
\def\ds@endfloat{\@endfloattrue}

\newif\if@default \@defaultfalse
\def\ds@default{\@defaulttrue}

\def\@ptsize{0}
\@namedef{ds@11pt}{\def\@ptsize{1}}
\@namedef{ds@12pt}{\def\@ptsize{2}}
\def\ds@twoside{\@twosidetrue \@mparswitchtrue}
\def\ds@draft{\overfullrule 5pt}
\@options
\input jart1\@ptsize.sty\relax


\def\labelenumi{\theenumi.} 
\def\theenumi{\arabic{enumi}} 
\def\labelenumii{(\theenumii)}
\def\theenumii{\alph{enumii}}
\def\p@enumii{\theenumi}
\def\labelenumiii{\theenumiii.}
\def\theenumiii{\roman{enumiii}}
\def\p@enumiii{\theenumi(\theenumii)}
\def\labelenumiv{\theenumiv.}
\def\theenumiv{\Alph{enumiv}} 
\def\p@enumiv{\p@enumiii\theenumiii}

\def\labelitemi{$\bullet$}
\def\labelitemii{\bf --}
\def\labelitemiii{$\ast$}
\def\labelitemiv{$\cdot$}

\def\verse{\let\\=\@centercr 
 \list{}{\itemsep\z@ \itemindent -1.5em\listparindent \itemindent 
 \rightmargin\leftmargin\advance\leftmargin 1.5em}\item[]}
\let\endverse\endlist
\def\quotation{\list{}{\listparindent 1.5em
 \itemindent\listparindent
 \rightmargin\leftmargin \parsep 0pt plus 1pt}\item[]}
\let\endquotation=\endlist
\def\quote{\list{}{\rightmargin\leftmargin}\item[]}
\let\endquote=\endlist

\def\descriptionlabel#1{\hspace\labelsep \bf #1}
\def\description{\list{}{\labelwidth\z@ \itemindent-\leftmargin
 \let\makelabel\descriptionlabel}}
\let\enddescription\endlist


\def\theequation{\arabic{equation}}


\def\titlepage{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
 \else \newpage \fi \thispagestyle{empty}\c@page\z@}
\def\endtitlepage{\if@restonecol\twocolumn \else \newpage \fi}

\arraycolsep 5pt \tabcolsep 6pt \arrayrulewidth .4pt \doublerulesep 2pt 
\tabbingsep \labelsep 

\skip\@mpfootins = \skip\footins
\fboxsep = 3pt \fboxrule = .4pt 

\newcounter{part}
\newcounter {section}
\newcounter {subsection}[section]
\newcounter {subsubsection}[subsection]
\newcounter {paragraph}[subsubsection]
\newcounter {subparagraph}[paragraph]

\def\thepart{\Roman{part}} \def\thesection {\arabic{section}}
\def\thesubsection {\thesection.\arabic{subsection}}
\def\thesubsubsection {\thesubsection .\arabic{subsubsection}}
\def\theparagraph {\thesubsubsection.\arabic{paragraph}}
\def\thesubparagraph {\theparagraph.\arabic{subparagraph}}

\def\@pnumwidth{1.55em}
\def\@tocrmarg {2.55em}
\def\@dotsep{4.5}
\setcounter{tocdepth}{3}

%\def\tableofcontents{\section*{Contents\markboth{CONTENTS}{CONTENTS}}
\def\tableofcontents{\section*{目 次\markboth{目 次}{目 次}}
 \@starttoc{toc}}
\def\l@part#1#2{\addpenalty{\@secpenalty}
 \addvspace{2.25em plus 1pt} \begingroup
 \@tempdima 3em \parindent \z@ \rightskip \@pnumwidth \parfillskip
-\@pnumwidth 
 {\large \bf \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}}\par
 \nobreak \endgroup}
\def\l@section#1#2{\addpenalty{\@secpenalty} \addvspace{1.0em plus 1pt}
\@tempdima 1.5em \begingroup
 \parindent \z@ \rightskip \@pnumwidth 
 \parfillskip -\@pnumwidth 
 \bf \leavevmode \advance\leftskip\@tempdima \hskip -\leftskip #1\nobreak\hfil
\nobreak\hbox to\@pnumwidth{\hss #2}\par
 \endgroup}
\def\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
\def\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
\def\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
\def\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
%\def\listoffigures{\section*{List of Figures\markboth
\def\listoffigures{\section*{図 目 次\markboth
 {図 目 次}{図 目 次}}\@starttoc{lof}}
\def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
%\def\listoftables{\section*{List of Tables\markboth
\def\listoftables{\section*{表 目 次\markboth
 {表 目 次}{表 目 次}}\@starttoc{lot}}
\let\l@table\l@figure


\def\thebibliography#1{\section*{参考文献\markboth
 {参 考 文 献}{参 考 文 献}}\list
 {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
 \advance\leftmargin\labelsep
 \usecounter{enumi}}
 \def\newblock{\hskip .11em plus .33em minus .07em}
 \sloppy
 \sfcode`\.=1000\relax}
\let\endthebibliography=\endlist
 

\newif\if@restonecol
\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
\columnseprule \z@
\columnsep 35pt\twocolumn[\section*{索 引}]
 \markboth{索 引}{索 引}\thispagestyle{plain}\parindent\z@
 \parskip\z@ plus .3pt\relax\let\item\@idxitem}
\def\@idxitem{\par\hangindent 40pt}
\def\subitem{\par\hangindent 40pt \hspace*{20pt}}
\def\subsubitem{\par\hangindent 40pt \hspace*{30pt}}
\def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi}
\def\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax}

\def\footnoterule{\kern-3\p@ 
 \hrule width .4\columnwidth 
 \kern 2.6\p@} 

\long\def\@makefntext#1{\parindent 1em\noindent 
 \hbox to 1.8em{\hss$^{\@thefnmark}$}#1}


\setcounter{topnumber}{2}
\def\topfraction{.7}
\setcounter{bottomnumber}{1}
\def\bottomfraction{.3}
\setcounter{totalnumber}{3}
\def\textfraction{.2}
\def\floatpagefraction{.5}
\setcounter{dbltopnumber}{2}
\def\dbltopfraction{.7}
\def\dblfloatpagefraction{.5}

\long\def\@makecaption#1#2{
 \vskip 10pt 
 \setbox\@tempboxa\hbox{#1: #2}
 \ifdim \wd\@tempboxa >\hsize \unhbox\@tempboxa\par \else \hbox
to\hsize{\hfil\box\@tempboxa\hfil} 
 \fi}


\newcounter{figure}
\def\thefigure{\@arabic\c@figure}
\def\fps@figure{tbp}
\def\ftype@figure{1}
\def\ext@figure{lof}
\def\fnum@figure{図 \thefigure}
\def\figure{\@float{figure}}
\let\endfigure\end@float
\@namedef{figure*}{\@dblfloat{figure}}
\@namedef{endfigure*}{\end@dblfloat}
\newcounter{table}
\def\thetable{\@arabic\c@table}
\def\fps@table{tbp}
\def\ftype@table{2}
\def\ext@table{lot}
\def\fnum@table{表 \thetable}
\def\table{\@float{table}}
\let\endtable\end@float
\@namedef{table*}{\@dblfloat{table}}
\@namedef{endtable*}{\end@dblfloat}


\def\maketitle{\par
 \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}\@thanks
 \endgroup
 \setcounter{footnote}{0}
 \let\maketitle\relax
 \let\@maketitle\relax
 \gdef\@thanks{}\gdef\@author{}\gdef\@title{}\let\thanks\relax}
\def\@maketitle{\newpage
 \null
 \vskip 2em \begin{center}
 {\LARGE \@title \par} \vskip 1.5em {\large \lineskip .5em
\begin{tabular}[t]{c}\@author 
 \end{tabular}\par} 
 \vskip 1em {\large \@date} \end{center}
 \par
 \vskip 1.5em} 
\def\abstract{\if@twocolumn
\section*{Abstract}
\else \small 
\begin{center}
{\bf Abstract\vspace{-.5em}\vspace{0pt}} 
\end{center}
\quotation 
\fi}
\def\endabstract{\if@twocolumn\else\endquotation\fi}

\mark{{}{}} 

\if@twoside \def\ps@headings{\def\@oddfoot{}\def\@evenfoot{}\def\@evenhead{\rm
\thepage\hfil \sl \leftmark}\def\@oddhead{\hbox{}\sl \rightmark \hfil
\rm\thepage}\def\sectionmark##1{\markboth {\uppercase{\ifnum \c@secnumdepth
>\z@
 \thesection\hskip 1em\relax \fi ##1}}{}}\def\subsectionmark##1{\markright
{\ifnum \c@secnumdepth >\@ne
 \thesubsection\hskip 1em\relax \fi ##1}}}
\else \def\ps@headings{\def\@oddfoot{}\def\@evenfoot{}\def\@oddhead{\hbox
{}\sl \rightmark \hfil \rm\thepage}\def\sectionmark##1{\markright
{\uppercase{\ifnum \c@secnumdepth >\z@
 \thesection\hskip 1em\relax \fi ##1}}}}
\fi
\def\ps@myheadings{\def\@oddhead{\hbox{}\sl\rightmark \hfil
\rm\thepage}\def\@oddfoot{}\def\@evenhead{\rm \thepage\hfil\sl\leftmark\hbox
{}}\def\@evenfoot{}\def\sectionmark##1{}\def\subsectionmark##1{}}


\newif\if西暦\let\if西暦=\iffalse \def\西暦{\let\if西暦=\iftrue}
\def\today{{\if西暦\count0=\year\else%
\count0=\year\advance\count0 -1988 平成\,\fi%
\ifnum\count0=1 元\else\number\count0\fi\,年\hspace{.5em}\nobreak%
\number\month\,月\hspace{.5em}\nobreak\number\day\,日}}

\ps@plain \pagenumbering{arabic} \onecolumn \if@twoside\else\raggedbottom\fi 


\ifx\gtfam\undefined% NTT
 \def\mc{\dm}
 \def\gt{\dg}
 \def\bf{\protect\pdg\protect\pbf}
\else% ASCII
 \def\dm{\mc}
 \def\dg{\gt}
\fi

\def\lineparpage#1{%
 \baselineskip=\textheight
 \divide\baselineskip by #1
}

\def\kcharparline#1{%
 \ifx\gtfam\undefined% NTT
  \jintercharskip 0mm plus 0.2mm minus 0.2mm
 \else% ASCII
  \kanjiskip 0mm plus 0.2mm minus 0.2mm
 \fi
 \settowidth{\textwidth}{亜}
 \multiply\textwidth by #1
}

\if@default
 \oddsidemargin 0mm
 \evensidemargin 0mm
 \topmargin 0mm
 \headheight 0mm
 \headsep 0mm
 %\textwidth 151.5mm
 \kcharparline{41}
 \textheight 240mm
 \lineparpage{20}
 \parindent 1zw
 \columnsep 2zw
\fi

\def\thesection{\arabic{section}.}
\def\thesubsection{\thesection\,{\arabic{subsection}}}
\def\thesubsubsection{\thesubsection.\,\arabic{subsubsection}}
\def\theparagraph{\alph{paragraph}\,)}
\def\thesubparagraph{\roman{subparagraph}\,)}

\def\FIELD#1{}
\def\YEAR#1{}
\def\MONTH#1{}
\def\typeofletter#1{\gdef\@typeofletter{#1}}
\def\affiliate[#1]#2#3{}
\def\paffiliate[#1]#2{}
\def\received#1#2#3{}
\def\revised#1#2#3{}

\if@letter
 \typeofletter{ショートノート}\fi

\def\jtitle{\@ifnextchar[{\d@jtitle}{\s@jtitle}}
\def\d@jtitle[#1]#2{\gdef\hd@title{#1}\gdef\@jtitle{#2}}
\def\s@jtitle#1{\gdef\hd@title{#1}\gdef\@jtitle{#1}}
\def\@jtitle{}
\def\hd@title{}
\def\etitle#1{\gdef\@etitle{#1}}
\def\@etitle{}

\def\authorlist#1{\author{#1}}
\if@paper
 \def\authorentry#1#2#3{#1\hskip2zw}
\else
 \def\authorentry#1#2#3#4{#1\hskip2zw}
\fi

\if@letter
\def\abstract{\par{\bf あらまし\hskip1zw}}
\def\endabstract{\par}
\def\keyword{\par{\bf キーワード\hskip1zw}}
\def\endkeyword{\par}
\else
\newbox\abstractbox
\newbox\keywordbox
\def\abstract{\global\setbox\abstractbox=\hbox\bgroup%
\begin{minipage}[t]{\textwidth}\if@default\lineparpage{20}\fi%
{\bf あらまし\hskip1zw}}
\def\endabstract{\end{minipage}\egroup}
\def\keyword{\global\setbox\keywordbox=\hbox\bgroup%
\begin{minipage}[t]{\textwidth}\if@default\lineparpage{20}\fi%
{\bf キーワード\hskip1zw}}
\def\endkeyword{\end{minipage}\egroup}
\fi

\def\maketitle{\par
 \begingroup
 \def\thefootnote{\fnsymbol{footnote}}
 \def\@makefnmark{\hbox
 to 0pt{$^{\@thefnmark}$\hss}} 
 \if@twocolumn 
 \twocolumn[\csname @make\@type title\endcsname]
 \else \newpage
 \global\@topnum\z@ \csname @make\@type title\endcsname \fi
 \thispagestyle{plain}\@thanks
 \endgroup
 \setcounter{footnote}{0}
 \let\maketitle\relax
 \expandafter\let\csname @make\@type title\endcsname\relax
 \gdef\@thanks{}\gdef\@author{}\gdef\@jtitle{}\gdef\@etitle{}\let\thanks\relax
 \if@default\lineparpage{20}\fi
}
\def\@makeLtitle{\newpage\null
 \noindent\fbox{\hd@type: \@typeofletter}
 \begin{center}
  {\LARGE\bf\@jtitle\par}
  \vskip\baselineskip
  {\Large\bf\@etitle\par}
  \vskip\baselineskip
  {\large\@author\par}
 \end{center}
}
\def\@makePtitle{\newpage\null
 \noindent\fbox{\hd@type}
 \begin{center}
  {\LARGE\bf\@jtitle\par}
  \vskip\baselineskip
  {\Large\bf\@etitle\par}
  \vskip\baselineskip
  {\large\@author\par}
  \vskip\baselineskip
  \box\abstractbox\par
  \vskip\baselineskip
  \box\keywordbox\par
  \vskip\baselineskip
 \end{center}
}
\def\@makeLPtitle{\@makePtitle}

\newdimen\h@
  \h@=2mm

\newbox\@tempboxb
\newbox\@tempboxc
\newdimen\capwidth
\newdimen\ecapwidth
\newdimen\@abovecapskip
\newdimen\@belowcapskip
\capwidth=\hsize
\ecapwidth=\hsize

\long\def\@caption#1[#2]#3{\par
 \if@lofloat
  \addcontentsline{\csname ext@#1\endcsname}{#1}
  {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}
 \fi
 \begingroup
  \@parboxrestore
  \normalsize
  \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
 \endgroup}

\long\def\@makecaption#1#2{%
 \vskip\@abovecapskip
 \small
 \setbox\@tempboxa\hbox{#1\hskip1zw\shortstack[l]{#2}}%
 \@tempdima=\ht\@tempboxa\advance \@tempdima by \dp\@tempboxa
 \setbox\@tempboxb\hbox{#1\hskip1zw}%
 \ifdim \@tempdima > \baselineskip
  \hfil\parbox[t]{\wd\@tempboxa}{\hangindent\wd\@tempboxb 
   #1\hskip1zw #2}\vskip2\h@
 \else
  \ifdim \wd\@tempboxa > \capwidth
   \hfil\parbox[t]{\capwidth}{\hangindent\wd\@tempboxb 
    #1\hskip1zw #2}\vskip2\h@
  \else
   \setbox\@tempboxc\hbox{#2}%
   \ifdim \wd\@tempboxc < 4.5zw
    \hbox to\hsize{\hfil #1\hskip1zw\kintou{5zw}{#2}\hfil}%
   \else
    \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
   \fi
  \fi
 \fi
}

\long\def\ecaption#1{\small
 \setbox\@tempboxa\hbox{\csname fnum@e\@captype\endcsname\hskip1zw
  \shortstack[l]{#1}}%
 \@tempdima=\ht\@tempboxa\advance \@tempdima by \dp\@tempboxa
 \setbox\@tempboxb\hbox{\csname fnum@e\@captype\endcsname\hskip1zw}%
 \ifdim \@tempdima > \baselineskip
  \hfil\parbox[t]{\wd\@tempboxa}{\hangindent\wd\@tempboxb 
   \csname fnum@e\@captype\endcsname\hskip1zw #1}\par
 \else
  \ifdim \wd\@tempboxa > \ecapwidth
   \hfil\parbox[t]{\ecapwidth}{\hangindent\wd\@tempboxb 
    \csname fnum@e\@captype\endcsname\hskip1zw #1}\par
  \else
   \hbox to\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
 \fi
 \vspace{\@belowcapskip}}

\def\fnum@figure{図\thefigure}
\def\fnum@table{表\thetable}

\def\fnum@efigure{Fig.\,\thefigure}
\def\fnum@etable{Table~\thetable}


\def\ack{\par{\bf 謝辞}\hskip1zw}

\if@paper
 \newenvironment{biography}{\par}{\par}
\else
\fi

\if@paper
\def\profile#1#2#3{\par
 \if #1m \def\p@membership{（正員）\kern-.5zw}\else
  \if #1s \def\p@membership{（学生員）\kern-.5zw}\else
   \if #1n \def\p@membership{}\else
    \if #1a \def\p@membership{（准員）\kern-.5zw}\else
     \if #1h \def\p@membership{（名誉員）\kern-.5zw}\else
  \def\p@membership{}
  \typeout{Warning: Check the 1st. argument of \string\profile{#1}{#2}{}.}
 \fi\fi\fi\fi\fi
{\large\bf #2}\hskip1zw{\bf \p@membership{}}\par#3
}
\else
\fi


\def\LaTeX{{\rm L\kern-.36em\raise.3ex\hbox{$\scriptstyle {\rm A}$}\kern-.15em
    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
\@ifundefined{AmSTeX}
   {\def\AmSTeX{\leavevmode\hbox{$\cal A\kern-.2em\lower.376ex%
        \hbox{$\cal M$}\kern-.2em\cal S$-\TeX}}}{}
\@ifundefined{AmSLaTeX}
   {\def\AmSLaTeX{\leavevmode\hbox{$\cal A\kern-.2em\lower.376ex%
        \hbox{$\cal M$}\kern-.2em\cal S$-\LaTeX}}}{}
\@ifundefined{BibTeX}
   {\def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em%
    T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}}{}
\@ifundefined{SliTeX}
   {\def\SliTeX{{\rm S\kern-.06emL\kern-.18em\raise.32ex\hbox
                {\sc i}\kern -.03em\TeX}}}{}
\@ifundefined{JTeX}
  {\def\JTeX{\leavevmode\lower.5ex\hbox{J}\kern-.17em\TeX}}{}
\@ifundefined{JLaTeX}
  {\def\JLaTeX{\leavevmode\lower.5ex\hbox{\rm J}\kern-.17em\LaTeX}}{}
\@ifundefined{JBibTeX}
  {\def\JBibTeX{\leavevmode\lower.6ex\hbox{\rm J}\kern-.15em\BibTeX}}{}

%% some definitions
\def\onelineskip{\par\vspace{1\baselineskip}\par}
\def\halflineskip{\par\vspace{.5\baselineskip}\par}

\def\doubledash{\hbox to 2zw{---\hss ---}}

\def\FRAC#1#2{\leavevmode\kern-.1em
  \raise.5ex\hbox{\the\scriptfont0 #1}\kern-.1em
  /\kern-.15em\lower.25ex\hbox{\the\scriptfont0 #2}}
\def\RN#1{\uppercase\expandafter{\romannumeral#1}}

\def\kintou#1#2{\@ifundefined{jintercharskip}%
 {\makebox[#1]{\kanjiskip\z@ plus 1fill minus 1fill\xkanjiskip=\kanjiskip #2}}%
 {\makebox[#1]{\jintercharskip=0pt plus 1fill minus 1fill 
 \jasciikanjiskip=\jintercharskip #2}}}

\def\ruby#1#2{\leavevmode \setbox0=\hbox{#1}\setbox1=\hbox{\tiny#2}%
\ifdim\wd0>\wd1 \dimen0=\wd0 \else \dimen0=\wd1 \fi
\hbox{\kanjiskip=\fill
 \vbox{\hbox to \dimen0{\tiny \hfil#2\hfil}%
  \nointerlineskip \hbox to \dimen0{\hfil#1\hfil}}}}

\def\QED{{\unskip\nobreak\hfil\penalty50
 \hskip1zw\hbox{}\nobreak\hfil \hbox{$\Box$\hskip1zw}
 \parfillskip\z@ \finalhyphendemerits\z@\par}}

\def\Hline{\noalign{\hrule height 0.4mm}}

\def\leq{\mathrel{\mathpalette\gl@align<}} \let\le=\leq
\def\geq{\mathrel{\mathpalette\gl@align>}} \let\ge=\geq
\def\gl@align#1#2{\lower.6ex\vbox{\baselineskip\z@skip\lineskip\z@
 \ialign{$\m@th#1\hfil##\hfil$\crcr#2\crcr=\crcr}}}
\def\subseteq{\rlap{\raisebox{.25ex}{$\subset$}}\raisebox{-1.1ex}{$=$}}
\def\supseteq{\rlap{\raisebox{.25ex}{$\supset$}}\raisebox{-1.1ex}{$=$}}
\def\neq{\mathrel{\mathpalette\c@ncelass=}}
\def\c@ncelass#1#2{\ooalign{$\hfil#1\mkern-.4mu|\hfil$\crcr$#1#2$}}
\let\ne=\neq


\if@endfloat
 \input endfloat.sty
 \def\figuresection{}
 \def\tablesection{}
 \if@lofloat
 \else
  \nofiglist\notablist
 \fi
\else
 \if@lofloat
  \let\oldenddocument=\enddocument
  \def\enddocument{
   \newpage\clearpage\listoffigures\listoftables
   \oldenddocument}
 \fi
\fi
