% Context file
% Filename: rotateedtable-notrotatedcaption.tex
% Willi Egger
% 03-06-2007
% Copyright (c) 2007 BOEDE. All rights reserved.
% Question on rotated and split table with caption not rotated with the table (Henning Hraban Ramm)
% Answered by Wolfgang Schuster

\setupoutput[pdftex]
\input rotatesplit
\enableregime[utf]

\startsetups caption:rotatedcaption
	\setupcaptions
	  [location={middle,left},
	   command={\rotate[rotation=-90]},
	   width=max,
	   align=middle]
\stopsetups

\startsetups caption:normalcaption
	\setupcaptions
	  [location=bottom,
	   command=,
	   width=fit,
	   align=]
\stopsetups

\def\rotatedcaption
  {\ifnum\floatrotation=90
     \setups{caption:rotatedcaption}
   \else\ifnum\floatrotation=270
     \setups{caption:rotatedcaption}
   \else
     \setups{caption:normalcaption}
   \fi\fi}

%\setupfloats[before=\rotatedcaption]

\showframe

\starttext

\dorecurse{10}{\input knuth\relax}

\chardef\floatrotation=90

\rotatedcaption

\placetable
  [90,split]
  [tab:religionen]
  {Götter}
  {\bTABLE[width=5cm]
   \dorecurse{100}{\bTR\bTD Text\eTD\eTR}
	\bTR\bTD Ende nach 100 Zeilen \eTD\eTR
   \eTABLE}

\chardef\floatrotation=0

\rotatedcaption

\placetable
  [split]
  [tab:religionen]
  {Götter}
  {\bTABLE[width=5cm]
   \dorecurse{100}{\bTR\bTD Text\eTD\eTR}
	\bTR\bTD Ende nach 100 Zeilen \eTD\eTR
   \eTABLE}

\dorecurse{10}{\input knuth\relax}

\stoptext
