%
% tatecaption.sty  Ver.1.00
% Thu Feb  4 21:04:05 JST 1999
% by sakapon@imc.im.hiroshima-cu.ac.jp
%
% $@!&(BpLaTeX2e $@@lMQ$G$9!#(B
% $@!&(Bgraphicx.sty $@$,I,?\$G$9!#(B\usepackage{graphicx} $@$7$F$$$J$$;~$O(B
%   $@<+F0$GFI$_$K9T$-$^$9!#(B
% $@!&(Bgraphicx.sty $@$N(B \rotatebox $@$r;H$C$F$$$k$N$G!"$3$l$r2r<a$7$J$$(B
%   dviware $@$K$O;H$($^$;$s!#(Bdvips, dviout $@$OBg>fIW$J$h$&$G$9!#(B
% $@!&(Bxdvi $@$O(B xdvik20c $@8=:_$G$OJ8;z$N2sE>$KBP1~$7$F$^$;$s!#(B
%   $@=>$C$F%?%$%W%;%C%H7k2L$r3NG'$7$?$$$H$-$O!"(B
%   % dvips foo.dvi | ghostview -
%   $@Ey$H$9$kI,MW$,$"$j$^$9!#(B
% $@!&(Bfloat $@Cf$G;H$C$F2<$5$$!#(Btable $@$G$b(B figure $@$G$bBg>fIW$@$H;W$$$^$9!#(B
% $@!&(Btgif $@$N?^Ey$O!"$"$i$+$8$a(B tgif $@>e(B Layout $@"*(B Landscape $@$G2sE>$5$;$F2<$5$$!#(B
%   $@$b$7$/$O(B \rotatebox $@$G2sE>$5$;$F2<$5$$!#(B
% $@!&:n<T$O$$$^$$$A(B LaTeX2e $@$,$o$+$C$F$J$$$N$G!"$H$s$G$b$J$$$3$H$r(B
%   $@$7$F$$$k$+$b$7$l$^$;$s!#(B(LaTeX2.09 $@$KHf$Y$F!"%^%/%m:n$k$N$,$9$4$/(B
%   $@Fq$7$$(B...)
%
% $@!&;H$$J}(B
%   \tatecaption{$@D9$5(B}{$@%-%c%W%7%g%s(B}
%   $@!VD9$5!W$K$O!"!V?^(B n:$@!W$N:8(B($@$D$^$j2<(B)$@$KF~$l$?$$%9%Z!<%9$r!"(B
%    LaTeX $@$G;HMQ$G$-$kD9$5$NC10L$G=q$-$^$9!#!V%-%c%W%7%g%s!W$O(B
%    $@%-%c%W%7%g%s$=$N$b$N!#(B
%    \tatecaption $@$O(B center $@4D6-$KI,$:F~$l$F2<$5$$!#(B
%    \label $@$bIaDL$K;H$($^$9!#(B
%        
%     
%
% $@!&Nc#1(B
%   \begin{figure}[p] % $@8+1I$(E*$K$O!"(B[p] $@%*%W%7%g%s$,NI$$H&(B
%     \begin{center}
%       \includegraphics{foo.eps} % foo.eps $@$O$"$i$+$8$a(B tgif $@>e$G2sE>(B
%       \tatecaption{3cm}{$@?^$NNc(B}
%       \label{fig:test}
%     \end{center}
%   \end{figure}
%
% $@!&Nc#2(B
%   \begin{figure}[p]
%     \begin{center}
%       \rotatebox{90}{\includegraphics{foo.eps}} % $@$3$N$h$&$K$=$N>l$G(B
%       \tatecaption{3cm}{$@?^$NNc(B}                 % $@2sE>$5$;$F$b(BOK
%       \label{fig:test}
%     \end{center}
%   \end{figure}

\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\RequirePackage{graphicx}

\def\tatecaption#1#2{\refstepcounter\@captype \@tatecaption{\@captype}{#1}{#2}}
\def\@maketatecaption#1#2#3{%
    \hskip\abovecaptionskip
    \global \@minipagefalse
    {\rotatebox{90}{\hskip#3 #1: #2}}%
        \hskip\belowcaptionskip}
\def\@tatecaption#1#2#3{%
  \begingroup
    \@parboxrestore
    \normalsize
    \@maketatecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}{#2}%
  \endgroup}
