diff options
author | Karl Berry <karl@freefriends.org> | 2006-01-12 23:57:15 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2006-01-12 23:57:15 +0000 |
commit | a666a985f37c14731058afd08c5dc92ec9600524 (patch) | |
tree | 55af18880d5abbf41ee8ec9ee1c14a3604d587e8 /Master/texmf-dist/tex | |
parent | 89676d2bc257e3b020cb4692ffa5cb092470a1b5 (diff) |
isorot
git-svn-id: svn://tug.org/texlive/trunk@1001 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex')
-rw-r--r-- | Master/texmf-dist/tex/latex/isorot/isorot.sty | 266 |
1 files changed, 266 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/isorot/isorot.sty b/Master/texmf-dist/tex/latex/isorot/isorot.sty new file mode 100644 index 00000000000..0b66d11a910 --- /dev/null +++ b/Master/texmf-dist/tex/latex/isorot/isorot.sty @@ -0,0 +1,266 @@ +%% +%% This is file `isorot.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% isorot.dtx (with options: `rot') +%% +%% This program has been partly developed under US government +%% funding and is not subject to copyright. +%% +%% This program is provided under the terms of the +%% LaTeX Project Public License distributed from CTAN +%% archives in directory macros/latex/base/lppl.txt. +%% +%% Author: Peter Wilson (CUA) +%% now at: peter.r.wilson@boeing.com +%% +\ProvidesPackage{isorot}[2000/02/15 v2.1 ISO rotation package] +\newcount\PWRFc@tracing +\DeclareOption{errorshow}{\PWRFc@tracing\z@} +\DeclareOption{debugshow}{\PWRFc@tracing5\relax} +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphics}} +\ProcessOptions +\newcommand\PWRF@trace[2]{% + \ifnum\PWRFc@tracing>#1\relax + \GenericWarning + {(isorot)\@spaces\@spaces} + {Package isorot: #2}% + \fi +} +\NeedsTeXFormat{LaTeX2e} +\RequirePackage{graphicx} +\RequirePackage{lscape} +\def\rotdriver#1{% + \message{The .dvi file is to be processed by the #1 driver.} + \typeout{Change rotdriver in the source accordingly if you do not have this.} + \makeatletter\input{#1.def}\makeatother} +\newif\if@rot@twoside +\def\Grot@setnegangle#1{% + \dimen@#1\p@ + \dimen@-\dimen@ + \edef\Grot@angle{\strip@pt\dimen@}} +\newif\ifcl@ckwise +\newcommand{\figuresleft}{% + \@rot@twosidefalse + \def\rot@LR{0}% +} +\newcommand{\figuresright}{% + \@rot@twosidefalse + \def\rot@LR{-1}% +} +\newcommand{\clockwise}{% + \cl@ckwisetrue +} +\newcommand{\counterclockwise}{% + \cl@ckwisefalse +} +\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@label#1{\@bsphack + \r@protected@write\@auxout{}% + {\string\newlabel{#1}{{\@currentlabel}{\therpage}}}% + \@esphack} +\newcounter{r@tfl@t} +\setcounter{r@tfl@t}{0} +\if@twoside + \@rot@twosidetrue +\else + \@rot@twosidefalse +\fi +\newcommand{\rotatedirection}[1]{% + \def\@tempa{#1}\def\@tempb{clockwise}% + \ifx\@temp\@tempb + \cl@ckwisetrue + \else + \cl@ckwisefalse + \fi} +\clockwise +\figuresright +\def\sideways{% + \Grot@setangle{90}% + \setbox\z@\hbox\bgroup\ignorespaces} +\def\endsideways{% + \unskip\egroup + \Grot@x\z@ + \Grot@y\z@ + \Grot@box +} +\def\turn#1{% + \ifcl@ckwise + \Grot@setnegangle{#1} + \else + \Grot@setangle{#1} + \fi + \setbox\z@\hbox\bgroup\ignorespaces} +\def\endturn{% + \unskip\egroup + \Grot@x\z@ + \Grot@y\z@ + \Grot@box +} +\def\rotate#1{% + \ifcl@ckwise + \Grot@setnegangle{#1} + \else + \Grot@setangle{#1} + \fi + \setbox\z@\hbox\bgroup\ignorespaces} +\def\endrotate{% + \unskip\egroup + \Grot@x\z@ + \Grot@y\z@ + \wd0\z@\dp0\z@\ht0\z@ + \Grot@box +} +\def\turnbox#1#2{% + \ifcl@ckwise + \Grot@setnegangle{#1} + \else + \Grot@setangle{#1} + \fi + \setbox\z@\hbox{{#2}}% + \Grot@x\z@ + \Grot@y\z@ + \wd0\z@\dp0\z@\ht0\z@ + \Grot@box +} +\newsavebox\rot@float@box +\def\@rotfloat#1{% + \@ifnextchar[% + {\@xrotfloat{#1}}% + {\edef\@tempa{\noexpand\@xrotfloat{#1}[\csname fps@#1\endcsname]}\@tempa}% +} +\def\@xrotfloat#1[#2]{% + \@float{#1}[#2]% + \begin{lrbox}\rot@float@box + \begin{minipage}\textheight +} +\def\end@rotfloat{% + \end{minipage}\end{lrbox}% + \global\addtocounter{r@tfl@t}{1}% + \rot@label{RF\ther@tfl@t}% + \def\R@@page{\pageref{RF\ther@fl@t}}% + \wd\rot@float@box\z@ + \ht\rot@float@box\z@ + \dp\rot@float@box\z@ + \vbox to \textheight{% + \if@rot@twoside + \def\R@@page{\pageref{RF\ther@tfl@t}}% + \else + \let\R@@page\rot@LR + \fi + \ifodd\R@@page + \PWRF@trace\tw@{Adding sideways float on right hand page}% + \vfill + \centerline{\rotatebox{90}{\box\rot@float@box}}% + \else + \PWRF@trace\tw@{Adding sideways float on left hand page}% + \centerline{\rotatebox{-90}{\box\rot@float@box}}% + \vfill + \fi + }% + \end@float +} +\def\@rotdblfloat{% + \if@twocolumn\let\reserved@a\@rotdblflt\else\let\reserved@a\@rotfloat\fi + \reserved@a} +\def\@rotdblflt#1{\@ifnextchar[{\@rotxdblfloat{#1}}{\@rotxdblfloat{#1}[tp]}} +\def\@rotxdblfloat#1[#2]{% + \hsize\textwidth\linewidth\textwidth + \@float{#1}[#2]% + \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}% + \def\R@@page{\pageref{RF\ther@tfl@t}}% + \@tempdima\ht\rot@float@box + \advance\@tempdima by \dp\rot@float@box + \PWRF@trace\thr@@{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{% + \if@rot@twoside + \def\R@@page{\pageref{RF\ther@tfl@t}}% + \else + \let\R@@page\rot@LR + \fi + \ifodd\R@@page + \PWRF@trace\tw@{Adding sideways float on right hand page}% + \vfill + \hbox to \textwidth{\hfill\rotatebox{90}{\box\rot@float@box}\hfill}% + \else + \PWRF@trace\tw@{Adding sideways float on left hand page}% + \hbox to \textwidth{\hfill\rotatebox{-90}{\box\rot@float@box}\hfill}% + \vfill + \fi + } + \end@dblfloat +} +\@ifundefined{@initisofig}{% + \newcommand{\@initisofig}{} + \newcommand{\@initisotab}{} + \newif\ifinfloat + \newcommand{\rotcapfont}{}}{\newcommand{\rotcapfont}{\captionsize\bf}} +\def\sidewaysfigure{% + \@initisofig + \@rotfloat{figure}} +\def\endsidewaysfigure{\end@rotfloat\infloatfalse} +\def\sidewaystable{% + \@initisotab + \@rotfloat{table}} +\def\endsidewaystable{\end@rotfloat\infloatfalse} +\newenvironment{sidewaysfigure*}{% + \@initisofig + \@rotdblfloat{figure}}{% + \end@rotdblfloat\infloatfalse} +\newenvironment{sidewaystable*}{% + \@initisotab + \@rotdblfloat{table}}{% + \end@rotdblfloat\infloatfalse} +\def\rotcaption{\refstepcounter\@captype\@dblarg{\@rotcaption\@captype}} +\long\def\@rotcaption#1[#2]#3{% + \addcontentsline{\csname ext@#1\endcsname}{#1}{% + \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}% + \par + \begingroup + \@parboxrestore + \normalsize + \@makerotcaption{\csname fnum@#1\endcsname}{#3}% + \endgroup} +\long\def\@makerotcaption#1#2{% + \hspace{\abovecaptionskip} + \setbox\@tempboxa\hbox{{\rotcapfont #1 -- #2}}% + \ifdim \wd\@tempboxa > .8\vsize + \rotatebox{90}{% + \begin{minipage}{.8\textheight}{\centering{\rotcapfont #1 -- #2}\par}\end{minipage}% + }\par + \else% + \rotatebox{90}{\box\@tempboxa}% + \fi + \hspace{\belowcaptionskip} +} +\newcommand{\controtcaption}{\@controtcaption\@captype} +\long\def\@controtcaption#1#2{% + \begingroup + \@parboxrestore + \normalsize + \@makerotcaption{\csname fnum@#1\endcsname}{\ignorespaces #2}\par + \endgroup} +\endinput +%% +%% End of file `isorot.sty'. |