summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/rotating/rotating.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/rotating/rotating.sty')
-rw-r--r--Master/texmf-dist/tex/latex/rotating/rotating.sty175
1 files changed, 117 insertions, 58 deletions
diff --git a/Master/texmf-dist/tex/latex/rotating/rotating.sty b/Master/texmf-dist/tex/latex/rotating/rotating.sty
index a94d0240f40..cba64105ffb 100644
--- a/Master/texmf-dist/tex/latex/rotating/rotating.sty
+++ b/Master/texmf-dist/tex/latex/rotating/rotating.sty
@@ -11,17 +11,22 @@
%% However, no permission is granted to distribute a modified version of
%% this file under its original name.
%%
-\def\RInfo{1997/09/26, v2.13}
-%% File: rotating.dtx Copyright (C) 1995--1999
-\ProvidesPackage{rotating}[\RInfo\space Rotation package]
+%% File: rotating.dtx
+%% Copyright 1995--1999 Sebastian Rahtz and Leonor Barroca
+%% Copyright 2001-2003,2007,2008 Robin Fairbairns
+%% Mail contact: rf10@cam.ac.uk
\NeedsTeXFormat{LaTeX2e}
-\newif\if@rot@twoside
-\DeclareOption{clockwise}{% this is for compatibility
+\ProvidesPackage{rotating}%
+ [2008/05/16 v2.15
+ rotated objects in LaTeX%
+ ]% $Id: rotating.dtx,v 1.12 2008/05/16 22:49:45 rf10 Exp rf10 $
+\DeclareOption{clockwise}{%
\AtBeginDocument{\setkeys{Grot}{units=360}}%
}
\DeclareOption{counterclockwise}{%
\AtBeginDocument{\setkeys{Grot}{units=-360}}%
}
+\DeclareOption{anticlockwise}{\ds@counterclockwise}
\DeclareOption{figuresleft}{%
\@rot@twosidefalse
\def\rot@LR{0}%
@@ -30,20 +35,36 @@
\@rot@twosidefalse
\def\rot@LR{-1}%
}
-\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphics}}
-\ExecuteOptions{clockwise}
+\newif\ifrot@messages
+\DeclareOption{quiet}{%
+ \rot@messagesfalse
+ \let\rot@message\@gobble % pro tem -- should suppress altogether
+}
+\DeclareOption{log}{%
+ \rot@messagestrue
+ \def\rot@message{\PackageInfo{rotating}}%
+}
+\DeclareOption{chatter}{%
+ \rot@messagestrue
+ \def\rot@message{\PackageWarning{rotating}}%
+}
+\newif\if@rot@twoside
\if@twoside
\@rot@twosidetrue
\else
\@rot@twosidefalse
\fi
\def\rot@LR{-1}
+\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphicx}}
+\ExecuteOptions{clockwise,quiet}
\ProcessOptions
\RequirePackage{graphicx}
\RequirePackage{ifthen}
\def\rotdriver#1{\makeatletter\input{#1.def}\makeatother}
\newcounter{r@tfl@t}
\setcounter{r@tfl@t}{0}
+\newskip\rotFPtop \rotFPtop=\@fptop
+\newskip\rotFPbot \rotFPbot=\@fpbot
\def\sideways{%
\Grot@setangle{90}%
\setbox\z@\hbox\bgroup\ignorespaces}
@@ -92,31 +113,43 @@
}
\def\end@rotfloat{%
\end{minipage}\end{lrbox}%
- \global\addtocounter{r@tfl@t}{1}%
+ \stepcounter{r@tfl@t}%
\rot@label{RF\ther@tfl@t}%
- \message{Adding sideways figure on }%
- \def\R@@page{\pageref{RF\ther@tfl@t}}%
+ \rot@pageref{RF\ther@tfl@t}{\R@@page}%
+ \rot@mess@toks{Adding sideways \@captype\space on page \R@@page\space}
\wd\rot@float@box\z@
\ht\rot@float@box\z@
\dp\rot@float@box\z@
\vbox to \textheight{%
\setkeys{Grot}{units=360}%
\if@rot@twoside
- \def\R@@page{\pageref{RF\ther@tfl@t}}%
\else
\let\R@@page\rot@LR
\fi
\ifthenelse{\isodd{\R@@page}}{%
- \message{right hand page}%
- \vfill
- \centerline{\rotatebox{90}{\box\rot@float@box}}%
- }{%
- \message{left hand page}%
- \centerline{\rotatebox{-90}{\box\rot@float@box}}%
- \vfill
- }%
- }%
- \end@float
+ \if@rot@twoside
+ \rot@mess@toks\expandafter{\the\rot@mess@toks right hand page}%
+ \fi
+ \vfill
+ \@@line{%
+ \hskip\rotFPtop
+ \rotatebox{90}{\box\rot@float@box}%
+ \hskip\rotFPbot
+ }%
+ }{%
+ \if@rot@twoside
+ \rot@mess@toks\expandafter{\the\rot@mess@toks left hand page}%
+ \fi
+ \@@line{%
+ \hskip\rotFPbot
+ \rotatebox{-90}{\box\rot@float@box}%
+ \hskip\rotFPtop
+ }%
+ \vfill
+ }%
+ \rot@message{\the\rot@mess@toks}
+ }%
+ \end@float
}
\def\sidewaysfigure{\@rotfloat{figure}}
\let\endsidewaysfigure\end@rotfloat
@@ -132,36 +165,51 @@
\begin{lrbox}\rot@float@box
\begin{minipage}\textheight
}
-\def\end@rotdblfloat{%
- \end{minipage}\end{lrbox}%
- \global\addtocounter{r@tfl@t}{1}%
- \rot@label{RF\ther@tfl@t}%
- \message{Adding sideways figure on }%
- \def\R@@page{\pageref{RF\ther@tfl@t}}%
- \@tempdima\ht\rot@float@box
- \advance\@tempdima by \dp\rot@float@box
-\typeout{BOX wd: \the\wd\rot@float@box, ht: \the\ht\rot@float@box, dp: \the\dp\rot@float@box: so shift by .5 of \the\@tempdima}%
- \wd\rot@float@box\z@
- \ht\rot@float@box\z@
- \dp\rot@float@box\z@
- \vbox to \textheight{%
+\def\@rotdblfloat{%
+ \end{minipage}\end{lrbox}%
+ \stepcounter{r@tfl@t}%
+ \rot@label{RF\ther@tfl@t}%
+ \rot@pageref{RF\ther@tfl@t}{\R@@page}%
+ \rot@mess@toks{Adding sideways \@captype\space on page \R@@page\space}
+ \@tempdima\ht\rot@float@box
+ \advance\@tempdima by \dp\rot@float@box
+ \wd\rot@float@box\z@
+ \ht\rot@float@box\z@
+ \dp\rot@float@box\z@
+ \vbox to \textheight{%
\setkeys{Grot}{units=360}%
\if@rot@twoside
- \def\R@@page{\pageref{RF\ther@tfl@t}}%
\else
\let\R@@page\rot@LR
\fi
\ifthenelse{\isodd{\R@@page}}{%
- \message{right hand page}%
- \vfill
- \hbox to\textwidth{\hfill\rotatebox{90}{\box\rot@float@box}\hfill}%
- }{%
- \message{left hand page}%
- \hbox to \textwidth{\hfill\rotatebox{-90}{\box\rot@float@box}\hfill}%
- \vfill
- }%
- }%
- \end@dblfloat
+ \ifrot@messages
+ \if@rot@twoside
+ \rot@mess@toks\expandafter{\the\rot@mess@toks right hand page}%
+\fi
+ \fi
+ \vfill
+ \@@line{%
+ \hskip\rotFPtop
+ \rotatebox{90}{\box\rot@float@box}%
+ \hskip\rotFPbot
+ }%
+ }{%
+ \ifrot@messages
+ \if@rot@twoside
+ \rot@mess@toks\expandafter{\the\rot@mess@toks left hand page}%
+\fi
+ \fi%
+ \@@line{%
+ \hskip\rotFPbot
+ \rotatebox{-90}{\box\rot@float@box}%
+ \hskip\rotFPtop
+ }%
+ \vfill
+ }%
+ \rot@message{\the\rot@mess@toks}%
+ }%
+ \end@dblfloat
}
\newenvironment{sidewaystable*}
{\@rotdblfloat{table}}
@@ -170,21 +218,32 @@
{\@rotdblfloat{figure}}
{\end@rotdblfloat}
-\long\def \r@protected@write#1#2#3{%
- \begingroup
- \let\therpage\relax
- #2%
- \let\protect\@unexpandable@protect
- \edef\reserved@a{\write#1{#3}}%
- \reserved@a
- \endgroup
- \if@nobreak\ifvmode\nobreak\fi\fi
-}
-\def\therpage{\arabic{page}}
+\def\rot@thepage{\@arabic\c@page}
\def\rot@label#1{\@bsphack
- \r@protected@write\@auxout{}%
- {\string\newlabel{#1}{{\@currentlabel}{\therpage}}}%
+ \rot@protected@write{\@auxout}{}%
+ {\string\newlabel{#1}{\rot@thepage}}%
\@esphack}
+\def\rot@pageref#1#2{%
+ \expandafter\ifx\csname r@#1\endcsname\relax
+ \global\@rot@refundefinedtrue
+ \def#2{0}%
+ \else
+ \edef#2{\csname r@#1\endcsname}%
+ \fi
+}
+\long\def\rot@protected@write#1#2#3{%
+ \begingroup
+ \let\rot@thepage\relax
+ #2%
+ \let\protect\@unexpandable@protect
+ \edef\reserved@a{\write#1{#3}}%
+ \reserved@a
+ \endgroup
+ \if@nobreak\ifvmode\nobreak\fi\fi
+}
+\newif\if@rot@refundefined
+\global\@rot@refundefinedfalse
+\newtoks\rot@mess@toks
\def\rotcaption{\refstepcounter\@captype\@dblarg{\@rotcaption\@captype}}
\long\def\@rotcaption#1[#2]#3{%
\addcontentsline{\csname ext@#1\endcsname}{#1}{%