diff options
Diffstat (limited to 'macros/latex/contrib/isorot')
-rw-r--r-- | macros/latex/contrib/isorot/README | 28 | ||||
-rw-r--r-- | macros/latex/contrib/isorot/isorot.dtx | 1536 | ||||
-rw-r--r-- | macros/latex/contrib/isorot/isorot.ins | 65 | ||||
-rw-r--r-- | macros/latex/contrib/isorot/rotman.pdf | bin | 0 -> 168935 bytes | |||
-rw-r--r-- | macros/latex/contrib/isorot/rotman.tex | 897 |
5 files changed, 2526 insertions, 0 deletions
diff --git a/macros/latex/contrib/isorot/README b/macros/latex/contrib/isorot/README new file mode 100644 index 0000000000..36ef2e23cd --- /dev/null +++ b/macros/latex/contrib/isorot/README @@ -0,0 +1,28 @@ + The isorot package is for rotation of document elements. It is a +combination of the lscape package and an extension of the rotating package. +It is designed for use with the iso class but can be used with any +`normal' class. The package requires the lscape and graphicx packages +to be available. + + The distribution is released under the LPPL and consists of the +following files: +README (this file) +isorot.ins +isorot.dtx +rotman.tex +rotman.pdf + + To install the package: +o run: latex isorot.ins (which will generate isorot.sty) +o Either latex rotman.tex or print rotman.pdf for the User Manual +o Move isorot.sty to a location where LaTeX will find it. +o For a copy of the commented code: + o run: latex isorot.dtx + o run: makeindex -s gind.ist isorot + o run: latex isorot.dtx + o Print isorot.dvi for a hardcopy of the commented code + + +2000/02/15 +Peter Wilson +peter.r.wilson@boeing.com diff --git a/macros/latex/contrib/isorot/isorot.dtx b/macros/latex/contrib/isorot/isorot.dtx new file mode 100644 index 0000000000..b027b4cc67 --- /dev/null +++ b/macros/latex/contrib/isorot/isorot.dtx @@ -0,0 +1,1536 @@ +% \iffalse meta-comment +% +% isorot.dtx +% +% +% 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 +% +% \fi +% \CheckSum{1619} +% +% +% \def\fileversion{v2.1} +% \def\filedate{2000/02/15} +% \title{\LaTeX{} files for typesetting ISO Standards: \\ +% Source code: The isorot package\thanks{This +% file has version number \fileversion, last revised +% \filedate.}} +% +% \author{% +% Peter Wilson\\ +% Catholic University of America\thanks{This work was originally +% performed at Rensselaer Polytechnic Institute.} \\ +% Now at \texttt{peter.r.wilson@boeing.com} +% } +% \date{\filedate} +% \maketitle +% \tableofcontents +% +% \StopEventually{} +% +% +% +% \section{Introduction} +% +% This document provides the commented source for \LaTeX{} +% package files designed for the typesetting of +% documents according to the rules for ISO international standards. +% A seperate document provides the user manual~\cite{PRW96i}. +% This manual is typeset according to the conventions of the +% \LaTeX{} \textsc{docstrip} utility which enables the automatic +% extraction of the \LaTeX{} macro source files~\cite{GOOSSENS94}. +% +% ISO (the International Organization for Standardisation) specify +% their document layout requirements in ISO Directives~\cite{ISOD397}. +% Unfortunately these Directives do not completely define the document +% layout, leaving several aspects open to interpretation by the +% document editor and re-interpretation by the ISO editorial board. +% The following specifications are a re-implementation of the \LaTeX{} +% macros that have been used for the production of camera ready copy +% for the ISO~10303 standard {\em Product data representation and +% exchange}. The initial release of ISO~10303:1994 consisted of twelve +% parts and over 2400 pages. The editorial board of the ISO Central +% Secretariat in Geneva accepted the typographic conventions embodied +% in these macros. +% +% This manual is provided as a service for future developers +% and maintainers of the +% class and packages for ISO standards. It is assumed that any +% any such person is \LaTeX{} literate and accustomed to supporting +% complex class and package files~\cite{GOOSSENS94}. +% +% +% Section~\ref{sec:docstrip} describes some +% administrative elements and code for general use later in the specification. +% Section~\ref{sec:rot} specifies +% the macros for rotation of textual and tabular elements. +% +% \section{The {\sc docstrip} modules} \label{sec:docstrip} +% +% The following modules are used in the implementation to direct +% {\sc docstrip} in generating the external files: +% \begin{center} +% \begin{tabular}{ll} +% rot & produce the isorot package\\ +% rotne & produce the isorotne style file\\ +% driver & produce a documentation driver file \\ +% \end{tabular} +% \end{center} +% +% \subsection{A driver for this document} +% +% The next series of code contains the documentation driver file for +% \LaTeX, i.e., the file that will produce the documentation you are +% currently reading. This will be extracted from this file by the +% {\sc docstrip} program. +% +% \begin{macrocode} +%<*driver> +\documentclass{ltxdoc} +% \end{macrocode} +% +% We do not want the following basic elements to appear in the index. +% \begin{macrocode} +\DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath} +\DoNotIndex{\@centercr,\@cite} +\DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue} +\DoNotIndex{\@input,\@ixpt,\@m} +\DoNotIndex{\@minus,\@mkboth,\@ne,\@nil,\@nomath,\@plus,\@set@topoint} +\DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb} +\DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt} +\DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt} +\DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace} +\DoNotIndex{\advance,\Alph,\alph} +\DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box} +\DoNotIndex{\bullet} +\DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption} +\DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass} +\DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist} +\DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup} +\DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter} +\DoNotIndex{\fbox} +\DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef} +\DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule} +\DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi} +\DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi} +\DoNotIndex{\input} +\DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark} +\DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright} +\DoNotIndex{\month,\newcommand,\newcounter,\newenvironment} +\DoNotIndex{\NeedsTeXFormat,\newdimen} +\DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number} +\DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@} +\DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip} +\DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions} +\DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright} +\DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font} +\DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily,\roman} +\DoNotIndex{\roman,\secdef,\selectfont,\setbox,\setcounter,\setlength} +\DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space} +\DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase} +\DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt} +\DoNotIndex{\viipt,\vipt,\vskip,\vspace} +\DoNotIndex{\wd,\xiipt,\year,\z@} +% \end{macrocode} +% We do want an index, using linenumbers, but not update information. +% \begin{macrocode} +\EnableCrossrefs +\CodelineIndex +%%%% \RecordChanges +% \end{macrocode} +% We may use so many \file{docstrip} modules that we set the +% \texttt{StandardModuleDepth} counter to 1. +% \begin{macrocode} +\setcounter{StandardModuleDepth}{1} +% \end{macrocode} +% Some commonly used abbreviations +% \begin{macrocode} +\newcommand*{\Lopt}[1]{\textsf {#1}} % typeset an option +\newcommand*{\file}[1]{\texttt {#1}} % typeset a file +\newcommand*{\Lcount}[1]{\textsl {\small#1}} % typeset a counter +\newcommand*{\pstyle}[1]{\textsl {#1}} % typeset a pagestyle +\newcommand*{\Lenv}[1]{\texttt {#1}} % typeset an environment +% \end{macrocode} +% We want the full details printed. +% \begin{macrocode} +\begin{document} +\DocInput{isorot.dtx} +\end{document} +%</driver> +% \end{macrocode} +% +% +% \section{Identification} \label{sec:id} +% +% Announce the name, option files and version for \LaTeX 2e files: +% \begin{macrocode} +%<rot>\ProvidesPackage{isorot}[2000/02/15 v2.1 ISO rotation package] +% \end{macrocode} +% +% These files are for use with \LaTeX\ v2.09 or a disadvantaged \LaTeX 2e +% distribution. +% \begin{macrocode} +%<rotne>\typeout{isorotne.sty [1997/12/02 v2 LaTeX 2.09 ISO rotation package]} +% \end{macrocode} +% +% +% \section{The \file{isorot} package and \file{isorotne} style} \label{sec:rot} +% +% The \file{isorot} package provides a specialization of the \file{rotating} +% package +% for use within ISO standard documents. The principal modifications +% relate to the table and figure environments. The original \file{rotating} +% package was developed by +% Sebastian Rahtz and Leonor Barroca\footnote{Sebastian Rahtz and Leonor +% Barroca, {\em A style option for rotated objects in TeX,} TUGboat, 13, 2, +% pp 156--180, July 1992.}. +% +% Apparently not all distributions of \LaTeX{} contain the necessary +% packages for a simple implementation. The \file{isorotne} style provides +% the same capabilities for these users. +% This essentially replaces all \LaTeX 2e facilities from \file{rotating} +% by generic ones, and includes the relevent package sources within the one +% file. +% +% \changes{v11}{1997/09/30}{Added new dvi drivers to isrotne package} +% \changes{v2}{1997/12/02}{Updated rotations to rotating v2.12} +% \changes{v2.1}{2000/02/15}{Updated to latest ISO class, and generalised for any class} +% \begin{macrocode} +%<*rot|rotne> +% \end{macrocode} +% +% The package takes one option which prints debugging information. +% +% \begin{macro}{\PWRFc@tracing} +% A counter controlling debug printing. +% \begin{macrocode} +\newcount\PWRFc@tracing +\DeclareOption{errorshow}{\PWRFc@tracing\z@} +\DeclareOption{debugshow}{\PWRFc@tracing5\relax} +\DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphics}} +\ProcessOptions +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\PWRF@trace} +% A macro that gets the trace message as its argument. +% \begin{macrocode} +\newcommand\PWRF@trace[2]{% + \ifnum\PWRFc@tracing>#1\relax + \GenericWarning + {(isorot)\@spaces\@spaces} + {Package isorot: #2}% + \fi +} +% \end{macrocode} +% \end{macro} +% +% For the \file{isorot} package most of the work is done by the +% \file{graphicx} package, so make sure it is loaded. Also, David +% Carlisle's \file{lscape} package is required for landscaping some +% pages or long wide tables. +% \begin{macrocode} +%<*rot> +\NeedsTeXFormat{LaTeX2e} +\RequirePackage{graphicx} +\RequirePackage{lscape} +%</rot> +% \end{macrocode} +% +% For the disadvantaged user, the required basic facilities are +% a portion of the \file{graphics} package, which in turn requires +% the \file{trig} package. We also need the code from the +% \file{lscape} package. +% +% \begin{macrocode} +%<*rotne> +% \end{macrocode} +% Firstly, here is the code from the \file{trig} package. +% +% \subsection{Trigonometry functions} +% +% \emph{The following is the contents of the \file{trig} package written by +% David Carlisle. The code and explanations are from \file{trig.dtx} +% version 1.08, dated 1994/10/16. The original file should be consulted +% for a full explanation.} +% +% +% These macros implement the trigonometric functions, sin, cos and tan. +% In each case two commands are defined. For instance the command +% |\CalculateSin{33}| may be isued at some point, and then anywhere +% later in the document, the command |\UseSin{33}| will return the +% decimal expansion of $\sin(33^\circ)$. +% +% The arguments to these macros do not have to be whole numbers, +% although in the case of whole numbers, \LaTeX\ or plain \TeX\ counters +% may be used. In \TeX{}Book syntax, arguments must be of type: +% \meta{optional signs}\meta{factor} +% +% Some other examples are:\\ +% |\CalculateSin{22.5}|, |\UseTan{\value{mycounter}}|, +% |\UseCos{\count@}|. +% +% Note that unlike the psfig macros, these save all previously +% computed values. This could easily be changed, but I thought that in +% many applications one would want many instances of the +% same value. (eg rotating all the headings of a table by the +% \emph{same} amount). +% +% Some useful constants for converting between degrees and radians. +% $$\frac{\pi}{180}\simeq\frac{355}{113\times180}=\frac{71}{4068}$$ +% \begin{macrocode} +\chardef\nin@ty=90 +\chardef\@clxx=180 +\chardef\@lxxi=71 +\mathchardef\@mmmmlxviii=4068 +% \end{macrocode} +% +% The approximation to $\sin$. +% \begin{eqnarray*} +% \sin(x)& \simeq& x - (1/3!)x^3 + (1/5!)x^5 - (1/7!)x^7 + (1/9!)x^9\\ +% &\simeq&\frac{((((7!/9!x^2-7!/7!)x^2+7!/5!)x^2 +7!/3!)x^2+7!/1!)x} +% {7!}\\ +% &=&\frac{((((1/72x^2-1)x^2+42)x^2 +840)x^2+5040)x} +% {5040} +% \end{eqnarray*} +% +% \begin{macrocode} +\chardef\@coeffz=72 +%\chardef\@coefa=1 +\chardef\@coefb=42 +\mathchardef\@coefc=840 +\mathchardef\@coefd=5040 +% \end{macrocode} +% +% \begin{macrocode} +{\catcode`t=12\catcode`p=12\gdef\noPT#1pt{#1}} +\def\TG@rem@pt#1{\expandafter\noPT\the#1\space} +% \end{macrocode} +% +% \begin{macrocode} +\def\TG@term#1{% + \dimen@\@tempb\dimen@ + \advance\dimen@ #1\p@} +% \end{macrocode} +% +% \begin{macrocode} +\def\TG@series{% + \dimen@\@lxxi\dimen@ + \divide \dimen@ \@mmmmlxviii + \edef\@tempa{\TG@rem@pt\dimen@}% + \dimen@\@tempa\dimen@ + \edef\@tempb{\TG@rem@pt\dimen@}% + \divide\dimen@\@coeffz + \advance\dimen@\m@ne\p@ + \TG@term\@coefb + \TG@term{-\@coefc}% + \TG@term\@coefd + \dimen@\@tempa\dimen@ + \divide\dimen@ \@coefd} +% \end{macrocode} +% +% \begin{macrocode} +\def\CalculateSin#1{{% + \expandafter\ifx\csname sin(\number#1)\endcsname\relax + \dimen@=#1\p@\TG@@sin + \expandafter\xdef\csname sin(\number#1)\endcsname + {\TG@rem@pt\dimen@}% + \fi}} +% \end{macrocode} +% +% \begin{macrocode} +\def\CalculateCos#1{{% + \expandafter\ifx\csname cos(\number#1)\endcsname\relax + \dimen@=\nin@ty\p@ + \advance\dimen@-#1\p@ + \TG@@sin + \expandafter\xdef\csname cos(\number#1)\endcsname + {\TG@rem@pt\dimen@}% + \fi}} +% \end{macrocode} +% +% \begin{macrocode} +\def\TG@reduce#1#2{% +\dimen@#1#2\nin@ty\p@ + \advance\dimen@#2-\@clxx\p@ + \dimen@-\dimen@ + \TG@@sin} +% \end{macrocode} +% +% \begin{macrocode} +\def\TG@@sin{% + \ifdim\TG@reduce>+% + \else\ifdim\TG@reduce<-% + \else\TG@series\fi\fi}% +% \end{macrocode} +% +% \begin{macrocode} +\def\UseSin#1{\csname sin(\number#1)\endcsname} +\def\UseCos#1{\csname cos(\number#1)\endcsname} +% \end{macrocode} +% +% \begin{macrocode} +\chardef\z@num\z@ +\expandafter\let\csname sin(0)\endcsname\z@num +\expandafter\let\csname cos(0)\endcsname\@ne +\expandafter\let\csname sin(90)\endcsname\@ne +\expandafter\let\csname cos(90)\endcsname\z@num +\expandafter\let\csname sin(-90)\endcsname\m@ne +\expandafter\let\csname cos(-90)\endcsname\z@num +\expandafter\let\csname sin(180)\endcsname\z@num +\expandafter\let\csname cos(180)\endcsname\m@ne +% \end{macrocode} +% +% This is accurate to 4 decimal places for angles up to +% $50^\circ$, after that the accuracy tails off, giving +% 57.47894 instead of 57.2900 for $89^\circ$. +% \begin{macrocode} +\def\CalculateTan#1{{% + \expandafter\ifx\csname tan(\number#1)\endcsname\relax + \CalculateSin{#1}% + \CalculateCos{#1}% + \@tempdima\UseCos{#1}\p@ + \divide\@tempdima\@iv + \@tempdimb\UseSin{#1}\p@ + \@tempdimb\two@fourteen\@tempdimb + \divide\@tempdimb\@tempdima + \expandafter\xdef\csname tan(\number#1)\endcsname + {\TG@rem@pt\@tempdimb}% + \fi}} +% \end{macrocode} +% +% \begin{macrocode} +\def\UseTan#1{\csname tan(\number#1)\endcsname} +% \end{macrocode} +% +% \begin{macrocode} +\mathchardef\two@fourteen=16384 +\chardef\@iv=4 +% \end{macrocode} +% +% \begin{macrocode} +\expandafter\def\csname tan(90)\endcsname{\errmessage{Infinite tan !}} +\expandafter\let\csname tan(-90)\expandafter\endcsname + \csname tan(90)\endcsname +% \end{macrocode} +% +% \subsection{Landscape environment} +% +% The \file{lscape} package by David Carlisle provides a landscape +% environment which prints the enclosed pages in landscape rather +% than portrait. For 2.09 this package does not work, so we provide +% for the functionality here. The following code is taken from +% the \file{lscape} package.\footnote{Version 3.0, last revised +% 1994/10/05.} +% +% \begin{environment}{landscape} +% \begin{macrocode} +\let\LS@makecol=\@makecol +\let\LS@makefcolumn=\@makefcolumn +\def\LS@rot{% + \setbox\@outputbox\vbox{\hbox{\rotatebox{90}{\box\@outputbox}}}} +\def\landscape{% + \clearpage + \begingroup + \vsize=\textwidth + \hsize=\textheight + \linewidth=\hsize + \columnwidth=\hsize + \@colroom=\vsize + \textheight=\vsize + \@colht=\vsize + \def\@makecol{\LS@makecol\LS@rot}% + \def\@makefcolumn##1{\LS@makefcolumn{##1}\LS@rot}} +\def\endlandscape{% + \clearpage + \endgroup + \global\@colht=\textheight + \global\vsize=\textheight + \global\@colroom=\textheight} +% \end{macrocode} +% \end{environment} +% +% \begin{macrocode} +%</rotne> +% \end{macrocode} +% +% \subsection{Drivers} +% +% Rotation is not done within \TeX\ but by the device drivers via |\special| +% commands appropriate for each driver. +% +% \begin{macrocode} +%<*rot> +\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} +%</rot> +% \end{macrocode} +% +% \begin{macrocode} +%<*rotne> +% \end{macrocode} +% +% Life is much more difficult for the \file{isorotne} style as we have to +% include source (runnable under 2.09) that the \file{isorot} package +% gets for free. +% +% \begin{macro}{\Grot@start} +% \begin{macro}{\Grot@end} +% The commands |\Grot@start| and |\Grot@end| are defined which assume +% that the macro |\Grot@angle| contains the rotation angle. First +% set these to do nothing, just in case the user calls for an unsupported +% driver. +% \begin{macrocode} + \def\Grot@start{} + \def\Grot@end{} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\Dvitops@count} +% A counter for the DVITOPS driver. +% \begin{macrocode} +\newcount\Dvitops@count +\Dvitops@count=\@ne +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\listrotdrivers} +% Writes out the list of currently available rotdrivers. +% \begin{macrocode} +\newcommand{\listrotdrivers}{% + \typeout{If you do not have this driver then change rotdriver in your source.} + \typeout{Available rotdrivers are:} + \typeout{ \space\space dvipdf, dvips, dvipsone, dvitops, dviwindo,} + \typeout{ \space\space pctex32, pctexps, pubps, textures} +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\rotdriver} +% The command |\rotdriver{|\meta{driver}|}| must be put in the preamble, +% where \meta{driver} is the identification of one of the drivers that +% support rotation. +% \begin{macrocode} +\newcommand{\rotdriver}[1]{% +% \end{macrocode} +% Put the argument into an uppercase string +% \begin{macrocode} + \bgroup\edef\next{\def\noexpand\tempa{#1}}% + \uppercase\expandafter{\next}% +% \end{macrocode} +% \begin{macro}{\ISOROTSTD} +% \begin{macro}{\DVIPS} +% \begin{macro}{\DVIPSONE} +% \begin{macro}{\DVITOPS} +% \begin{macro}{\PCTEXPS} +% \begin{macro}{\PUBPS} +% \begin{macro}{\TEXTURES} +% \begin{macro}{\DVIPDF} +% \begin{macro}{\DVIWINDO} +% \begin{macro}{\PCTEX32} +% These are the currently supported drivers that can cope with rotations. +% The code for the drivers has been taken from +% \file{drivers.dtx}\footnote{Version v3.0d, revised 1996/12/12.} by +% Sebastian Rahtz and David Carlisle. +% +% The |isorotstd| driver is included against the (improbable) time +% when there might be one `standard' driver, or at least all the +% |\special| code for rotations might be common. +% \begin{macrocode} + \def\ISOROTSTD{ISOROTSTD} + \def\DVIPS{DVIPS} + \def\DVIPSONE{DVIPSONE} + \def\DVITOPS{DVITOPS} + \def\PCTEXPS{PCTEXPS} + \def\PUBPS{PUBPS} + \def\TEXTURES{TEXTURES} + \def\DVIPDF{DVIPDF} + \def\DVIWINDO{DVIWINDO} + \def\PCTEXxxxii{PCTEX32} +% \end{macrocode} +% Later we will use a case statement for picking the proper code. Define +% a numeric code for each driver. +% \begin{macrocode} + \global\chardef\rot@driver=0 + \ifx\tempa\ISOROTSTD + \global\chardef\rot@driver=1\fi + \ifx\tempa\DVIPS + \global\chardef\rot@driver=2\fi + \ifx\tempa\DVIPSONE + \global\chardef\rot@driver=3\fi + \ifx\tempa\DVITOPS + \global\chardef\rot@driver=4\fi + \ifx\tempa\PCTEXPS + \global\chardef\rot@driver=5\fi + \ifx\tempa\PUBPS + \global\chardef\rot@driver=6\fi + \ifx\tempa\TEXTURES + \global\chardef\rot@driver=7\fi + \ifx\tempa\DVIPDF + \global\chardef\rot@driver=8\fi + \ifx\tempa\DVIWINDO + \global\chardef\rot@driver=9\fi + \ifx\tempa\PCTEXxxxii + \global\chardef\rot@driver=10\fi + \egroup +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% Now define the particulars for each driver. \\ +% {\bf Case 0:} We should not be here! +% \begin{macrocode} + \ifcase\rot@driver % case 0 + \message{WARNING *** unknown driver --- no rotation.} \listrotdrivers +% \end{macrocode} +% {\bf Case 1: ISOROTSTD} Not yet available. +% \begin{macrocode} + \or % case 1: ISOROTSTD + \message{WARNING *** isorotstd driver not available yet --- no rotation.} + \listrotdrivers +% \end{macrocode} +% {\bf Case 2: DVIPS} For Tom Rokicki's {\em dvips} driver. Has been tested +% with version 5.518 of July 1993. +% \begin{macrocode} + \or % case 2: DVIPS + \typeout{Rotdriver set to dvips.} \listrotdrivers + \def\Grot@start{% + \special{ps: gsave currentpoint + currentpoint translate \Grot@angle\space neg + rotate neg exch neg exch translate}} + \def\Grot@end{% + \special{ps: currentpoint grestore moveto}} +% \end{macrocode} +% {\bf Case 3: DVIPSONE} For Y\&Y's {\em dvipsone}. +% \begin{macrocode} + \or % case 3: DVIPSONE + \typeout{Rotdriver set to dvipsone.} \listrotdrivers + \def\Grot@start{% + \special{ps: gsave currentpoint + currentpoint translate \Grot@angle\space + rotate neg exch neg exch translate}} + \def\Grot@end{% + \special{ps: currentpoint grestore moveto}} +% \end{macrocode} +% {\bf Case 4: DVITOPS} For James Clark's {\em dvitops}. +% \begin{macrocode} + \or % case 4: DVITOPS + \typeout{Rotdriver set to dvitops.} \listrotdrivers + \def\Grot@start{% + \special{dvitops: origin + rot\the\@tempdima}% + \special{dvitops: begin rot\the\Dvitops@count}}% + \def\Grot@end{% + \special{dvitops: end}% + \special{dvitops: rotate rot\the\Dvips@count \space + \Grot@angle}% + \global\advance\Dvitops@count by\@ne} +% \end{macrocode} +% {\bf Case 5: PCTEXPS} For Personal TeX's PC PTI Laser/PS. Information +% supplied by Lance Carnes and Tao Wang |<pti@crl.com>|. +% \begin{macrocode} + \or % case 5: PCTEXPS + \typeout{Rotdriver set to pctexps.} \listrotdrivers + \def\Grot@start{% + \special{ps:: gsave currentpoint + currentpoint translate \Grot@angle\space + rotate neg exch neg exch translate}} + \def\Grot@end{% + \special{ps:: currentpoint grestore moveto}} +% \end{macrocode} +% {\bf Case 6: PUBPS} For Arbortext's {\em pubps}. +% (Interestingly, I (PRW) note +% that my original (circa 1991) code for this used |ps::| but the code +% has since been modified to |ps:|.) +% \begin{macrocode} + \or % case 6: PUBPS + \typeout{Rotdriver set to pubps.} \listrotdrivers + \def\Grot@start{% + \special{ps: gsave currentpoint + currentpoint translate \Grot@angle\space + rotate neg exch neg exch translate}} + \def\Grot@end{% + \special{ps: currentpoint grestore moveto}} +% \end{macrocode} +% {\bf Case 7: TEXTURES} For Blue Sky's {\em Textures}. This code is liable +% to change as there is ongoing work to produce a new version of Textures. +% \begin{macrocode} + \or % case 7: TEXTURES + \typeout{Rotdriver set to textures.} \listrotdrivers + \def\Grot@start{% + \special{postscript + 0 0 transform + grestore + matrix currentmatrix + 3 1 roll + itransform + dup 3 -1 roll + dup 4 1 roll exch + translate + \Grot@angle\space neg rotate + neg exch neg exch translate + gsave}} + \def\Grot@end{\special{postscript grestore setmatrix gsave}} +% \end{macrocode} +% {\bf Case 8: DVIPDF} For the {\em dvipdf} driver. +% \begin{macrocode} + \or % case 8: DVIPDF + \typeout{Rotdriver set to dvipdf.} \listofdrivers + \def\Grot@start{% + \special{pdf: /ROT \Grot@angle\space << }} + \def\Grot@end{\special{pdf: /ROT >> }} +% \end{macrocode} +% {\bf Case 9: DVIWINDO} For Y\&Y's {\em dviwindo} driver. +% \begin{macrocode} + \or % case 9: DVIWINDO (same as DVIPSONE) + \typeout{Rotdriver set to dviwindo.} \listofdrivers + \def\Grot@start{% + \special{ps: gsave currentpoint + currentpoint translate \Grot@angle\space + rotate neg exch neg exch translate}} + \def\Grot@end{% + \special{ps: currentpoint grestore moveto}} +% \end{macrocode} +% {\bf Case 10: PCTEX32} For Personal TeX's PC TeX for 32 bit Windows. +% (Code supplied by Tao Wang |<pti@crl.com>|). +% \begin{macrocode} + \or % case 10: PCTEX32 + \typeout{Rotdriver set to pctex32.} \listofdrivers + \def\Grot@start{% + \special{ps:: gsave currentpoint + currentpoint translate \Grot@angle\space neg + rotate neg exch neg exch translate}} + \def\Grot@end{\special{ps:: currentpoint grestore moveto}} +% \end{macrocode} +% +% {\bf Case unknown:} We should not have got here! +% \begin{macrocode} + \else + \message{WARNING *** unknown driver --- no rotation.} \listrotdrivers + \fi +} +% \end{macrocode} +% \end{macro} +% Set up a default driver (use DVIPS as it appears the most popular). +% \begin{macrocode} +\rotdriver{DVIPS} +% \end{macrocode} +% The default driver has been set to DVIPS for both \file{isorot} and +% \file{isorotne}. +% +% \begin{macrocode} +%</rotne> +% \end{macrocode} +% +% \subsection{Box rotation} +% +% The \file{isorotne} package needs some code that is part of the +% \file{graphics} package. +% +% The following code has been mainly taken from the graphics package +% \file{graphics.dtx}\footnote{Version v1.0d, last revised 1997/06/07.} +% by D.P. Carlisle and S.P.Q. Rahtz. +% +% +% The \file{isorotne} package requires some macros that are in the +% 2e kernel but not the 2.09 kernel. +% The following macros are defined in the 2e kernel but +% not in all v2.09 kernels. We need them. We use \verb|\def| instead +% of \verb|\newcommand| +% just in case a v2.09 document is processed in compatibility +% mode, but additionally check if 2e is being used. +% +% \begin{macrocode} +%<*rotne> +\ifx\usepackage\undefined +% \end{macrocode} +% +% \begin{macro}{\@plus} +% \begin{macro}{\@minus} +% Save some string space. +% \begin{macrocode} + \def\@plus{plus} + \def\@minus{minus} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\on@line} +% \begin{macrocode} + \ifnum\inputlineno=\m@ne + \let\on@line\empty + \else + \def\on@line{ on input line \the\inputlineno} + \fi +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\rem@pt} +% Utility macro to assist in removing the string `pt' from a dimension. +% It is complicated but appears to work. +% \begin{macrocode} + \begingroup + \catcode`P=12 + \catcode`T=12 + \lowercase{ + \def\x{\def\rem@pt##1.##2PT{##1\ifnum##2>\z@.##2\fi}}} + \expandafter\endgroup\x +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\strip@pt} +% Call this to strip `pt' from a dimension like |\strip@pt\dim|. +% \begin{macrocode} + \def\strip@pt{\expandafter\rem@pt\the} +% \end{macrocode} +% \end{macro} +% The end of \LaTeX 2e kernel macros. +% \begin{macrocode} +\fi +% \end{macrocode} +% +% \begin{macro}{\color@begingroup} +% \begin{macro}{\color@endgroup} +% \begin{macro}{\color@setgroup} +% \begin{macro}{\normalcolor} +% \begin{macro}{\color@hbox} +% \begin{macro}{\color@vbox} +% \begin{macro}{\color@endbox} +% These are normally no-ops (but are redefined by the \file{color} package). +% \begin{macrocode} +\let\color@begingroup\relax +\let\color@endgroup\relax +\let\color@setgroup\relax +\let\normalcolor\relax +\let\color@hbox\relax +\let\color@vbox\relax +\let\color@endbox\relax +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{environment}{lrbox} +% A new 2e environment form of |\sbox|. (This is why the color stuff is +% needed.) +% \begin{macrocode} +\def\lrbox#1{% + \edef\reserved@a{% + \endgroup + \setbox#1\hbox{% + \begingroup\aftergroup}% + \def\noexpand\@currenvir{\@currenvir}% + \def\noexpand\@currenvline{\on@line}}% + \reserved@a + \@endpefalse + \color@setgroup + \ignorespaces} +\def\endlrbox{\unskip\color@endgroup} +% \end{macrocode} +% \end{environment} +% +% We are now basically back to the \file{graphics} package code. +% +% Some registers are needed to store some sizes and angles. +% Local registers are re-used (see the Graphics package documentation). +% \begin{macro}{\Grot@height} +% \begin{macro}{\Grot@depth} +% \begin{macro}{\Grot@right} +% \begin{macro}{\Grot@left} +% Final rotated box dimensions. +% \changes{v2}{1997/12/02}{Graphics updated to version v1.0d} +% \begin{macrocode} +\let\Grot@height\@ovxx +\let\Grot@depth\@ovdy +\let\Grot@right\@ovdx +\let\Grot@left\@ovyy +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\Grot@h} +% \begin{macro}{\Grot@d} +% \begin{macro}{\Grot@r} +% \begin{macro}{\Grot@l} +% The original box dimensions. +% \begin{macrocode} +\let\Grot@h\@xdim +\let\Grot@d\@ydim +\let\Grot@r\@ovri +\let\Grot@l\@ovro +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \begin{macro}{\Grot@x} +% \begin{macro}{\Grot@y} +% Coordinates of the centre of rotation. +% \begin{macrocode} +\let\Grot@x\@linelen +\let\Grot@y\@dashdim +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\rotatebox} +% The rotation angle is specified by parameter |#1| and the box to be +% rotated by |#2|. In the standard interface the center of rotation +% is $(0,0)$. Finally |\Grot@box| is called to rotate the box. +% +% |\rotatebox{|\meta{degrees}|}{|\meta{text}|}| rotates \meta{text} +% by \meta{degrees} anticlockwise. The rotation is about the left hand +% end of the baseline of \meta{text}. +% \changes{v2}{1997/12/02}{Added call to \cs{leavevmode}} +% \begin{macrocode} +\def\rotatebox#1#2{% + \leavevmode + \Grot@setangle{#1}% + \setbox\z@\hbox{{#2}}% + \Grot@x\z@ + \Grot@y\z@ + \Grot@box} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Grot@setangle} +% \begin{macro}{\Grot@angle} +% These set the internal macro |\Grot@angle| used by |\Grot@box|. +% |\Grot@setangle| is the `standard' definition from the \file{graphics} +% package. +% \begin{macrocode} +\def\Grot@setangle#1{\edef\Grot@angle{#1}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% We need to know the size of the enclosing rectangle of a rotated box. +% Two macros are used for calculating coordinate positions. (See Graphics +% documentation for details.) +% +% \begin{macro}{\Grot@Px} +% Calculate the x coordinate of a point after rotation. The new x +% coordinate is parameter |#1| and the original point coordinates +% are parameters |#2| and |#3|. +% \begin{macrocode} +\def\Grot@Px#1#2#3{% + #1\Grot@cos#2% + \advance#1-\Grot@sin#3} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Grot@Py} +% Similarly for the y coordinate. +% \begin{macrocode} +\def\Grot@Py#1#2#3{% + #1\Grot@sin#2% + \advance#1\Grot@cos#3} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Grot@box} +% Rotates |\box0| through |\Grot@angle| degrees anticlockwise. +% +% For details, consult the Graphics documentation. +% +% \begin{macrocode} +\def\Grot@box{% + \begingroup + \CalculateSin\Grot@angle + \CalculateCos\Grot@angle + \edef\Grot@sin{\UseSin\Grot@angle}% + \edef\Grot@cos{\UseCos\Grot@angle}% + \Grot@r\wd\z@ \advance\Grot@r-\Grot@x + \Grot@l\z@ \advance\Grot@l-\Grot@x + \Grot@h\ht\z@ \advance\Grot@h-\Grot@y + \Grot@d-\dp\z@ \advance\Grot@d-\Grot@y + \ifdim\Grot@sin\p@>\z@ + \ifdim\Grot@cos\p@>\z@ + \Grot@Py\Grot@height \Grot@r\Grot@h + \Grot@Px\Grot@right \Grot@r\Grot@d + \Grot@Px\Grot@left \Grot@l\Grot@h + \Grot@Py\Grot@depth \Grot@l\Grot@d + \else + \Grot@Py\Grot@height \Grot@r\Grot@d + \Grot@Px\Grot@right \Grot@l\Grot@d + \Grot@Px\Grot@left \Grot@r\Grot@h + \Grot@Py\Grot@depth \Grot@l\Grot@h + \fi + \else + \ifdim\Grot@cos\p@<\z@ + \Grot@Py\Grot@height \Grot@l\Grot@d + \Grot@Px\Grot@right \Grot@l\Grot@h + \Grot@Px\Grot@left \Grot@r\Grot@d + \Grot@Py\Grot@depth \Grot@r\Grot@h + \else + \Grot@Py\Grot@height \Grot@l\Grot@h + \Grot@Px\Grot@right \Grot@r\Grot@h + \Grot@Px\Grot@left \Grot@l\Grot@d + \Grot@Py\Grot@depth \Grot@r\Grot@d + \fi + \fi + \advance\Grot@height\Grot@y + \advance\Grot@depth\Grot@y + \Grot@Px\dimen@ \Grot@x\Grot@y + \Grot@Py\dimen@ii \Grot@x\Grot@y + \dimen@-\dimen@ \advance\dimen@-\Grot@left + \dimen@ii-\dimen@ii \advance\dimen@ii\Grot@y + \setbox\z@\hbox{% + \kern\dimen@ + \raise\dimen@ii\hbox{\Grot@start\box\z@\Grot@end}}% + \ht\z@\Grot@height + \dp\z@-\Grot@depth + \advance\Grot@right-\Grot@left\wd\z@\Grot@right + \leavevmode\box\z@ + \endgroup} +% \end{macrocode} +% \end{macro} +% +% \begin{macrocode} +%</rotne> +% \end{macrocode} +% +% \subsection{The rotating code} +% +% Much of the code from here on is taken from the +% \file{rotating.dtx}\footnote{Version v2.9, last revised 1995/04/07.} +% package file by Leonor Barroca, but some is hacked for 2.09 users. +% Extensions are made to accomodate the special requirements for ISO +% typesetting. +% +% \subsubsection{Initial macros} +% +% Define some general helper macros. +% +% \begin{macro}{\if@rot@twoside} +% A flag for one or two sided. +% \begin{macrocode} +\newif\if@rot@twoside +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\Grot@setnegangle} +% \emph{Extension:} |\Grot@setnegangle| sets |\Grot@angle| to be the +% negative of its input +% parameter. We use this for changing rotation direction. +% \begin{macrocode} +\def\Grot@setnegangle#1{% + \dimen@#1\p@ + \dimen@-\dimen@ + \edef\Grot@angle{\strip@pt\dimen@}} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\ifcl@ckwise} +% \begin{macro}{\figuresleft} +% \begin{macro}{\figuresright} +% \begin{macro}{\clockwise} +% \begin{macro}{\counterclockwise} +% \emph{Extension:} The \file{rotating} package has some options. +% Our packages instead define some additional +% macros to enable these to be expressed as commands. +% +% A flag for the desired rotational direction. +% \begin{macrocode} +\newif\ifcl@ckwise +% \end{macrocode} +% The extension commands: +% \begin{macrocode} +\newcommand{\figuresleft}{% + \@rot@twosidefalse + \def\rot@LR{0}% +} +\newcommand{\figuresright}{% + \@rot@twosidefalse + \def\rot@LR{-1}% +} +\newcommand{\clockwise}{% + \cl@ckwisetrue +} +\newcommand{\counterclockwise}{% + \cl@ckwisefalse +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\r@protected@write} +% \begin{macro}{\therpage} +% \begin{macro}{\rot@label} +% +% The \file{rotating} package used to use the |\label| command. It now +% uses a special |\rot@label| version. This variant writes the \emph{true} +% page number, not the value of |\thepage|. It also involves a variant +% |\protected@write|\footnote{The original author states `\ldots for reasons +% which I do not fully understand.'}. +% +% \changes{v2}{1997/12/03}{Added \cs{r@protected@write}, \cs{therpage} and \cs{rot@label}} +% \begin{macrocode} +\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} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\r@tfl@t} +% A counter for use later in matching rotations to page numbers. +% \changes{v2}{1997/12/02}{Changed \cs{r@tfl@t} to a \cs{newcounter}} +% \begin{macrocode} +\newcounter{r@tfl@t} +\setcounter{r@tfl@t}{0} +% \end{macrocode} +% \end{macro} +% +% Sideways floats take up the whole page. They can be rotated so that +% the bottom of the float is on the left or the right; the default +% is to always turn to the right. If the main document uses the +% \Lopt{twoside} option then the floats are rotated according to the +% page number (requiring at least two passes through \LaTeX). The +% \Lopt{figuresleft} and \Lopt{figuresright} `options' will ensure +% a constant rotation direction when \Lopt{twoside} is in effect. +% +% \begin{macrocode} +\if@twoside + \@rot@twosidetrue +\else + \@rot@twosidefalse +\fi +% \end{macrocode} +% +% \begin{macro}{\rotatedirection} +% For setting rotation direction for positive angle. The |\rotatedirection| +% command is provided for backwards compatibility. +% \begin{macrocode} +\newcommand{\rotatedirection}[1]{% + \def\@tempa{#1}\def\@tempb{clockwise}% + \ifx\@temp\@tempb + \cl@ckwisetrue + \else + \cl@ckwisefalse + \fi} +% \end{macrocode} +% \end{macro} +% +% Set default to be \Lopt{clockwise} rotation for positive angles, +% and \Lopt{figuresright} to make all bottoms of sideways floats +% to be at the righthand edge of the paper. +% \begin{macrocode} +\clockwise +\figuresright +% \end{macrocode} +% +% \subsubsection{Turn and rotation environments} +% +% These are general rotational environments. +% +% \begin{environment}{sideways} +% The \Lenv{sideways} environment rotates its contents through the fixed +% angle of 90 degrees counterclockwise. +% \begin{macrocode} +\def\sideways{% + \Grot@setangle{90}% + \setbox\z@\hbox\bgroup\ignorespaces} +\def\endsideways{% + \unskip\egroup + \Grot@x\z@ + \Grot@y\z@ + \Grot@box +} +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{turn} +% The \Lenv{turn} environment rotates its contents through the given +% angle, leaving the appropriate space. +% +% \emph{Extension:} We take account of the specified rotational direction. +% \begin{macrocode} +\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 +} +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{rotate} +% The \Lenv{rotate} environment rotates its contents through the given +% angle, leaving no space. +% +% \emph{Extension:} We take account of the specified rotational direction. +% \begin{macrocode} +\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 +} +% \end{macrocode} +% \end{environment} +% +% \begin{macro}{\turnbox} +% A macro version of the \Lenv{rotate} environment. +% +% |\turnbox{|\meta{degrees}|}{|\meta{text}|}| +% \begin{macrocode} +\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 +} +% \end{macrocode} +% \end{macro} +% +% \subsubsection{Sideways figures and tables} +% +% Rotation of floats through a fixed angle of 90 degrees. +% +% First, a generalized |rotfloat| environment. +% \begin{macro}{\rot@float@box} +% \begin{macro}{\@rotfloat} +% \begin{macro}{\@xrotfloat} +% \begin{macrocode} +\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]% +% \end{macrocode} +% Set the float contents in a box of |\textheight| instead of +% |\columnwidth|. +% \begin{macrocode} + \begin{lrbox}\rot@float@box + \begin{minipage}\textheight +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\end@rotfloat} +% +% We call |\end@float| having previously rotated the box |\@currbox|. +% The rotation is either clockwise or counterclockwise, depending on +% whether the page is odd or even. In |oneside| mode it is always odd. +% See the \file{rotating} package documentation for further details. +% +% \emph{Extension:} Generalised the output messages. +% \changes{v2}{1997/12/02}{Using \cs{rot@label} instead of \cs{label}} +% \begin{macrocode} +\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 +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@rotdblfloat} +% \begin{macro}{\@rotdblflt} +% \begin{macro}{\@rotxdblfloat} +% General macros for double column floats. +% \changes{v2}{1997/12/03}{Added code for double column floats} +% \begin{macrocode} +\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 +} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% +% \begin{macro}{\@initisofig} +% \begin{macro}{\@initisotab} +% \begin{macro}{\rotcapfont} +% \emph{Extension:} The following definitions implement some of +% the ISO-specific stuff. They basically provide for the setting up of +% the \file{lof} and \file{lot} files. |\rotcapfont| is the font for +% typesetting any captions. For ISO it is bold and may be larger than normal. +% +% \changes{v2}{1997/12/03}{Added \cs{PWRF@initfig} and \cs{PWRF@inittab}} +% \changes{v2.1}{2000/02/15}{Added check for iso class} +% \changes{v2.1}{2000/02/15}{Used \cs{@initisofig} instead of +% \cs{PWRF@initfig} and same for tables} +% \begin{macrocode} +\@ifundefined{@initisofig}{% + \newcommand{\@initisofig}{} + \newcommand{\@initisotab}{} + \newif\ifinfloat + \newcommand{\rotcapfont}{}}{\newcommand{\rotcapfont}{\captionsize\bf}} +% \end{macrocode} +% \end{macro} +% \end{macro} +% \end{macro} +% +% \begin{environment}{sidewaysfigure} +% Use |\def| instead of |\...environment| in order to be OK for both +% redefining the \file{rotating} environment and creating a new 2.09 +% environment. +% \begin{macrocode} +\def\sidewaysfigure{% + \@initisofig + \@rotfloat{figure}} +\def\endsidewaysfigure{\end@rotfloat\infloatfalse} +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{sidewaystable} +% The \Lenv{sidewaystable} environment is similar. +% It also requires redefinition to take account of the ISO peculiarities. +% \begin{macrocode} +\def\sidewaystable{% + \@initisotab + \@rotfloat{table}} +\def\endsidewaystable{\end@rotfloat\infloatfalse} +% \end{macrocode} +% \end{environment} +% +% \begin{environment}{sidewaysfigure*} +% \begin{environment}{sidewaystable*} +% These are for rotations in a two column setting. The definitions +% are similar to the previous ones for single column. +% \changes{v2}{1997/12/03}{Added sidewaysfigure and sidewaystable for double columns} +% \begin{macrocode} +\newenvironment{sidewaysfigure*}{% + \@initisofig + \@rotdblfloat{figure}}{% + \end@rotdblfloat\infloatfalse} +\newenvironment{sidewaystable*}{% + \@initisotab + \@rotdblfloat{table}}{% + \end@rotdblfloat\infloatfalse} +% \end{macrocode} +% \end{environment} +% \end{environment} +% +% \subsubsection{Rotated captions} +% +% \begin{macro}{\rotcaption} +% \begin{macro}{\@rotcaption} +% This inserts a caption rotated through 90 degrees. The code, which is +% essentially a copy of the normal |\caption| code, is defined +% in the \file{rotation} package. +% \begin{macrocode} +\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} +% \end{macrocode} +% \end{macro} +% \end{macro} +% +% \begin{macro}{\@makerotcaption} +% The workhorse for rotated captions. +% \begin{macrocode} +\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} +} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\controtcaption} +% A rotated continuation caption. +% \begin{macrocode} +\newcommand{\controtcaption}{\@controtcaption\@captype} +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\@controtcaption} +% The worker for a rotated continuation caption. +% \begin{macrocode} +\long\def\@controtcaption#1#2{% + \begingroup + \@parboxrestore + \normalsize + \@makerotcaption{\csname fnum@#1\endcsname}{\ignorespaces #2}\par + \endgroup} +% \end{macrocode} +% \end{macro} +% +% The end of the package code. +% \begin{macrocode} +%</rot|rotne> +% \end{macrocode} +% +% +% +% \bibliographystyle{alpha} +% +% \begin{thebibliography}{GMS94} +% +% \bibitem[GMS94]{GOOSSENS94} +% Michel Goossens, Frank Mittelbach, and Alexander Samarin. +% \newblock {\em The LaTeX Companion}. +% \newblock Addison-Wesley Publishing Company, 1994. +% +% \bibitem[ISO97]{ISOD397} +% {\em {ISO/IEC Directives Part 3 --- Drafting and presentation of International +% Standards}}, third edition, 1997. +% +% \bibitem[Wil96]{PRW96i} +% Peter~R. Wilson. +% \newblock {\em {LaTeX for standards: The LaTeX package files user manual}}. +% \newblock NIST Report NISTIR, June 1996. +% +% \end{thebibliography} +% +% +% \Finale +% \PrintIndex +% +\endinput + +%% \CharacterTable +%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z +%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z +%% Digits \0\1\2\3\4\5\6\7\8\9 +%% Exclamation \! Double quote \" Hash (number) \# +%% Dollar \$ Percent \% Ampersand \& +%% Acute accent \' Left paren \( Right paren \) +%% Asterisk \* Plus \+ Comma \, +%% Minus \- Point \. Solidus \/ +%% Colon \: Semicolon \; Less than \< +%% Equals \= Greater than \> Question mark \? +%% Commercial at \@ Left bracket \[ Backslash \\ +%% Right bracket \] Circumflex \^ Underscore \_ +%% Grave accent \` Left brace \{ Vertical bar \| +%% Right brace \} Tilde \~} + + diff --git a/macros/latex/contrib/isorot/isorot.ins b/macros/latex/contrib/isorot/isorot.ins new file mode 100644 index 0000000000..6dcd705947 --- /dev/null +++ b/macros/latex/contrib/isorot/isorot.ins @@ -0,0 +1,65 @@ +%% +%% isorot.ins +%% +%% 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 and NIST) +%% now at: peter.r.wilson@boeing.com +%% +%% This file will generate fast loadable files and documentation +%% driver files from the doc files in this package when run through +%% LaTeX or TeX. +%% +%% --------------- start of docstrip commands ------------------ +%% +\def\batchfile{isorot.ins} +\input docstrip.tex +\preamble + + 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 + +\endpreamble + +\keepsilent + +%%\Msg{*** Generating the driver file ***} + +%%\generateFile{isorot.drv}{t}{\from{isorot.dtx}{driver}} + +\Msg{*** Generating the LaTeX2e package files ***} + +\generateFile{isorot.sty}{t}{\from{isorot.dtx}{rot}} +%% \generateFile{isorotne.sty}{t}{\from{isorot.dtx}{rotne}} + +\Msg{***********************************************************} +\Msg{*} +\Msg{* To finish the installation you have to move the following} +\Msg{* files into a directory searched by TeX:} +\Msg{*} +\Msg{* \space\space isorot.sty} +\Msg{*} +\Msg{*} +\Msg{* To produce the documentation run the files ending with} +\Msg{* `.dtx' through LaTeX.} +\Msg{* Process any name.idx file by:} +\Msg{* \space\space\space\space makeindex -s gind.ist name} +\Msg{* Process any name.glo file by:} +\Msg{* \space\space\space\space makeindex -s gglo.ist -o name.gls name.glo} +\Msg{*} +\Msg{* Happy TeXing} +\Msg{***********************************************************} + +\endinput diff --git a/macros/latex/contrib/isorot/rotman.pdf b/macros/latex/contrib/isorot/rotman.pdf Binary files differnew file mode 100644 index 0000000000..03ba028719 --- /dev/null +++ b/macros/latex/contrib/isorot/rotman.pdf diff --git a/macros/latex/contrib/isorot/rotman.tex b/macros/latex/contrib/isorot/rotman.tex new file mode 100644 index 0000000000..6d2fe22d1a --- /dev/null +++ b/macros/latex/contrib/isorot/rotman.tex @@ -0,0 +1,897 @@ +% rotman.tex User Manual for isorot package +\documentclass[11pt]{article} +\usepackage{isorot} + +%\makeatletter +\ifx\pdfoutput\undefined\else + \pdfoutput=1 +\fi +%\makeatother + +\setlength{\textheight}{8.0in} +\setlength{\textwidth}{6.0in} +\setlength{\oddsidemargin}{0.25in} +\setlength{\evensidemargin}{0.25in} +\setlength{\marginparwidth}{0.6in} +\setcounter{secnumdepth}{4} +\setcounter{tocdepth}{4} + +% +% remainder of preamble is some special macro definitions +\makeatletter +% the \meta{} command +% +\begingroup +\obeyspaces% +\catcode`\^^M\active% +\gdef\meta{\begingroup\obeyspaces\catcode`\^^M\active% +\let^^M\do@space\let \do@space% +\def\-{\egroup\discretionary{-}{}{}\hbox\bgroup\it}% +\m@ta}% +\endgroup +\def\m@ta#1{\leavevmode\hbox\bgroup\texttt{<}\textit{#1}\/\texttt{>}\egroup + \endgroup} +\def\do@space{\egroup\space + \hbox\bgroup\it\futurelet\next\sp@ce} +\def\sp@ce{\ifx\next\do@space\expandafter\sp@@ce\fi} +\def\sp@@ce#1{\futurelet\next\sp@ce} +% +\makeatother + +% +\makeatletter +% +% the \latex command +\newcommand{\latex}{\LaTeX} +\newcommand{\tex}{\TeX} +% +% the \file{} command +% +\newcommand{\file}[1]{\textsf{#1}} +% +% example and note environments +\newenvironment{example}{\begin{quotation}\small\textbf{Example: }}{\par\end{quotation}} +\newenvironment{note}{\begin{quotation}\small\textbf{Note: }}{\par\end{quotation}} + +% internal refs +\newcommand{\tref}[1]{Table~\ref{#1}} +\newcommand{\fref}[1]{Figure~\ref{#1}} + +% index a command +\newcommand{\bs}{\symbol{'134}} +\newcommand{\ixcom}[1]{\index{#1/ @{\tt \protect\bs #1}}} +% index an environment +\newcommand{\ixenv}[1]{\index{#1 @{\tt #1} (environment)}} +% index a starred environment +\newcommand{\ixenvs}[1]{\index{#1s @{\tt #1*} (environment)}} +% index an option +\newcommand{\ixopt}[1]{\index{#1 @{\tt #1} (option)}} +% index a package +\newcommand{\ixpack}[1]{\index{#1 @\file{#1} (package)}} +% index a class +\newcommand{\ixclass}[1]{\index{#1 @\file{#1} (class)}} +% index in typewriter font +\newcommand{\ixtt}[1]{\index{#1@{\tt #1}}} +% index LaTeX +\newcommand{\ixltx}{\index{latex@\latex}} +% index LaTeX 2e +\newcommand{\ixltxe}{\index{latex2e@\latex 2e}} +% index LaTeX v2.09 +\newcommand{\ixltxv}{\index{latex209@\latex{} v2.09}} +\makeatother +% +% end of preamble +% + +\title{The \file{isorot} Package User Manual} +\author{Peter Wilson\\ \texttt{peter.r.wilson@boeing.com}} +\date{15 February 2000} + +\begin{document} +\pagenumbering{roman} +\maketitle + +\begin{abstract} +The facilities in the \file{isorot} package are described. The package +was initially designed for use with the \file{iso} class but can be used +with the `normal' classes as well. The package enables the rotation of +document elements, like text or tables of figures. +\end{abstract} +\tableofcontents +\listoffigures +\listoftables +\clearpage +\pagestyle{headings} +\pagenumbering{arabic} + + +\section{Introduction} + + The \file{isorot} package enables the rotation of document elements on +a page. It uses the \latex{} \verb|\special| command to perform its +effects, and thus can only be used +with a limited number of \TeX{} to print routes. The facilities +available are summarized in \tref{tab4}. + + \file{isorot} is a modification of the \file{rotation.sty} file +created by Rahtz and Barroca~\cite{rahtz}. Further examples of the usage +of their style are given in Goosens \emph{et al}~\cite{goosens}. The +package also uses David Carlisle's \file{graphicx} and \file{lscape} +packages. + +\begin{note}Several examples of the effects of the commands described herein +are shown. In many cases the results are not pretty. This should act as +a warning that using rotational elements requires more care than +most other document elements.\end{note} %end note + +\begin{sidewaystable} +\ixcom{rotdriver} \ixcom{clockwise} \ixcom{counterclockwise} +\ixcom{figuresright} \ixcom{figuresleft} \ixcom{rotcaption} +\ixcom{controtcaption} +\ixenv{sideways} \ixenv{turn} \ixenv{rotate} \ixenv{sidewaystable} +\ixenv{sidewaysfigure} \ixenv{landscape} +\centering +\caption{The rotation facilities} \label{tab4} +\begin{tabular}{|l|l|} \hline +\textbf{Facility} & \textbf{Effect} \\ \hline +\multicolumn{2}{|c|}{\textbf{Commands}} \\ \hline +\verb|\rotdriver{<driver>}| & +declare the name of the dvi to Postscript translator (default {\tt dvips}) \\ +\verb|\clockwise| & +sets rotation direction clockwise for positive angles (the default) \\ +\verb|\counterclockwise| & +sets rotation direction counterclockwise for positive angles \\ +\verb|\figuresright| & +sets rotation direction for sideways floats counterclockwise (the default) \\ +\verb|\figuresleft| & +sets rotation direction for sideways floats clockwise \\ +\verb|\rotcaption| & +like the \verb|caption| command, but rotates the caption through 90 degrees \\ +\verb|\controtcaption| & +like the \verb|contcaption| command, but rotates the caption through 90 degrees \\ \hline +\multicolumn{2}{|c|}{\textbf{Environments}} \\ \hline +\verb|sideways| & +rotates the contents through 90 degrees counterclockwise \\ +\verb|turn| & +rotates the contents through the given angle \\ +\verb|rotate| & +rotates the contents through the given angle, but no space allowed for the result\\ +\verb|sidewaystable| & +like the \verb|table| environment, but rotated 90 degrees \\ +\verb|sidewaystable*| & +twocolumn version of \verb|sidewaystable| \\ +\verb|sidewaysfigure| & +like the \verb|figure| environment, but rotated 90 degrees \\ +\verb|sidewaysfigure*| & +twocolumn version of \verb|sidewaysfigure| \\ +\verb|landscape| & +prints all enclosed pages in landscape mode \\ \hline +\end{tabular} +\end{sidewaystable} + +\section{Options} + + The \file{isorot} facility has one option, +namely \verb|debugshow|\ixopt{debugshow}. Calling this option produces +messages on the screen and in the \file{log} file regarding the actions +being taken. + +\begin{note} This option is principally of interest to the maintainer +of the facility. \end{note} + + The font used for the captions of rotated figures or tables is controlled +by the \verb|rotcapfont| command. Under normal circumstances this is a null +command but when used with the \file{iso} class it is defined as: \\ +\verb|\newcommand{\rotcapfont}{\captionsisize\bf}| \\ + where \verb|\captionsize| is defined in the class. You can renew +\verb|\rotcapfont| to change the caption font to your liking. + +\section{DVI drivers} + + The \file{isorot} facility supports only a limited number of +dvi to postscript translators. The default translator is \emph{dvips}. + The following command must be put in +the preamble of the document if \emph{dvips} is not being used: +\verb|\rotdriver{<drivername>}|,\ixcom{rotdriver} where +\verb|<drivername>| is one of the following:\footnote{I have been able to +try the {\tt dvips} driver +but not the others. If anyone has experience with the other drivers, or has +extended the range of drivers, I would like to be given the results.} %end footnote + +\begin{enumerate} +\item \verb|dvipdf| for the \emph{dvipdf} + translator;\ixtt{dvipdf} +\item \verb|dvips| for Tom Rockicki's \emph{dvips} + translator;\ixtt{dvips} +\item \verb|dvipsone| for Y\&Y's \emph{dvipsone} + translator;\ixtt{dvipsone} +\item \verb|dvitops| for James Clark's \emph{dvitops} + translator;\ixtt{dvitops} +\item \verb|dviwindo| for Y\&Y's \emph{dviwindo} + translator;\ixtt{dviwindo} +\item \verb|pctex32| for Personal TeX's PC TeX for 32 bit Windows + (\emph{pctex32}) + translator;\ixtt{pctex32} +\item \verb|pctexps| for Personal TeX's PC PTI Laser/PS (\emph{pctexps}) + translator;\ixtt{pctexps} +\item \verb|pubps| for the Arbortext's \emph{pubps} + translator.\ixtt{pubps} +\item \verb|textures| for Blue Sky's \emph{Textures} + translator;\ixtt{textures} + +\end{enumerate} + + The \file{isorot} package can also be used in documents processed +by pdfLaTeX. + +\section{Rotational directions} + + \file{isorot} enables the textual and other elements of a document +to be rotated from their normal horizontal layout. In some cases elements +can be rotated through arbitrary angles, whereas in others only 90 degree +rotation is possible. + + By default, a rotation through a positive number of +degrees corresponds to a clockwise rotation. The command +\verb|\counterclockwise|\ixcom{counterclockwise} +sets the following rotations to be counterclockwise for positive angles. +The command \verb|\clockwise|\ixcom{clockwise} +sets the following rotations to be clockwise for positive angles. +These commands can be used to toggle the rotational behavior. + + + Rotated floating environments are normally rotated so that they are +printed with a counterclockwise rotation (i.e. the original bottom of the float +is placed at the right hand side of the paper), +which is what is normally required. +This behavior can be altered by the command +\verb|\figuresleft|,\ixcom{figuresleft} +which will give the reverse effect. The command +\verb|\figuresright|\ixcom{figuresright} +will set the behavior to the default. +These commands can be used to toggle the rotational behavior of +floats. + + +\section{Rotation of text} + + The \verb|sideways|\ixenv{sideways} +environment rotates the contents of the environment +by 90 degrees counterclockwise, and leaves space for the result. + + The \verb|\begin{turn}{|\meta{angle}\verb|}|\ixenv{turn} +environment rotates the contents by the given number +of degrees in the direction specified by the most recent of the +\verb|\clockwise|\ixcom{clockwise} or +\verb|\counterclockwise|\ixcom{counterclockwise} +commands, leaving space for the result. + + The \verb|\begin{rotate}{|\meta{angle}\verb|}|\ixenv{rotate} +environment rotates the contents by the given number +of degrees in the direction specified by the most recent of the +\verb|\clockwise|\ixcom{clockwise} or +\verb|\counterclockwise|\ixcom{counterclockwise} +commands, but no arrangements are made for leaving space for the result. + + +\begin{example}Some simple rotations: \label{ex:1} + +This code +\begin{verbatim} +Default rotation direction: \\ +A +\begin{sideways}% +B C +\end{sideways} +D E F G H I J K L M +\begin{turn}{-90}% +Minus 90 turn +\end{turn} +N O P +\begin{rotate}{90}% +Plus 90 rotate +\end{rotate} +Q \\ +and continue on with another line after rotations. +\end{verbatim} +produces the following (note how space is allowed for the \verb|turn|ed +text, whereas the \verb|rotate|d text runs into the text below). + +Default rotation direction: \\ +A +\begin{sideways}% +B C +\end{sideways} +D E F G H I J K L M +\begin{turn}{-90}% +Minus 90 turn +\end{turn} +N O P +\begin{rotate}{90}% +Plus 90 rotate +\end{rotate} +Q \\ +and continue on with another line after rotations. +\end{example} % end example +\begin{example}This example shows the effect of using the +\verb|\counterclockwise|\ixcom{counterclockwise} +command. + +This code +\begin{verbatim} +Flip rotation direction: \\ +\counterclockwise +A +\begin{sideways}% +B C +\end{sideways} +D E F G H I J K L M +\begin{turn}{-90}% +Minus 90 turn +\end{turn} +N O P +\begin{rotate}{90}% +Plus 90 rotate +\end{rotate} +Q \\ +Set rotation direction back to default value. +\clockwise +\end{verbatim} + +produces the following, which should be compared with example~\ref{ex:1}. + +Flip rotation direction: \\ +\counterclockwise +A +\begin{sideways}% +B C +\end{sideways} +D E F G H I J K L M +\begin{turn}{-90}% +Minus 90 turn +\end{turn} +N O P +\begin{rotate}{90}% +Plus 90 rotate +\end{rotate} +Q \\ +Set rotation direction back to default value. +\clockwise +\end{example} % end example + + + Although the examples so far have only shown the rotation of text, boxes +can also be rotated. + +\begin{example}Rotating a box. + +This code +\begin{verbatim} +\newsavebox{\foo} +\newlength{\fool} +\settowidth{\fool}{Hurrah for ISO.} +\savebox{\foo}{\parbox{\fool}{Hurrah for ISO. Hurrah for ISO. + Hurrah for ISO. Hurrah for ISO.}} +Start +\usebox{\foo} +\& +\begin{turn}{-45}\usebox{\foo}\end{turn} +\& +\begin{turn}{45}\usebox{\foo}\end{turn} +End +\end{verbatim} +produces: + +\newsavebox{\foo} +\newlength{\fool} +\settowidth{\fool}{Hurrah for ISO.} +\savebox{\foo}{\parbox{\fool}{Hurrah for ISO. Hurrah for ISO. + Hurrah for ISO. Hurrah for ISO.}} +Start +\usebox{\foo} +\& +\begin{turn}{-45}\usebox{\foo}\end{turn} +\& +\begin{turn}{45}\usebox{\foo}\end{turn} +End + +\end{example} %end example + + Elements can be rotated through arbitrary angles, and also rotated +elements can be nested inside other rotated elements. + + +\begin{example}Repeated rotation: + + The following example code shows that text can be rotated through any angle. +The result is shown in \fref{fig:wheel}. +\begin{verbatim} +\newcount\prwc +\newsavebox{\prwtext} +\newdimen\prwspace +\def\wheel#1#2{% + \savebox{\prwtext}{#1\begin{sideways}#2\end{sideways}}% + \prwspace\wd\prwtext% + \advance\prwspace by 1cm% + \centerline{% + \rule{0pt}{\prwspace}% + \rule[-\prwspace]{0pt}{\prwspace}% + \prwc=-180\loop\ifnum\prwc<180 + \rlap{\begin{rotate}{\the\prwc}% + \rule{1cm}{0pt}\usebox{\prwtext}\end{rotate}}% + \advance\prwc by 20\repeat}} +\begin{figure} +\wheel{Express yourself ---}{Hooray for STEP!} +\caption{Example rotation through multiple angles} +\label{fig:wheel} +\end{figure} +\end{verbatim} + +\newcount\prwc +\newsavebox{\prwtext} +\newdimen\prwspace +\def\wheel#1#2{% + \savebox{\prwtext}{#1\begin{sideways}#2\end{sideways}}% + \prwspace\wd\prwtext% + \advance\prwspace by 1cm% + \centerline{% + \rule{0pt}{\prwspace}% + \rule[-\prwspace]{0pt}{\prwspace}% + \prwc=-180\loop\ifnum\prwc<180 + \rlap{\begin{rotate}{\the\prwc}% + \rule{1cm}{0pt}\usebox{\prwtext}\end{rotate}}% + \advance\prwc by 20\repeat}} +\begin{figure} +\vspace*{1cm} +\wheel{Express yourself ---}{Hooray for STEP!} +\vspace*{1cm} +\caption{Example rotation through multiple angles} +\label{fig:wheel} +\end{figure} +\end{example} %end example + + Later in the manual, Figures~\ref{fig:angles1} and~\ref{fig:angles2} +also show rotations through a +range of angles, both positive and negative. + +\begin{example}Nested rotations. \label{ex:sidetabular} + +This code +\begin{verbatim} + Here is some text before a \verb|sideways| environment. +And some more, and more and more garble gobble cluck +click clack clock cluck and so on and on and on. +\begin{center} +\begin{sideways} +\rule{1in}{0pt} +\begin{tabular}{|lr|} +\begin{rotate}{-45}\emph{Word}\end{rotate} & \begin{rotate}{-90}% +Occurrences\end{rotate} +\\ +\hline +hello & 33 \\ +goodbye & 34 \\ +\hline +\end{tabular} +\end{sideways} +\end{center} + Here is some text after a \verb|sideways| environment. + And some more, and more and more garble gobble cluck +click clack clock cluck and so on and on and on. +\end{verbatim} +produces: + + Here is some text before a \verb|sideways| environment. +And some more, and more and more garble gobble cluck +click clack clock cluck and so on and on and on. +\begin{center} +\begin{sideways} +%\rule{1in}{0pt} +\begin{tabular}{|lr|} +\begin{rotate}{-45}\emph{Word}\end{rotate} & \begin{rotate}{-90}% +Occurrences\end{rotate} \\ \hline +hello & 33 \\ +goodbye & 34 \\ \hline +\end{tabular} +\end{sideways} +\end{center} + Here is some text after a \verb|sideways| environment. + And some more, and more and more garble gobble cluck +click clack clock cluck and so on and on and on. +\end{example} %end example + + + +\section{Rotations of tables and figures} + + The previous examples have demonstrated the rotation of textual elements. +For instance, the last one showed that tabular material can be rotated using +the \verb|sideways|\ixenv{sideways} +environment. (Actually, any of the previously +mentioned environments could have been used instead.) +Two further environments are provided which rotate a \latex{} float through +90 degrees. These are: +\begin{itemize} +\item \verb|sidewaystable|\ixenv{sidewaystable}, which + corresponds to the standard \latex{} \verb|table|\ixenv{table} + environment; and +\item \verb|sidewaysfigure|\ixenv{sidewaysfigure}, which + corresponds to the standard \latex{} \verb|figure|\ixenv{figure} + environment. +\end{itemize} +There are also starred versions of these, namely +\verb|sidewaystable*|\ixenvs{sidewaystable} and +\verb|sidewaysfigure*|\ixenvs{sidewaysfigure}, for use in twocolumn mode. +However, the correspondence with the standard environments is not strictly +complete as a sideways float is alway placed on a page by itself. + + The direction of rotation may be controlled by the +\verb|\figuresright|\ixcom{figuresright} and +\verb|\figuresleft|\ixcom{figuresleft} commands. + +\begin{example}Table~\ref{tab4} was produced by the code below: \label{ex:4} + +\begin{verbatim} +\begin{sidewaystable} +\centering +\caption{The rotation facilities} \label{tab4} +\begin{tabular}{|l|l|} \hline +\textbf{Facility} & \textbf{Effect} \\ \hline +\multicolumn{2}{|c|}{\textbf{Commands}} \\ \hline +\verb|\rotdriver{<driver>}| & +declare the name of the dvi to Postscript translator (default {\tt dvips}) \\ +...... +\verb|sidewaysfigure| & +like the \verb|figure| environment, but rotated 90 degrees \\ \hline +\end{tabular} +\end{sidewaystable} +\end{verbatim} +\end{example} % end example + + + +\section{Rotation of float captions and bodies} + + Sometimes it may be useful to rotate a caption independently of the +rotation of a figure or table. The command +\verb|\rotcaption|\ixcom{rotcaption} is analogous +to the normal \verb|\caption|\ixcom{caption} command, +and inserts the caption rotated +by 90~degrees. There is also the companion command +\verb|\controtcaption|\ixcom{controtcaption}, analagous to the +\verb|\contcaption|\ixcom{contcaption} command, +for continuation captions. + +%\newsavebox{\picbox} + +\begin{figure} +\centering +\caption{Example figure with a standard caption.} \label{fig:nocrot} +\setlength{\unitlength}{0.2in} +\footnotesize +\begin{picture}(17,2) +\thicklines +\put(0,0){\begin{picture}(4,1) + \put(1.5,0.5){\oval(3,1)} + \put(1.5,0.5){\makebox(0,0){2,5 (1)}} + \put(3,0.5){\line(1,0){1.0}} + \put(4.25,0.5){\circle{0.5}} + \end{picture}} + +\put(4.5,0){\begin{picture}(8,1) + \put(0,0){\dashbox{0.25}(4,1){date}} + \put(4,0.5){\line(1,0){3.5}} + \put(7.75,0.5){\circle{0.5}} + \put(6,1){\makebox(0,0){A[1:3]}} + \end{picture}} + +\put(12.5,0){\begin{picture}(4,1) + \put(0,0){\framebox(4,1){INTEGER}} + \put(3.75,0){\line(0,1){1}} + \end{picture}} +\end{picture} +\normalsize +\setlength{\unitlength}{1pt} +\end{figure} + + +\begin{example}Float with a regular caption. + +Figure~\ref{fig:nocrot} is produced by the code below: +\begin{verbatim} +\begin{figure} +\centering +\caption{Example figure with a standard caption.} \label{fig:nocrot} +\setlength{\unitlength}{0.2in} +\footnotesize +\begin{picture}(17,2) +\thicklines +\put(0,0){\begin{picture}(4,1) + \put(1.5,0.5){\oval(3,1)} + \put(1.5,0.5){\makebox(0,0){2,5 (1)}} + \put(3,0.5){\line(1,0){1.0}} + \put(4.25,0.5){\circle{0.5}} + \end{picture}} +\put(4.5,0){\begin{picture}(8,1) + \put(0,0){\dashbox{0.25}(4,1){date}} + \put(4,0.5){\line(1,0){3.5}} + \put(7.75,0.5){\circle{0.5}} + \put(6,1){\makebox(0,0){A[1:3]}} + \end{picture}} +\put(12.5,0){\begin{picture}(4,1) + \put(0,0){\framebox(4,1){INTEGER}} + \put(3.75,0){\line(0,1){1}} + \end{picture}} +\end{picture} +\normalsize +\setlength{\unitlength}{1pt} +\end{figure} +\end{verbatim} +\end{example} % end example + +\begin{example}Float with a rotated caption. + +Figure~\ref{fig:crot} is produced by the code below: +\begin{verbatim} +\begin{figure} +\centering +\rotcaption{Figure~\protect\ref{fig:nocrot} with a rotated caption.} + \label{fig:crot} +\setlength{\unitlength}{0.2in} +\footnotesize +\begin{picture}(17,2) +... +\end{picture} +\normalsize +\setlength{\unitlength}{1pt} +\end{figure} +\end{verbatim} +\end{example} % end example + + +\begin{figure} +\centering +\rotcaption{Figure~\protect\ref{fig:nocrot} with a rotated caption.} + \label{fig:crot} +\setlength{\unitlength}{0.2in} +\footnotesize +\begin{picture}(17,2) +\thicklines +\put(0,0){\begin{picture}(4,1) + \put(1.5,0.5){\oval(3,1)} + \put(1.5,0.5){\makebox(0,0){2,5 (1)}} + \put(3,0.5){\line(1,0){1.0}} + \put(4.25,0.5){\circle{0.5}} + \end{picture}} +\put(4.5,0){\begin{picture}(8,1) + \put(0,0){\dashbox{0.25}(4,1){date}} + \put(4,0.5){\line(1,0){3.5}} + \put(7.75,0.5){\circle{0.5}} + \put(6,1){\makebox(0,0){A[1:3]}} + \end{picture}} +\put(12.5,0){\begin{picture}(4,1) + \put(0,0){\framebox(4,1){INTEGER}} + \put(3.75,0){\line(0,1){1}} + \end{picture}} +\end{picture} +\normalsize +\setlength{\unitlength}{1pt} +\end{figure} + + As can be seen from \fref{fig:crot} the advisability of rotating a caption +depends on the size of the body of the float. It may be better in certain +cases to leave the caption in its regular position and rotate the body of +the float instead. + +\def\prwrot#1{% +\settowidth{\fool}{ISOROT} +\savebox{\foo}{\parbox{\fool}{ISOROT ISOROT ISOROT ISOROT}}% +\framebox{---\begin{turn}{#1}\framebox{\usebox{\foo}}\end{turn}---}}% +\def\degrees{{\small$^{o}$}} + +\begin{figure} +\centering +\begin{tabular}{|c|c|c|} \hline +\prwrot{0} &\prwrot{-40}&\prwrot{-80}\\ +0\degrees & -40\degrees & -80\degrees \\ \hline +\prwrot{-120}&\prwrot{-160}&\prwrot{-200}\\ +-120\degrees & -160\degrees & -200\degrees \\ \hline +\prwrot{-240}&\prwrot{-280}&\prwrot{-320}\\ +-240\degrees & -280\degrees & -320\degrees \\ \hline +\end{tabular} +\caption{Rotation of paragraphs between 0 and -320 degrees} \label{fig:angles1} +\end{figure} + + +\begin{example}Regular caption and float. + +Figure~\ref{fig:angles1} is a regular figure and caption. It is produced by +the following code: +\begin{verbatim} +\def\prwrot#1{% +\settowidth{\fool}{ISOROT} +\savebox{\foo}{\parbox{\fool}{ISOROT ISOROT ISOROT ISOROT}}% +\framebox{---\begin{turn}{#1}\framebox{\usebox{\foo}}\end{turn}---}}% +\def\degrees{{\small$^{o}$}} +\end{verbatim} + +\begin{verbatim} +\begin{figure} +\centering +\begin{tabular}{|c|c|c|} \hline +\prwrot{0} &\prwrot{-40}&\prwrot{-80}\\ +0\degrees & -40\degrees & -80\degrees \\ \hline +\prwrot{-120}&\prwrot{-160}&\prwrot{-200}\\ +-120\degrees & -160\degrees & -200\degrees \\ \hline +\prwrot{-240}&\prwrot{-280}&\prwrot{-320}\\ +-240\degrees & -280\degrees & -320\degrees \\ \hline +\end{tabular} +\caption{Rotation of paragraphs between 0 and -320 degrees} \label{fig:angles1} +\end{figure} +\end{verbatim} +\end{example} % end example + + +\begin{figure} +\centering +\begin{sideways} +\begin{tabular}{|c|c|c|} \hline +\prwrot{0} &\prwrot{40}&\prwrot{80}\\ +0\degrees & 40\degrees & 80\degrees \\ \hline +\prwrot{120}&\prwrot{160}&\prwrot{200}\\ +120\degrees & 160\degrees & 200\degrees \\ \hline +\prwrot{240}&\prwrot{280}&\prwrot{320}\\ +240\degrees & 280\degrees & 320\degrees \\ \hline +\end{tabular} +\end{sideways} +\caption[Rotation of paragraphs between 0 and 320 degrees]% + {Rotation of paragraphs between 0 and 320 degrees (with figure + body turned sideways)}\label{fig:angles2} +\end{figure} + +\begin{example}Regular caption and rotated float body. + +Figure~\ref{fig:angles2} is a regular figure and caption where the figure +contents have been rotated. It was produced by the following code. +\begin{verbatim} +\begin{figure} +\centering +\begin{sideways} +\begin{tabular}{|c|c|c|} \hline +\prwrot{0} &\prwrot{40}&\prwrot{80}\\ +0\degrees & 40\degrees & 80\degrees \\ \hline +\prwrot{120}&\prwrot{160}&\prwrot{200}\\ +120\degrees & 160\degrees & 200\degrees \\ \hline +\prwrot{240}&\prwrot{280}&\prwrot{320}\\ +240\degrees & 280\degrees & 320\degrees \\ \hline +\end{tabular} +\end{sideways} +\caption[Rotation of paragraphs between 0 and 320 degrees]% + {Rotation of paragraphs between 0 and 320 degrees (with figure + body turned sideways)}\label{fig:angles2} +\end{figure} +\end{verbatim} +\end{example} % end example + +\begin{landscape} +\section{Landscaping} + + \latex{} normally prints in portrait mode. +The \verb|landscape|\ixenv{landscape} environment +prints all the enclosed stuff in landscape mode, except for headers +and footers which are not rotated. + +\begin{example} Landscaping + +The source for this part of the document is: +\begin{verbatim} +\begin{landscape} +\section{Landscaping} + + \latex{} normally prints in portrait mode. The ... +... +... long, wide tables. +\end{landscape} +\end{verbatim} +\end{example} + + The environment starts by clearing the current page and then switches +to portrait mode. At the end of the environment the current page is cleared +and the next page is back to normal portrait mode. + + All the other rotation commands and environments produce boxes and +\latex{} will not break a box across a page. The \verb|landscape| environemt +does not produce a box and so many pages can be printed in landscape mode +with \latex{} taking care of the page breaking for you. + + Landscape mode is not particularly useful for normal text as the +lines are far too long for comfortable reading. Where it can be useful +is where you have a table that is too wide to fit on a portrait page, so +needs to be rotated, yet is also too long to fit on the page when it is +rotated. The \file{supertabular}\ixpack{supertabular}, +the \file{longtable}\ixpack{longtable}, +and the \file{xtab}\ixpack{xtab} +packages provide facilities for automatically breaking long tables across +pages. Any of these can be used in conjunction with landscaping to both +rotate and automatically page break long, wide tables. +\end{landscape} + + +%%%%%%%%%%%%%% +%\end{document} +%%%%%%%%%%%%% + +\bibliographystyle{alpha} +\begin{thebibliography}{GMS94} + +\bibitem[GMS94]{goosens} +Michel Goossens, Frank Mittelbach and Alexander Samarin. +\newblock \textit{The LaTeX Companion}. +\newblock Addison-Wesley Publishing Co. 1994. + +\bibitem[RB92]{rahtz} +Sebastian Rahtz and Leonor Barroca. +\newblock \textit{A style option for rotated objects in LaTeX}. +\newblock TUGBoat, volume 13, number 2, pp 156--180, July 1992. + +\end{thebibliography} + +\end{document} + +\begin{references} +\reference{LAMPORT, L.,}{LaTeX --- A Document Preparation System,} + {Addison-Wesley Publishing Co., 2nd edition, 1994.} \label{lamport} +\reference{WILSON, P.R.,}{LaTeX files for typesetting ISO standards: + Source code,} + {NISTIR, National Institute of Standards and Technology, + Gaithersburg, MD 20899. June 1996.} \label{isoe} +\reference{WILSON, P.R.,}{LaTeX package files for ISO~10303: User manual,} + {NISTIR, National Institute of Standards and Technology, + Gaithersburg, MD 20899. June 1996.} \label{stepsty} +\reference{RAHTZ, S., and BARROCA, L.,}{A style option for rotated + objects in \latex,}{ TUGBoat, volume 13, number 2, pp 156--180, + July 1992.} \label{rahtz} +\reference{GOOSSENS, M., MITTELBACH, F. and SAMARIN, A.,}{% + The LaTeX Companion,} + {Addison-Wesley Publishing Co., 1994.} \label{goosens} +\reference{GOOSSENS, M., and RAHTZ, S.,}{% + The LaTeX Web Companion --- Integrating TeX, HTML and XML,} + {Addison-Wesley Publishing Co., 1999.} \label{lwebcom} +\reference{CHEN, P. and HARRISON, M.A.,}{Index preparation and + processing,}{Software--Practice and Experience, 19(9):897--915, + September 1988.} \label{chen} +\reference{KOPKA, H. and DALY, P.W.,}{A Guide to LaTeX,} + {Addison-Wesley Publishing Co., 1993.} \label{kopka} +\reference{WALSH, N.,}{Making TeX Work,}{O'Reilly \& Associates, Inc., + 103 Morris Street, Suite A, Sebastopol, CA 95472. 1994. } \label{walsh} +\reference{ISO 8879:1986,}{Information processing --- + Text and office systems --- + Standard Generalized Markup Language (SGML).}{} \label{sgml} +\reference{GOLDFARB, C.F.,}{The SGML Handbook,} + {Oxford University Press, 1990.} \label{goldfarb} +\reference{BRYAN, M.,}{SGML --- An Author's Guide to the Standard Generalized + Markup Language,}{Addison-Wesley Publishing Co., 1988. } \label{bryan} +\reference{PHILLIPS, L. and LUBELL, J.,}{An SGML Environment for STEP,}% + {NISTIR 5515, National Institute of Standards and Technology, + Gaithersburg, MD 20899. November 1994.} \label{pandl} +\reference{WILSON, P. R.,}{LTX2X: A LaTeX to X Auto-tagger,}% + {NISTIR, National Institute of Standards and Technology, + Gaithersburg, MD 20899. June 1996.} \label{ltx2x} +\reference{RESSLER, S.,}{The National PDES Testbed Mail Server User's Guide,} + {NSTIR 4508, National Institute of Standards and Technology, + Gaithersburg, MD 20899. January 1991.} \label{ressler} +\reference{RINAUDOT, G.R.,}{STEP On Line Information Service (SOLIS),} + {NISTIR 5511, National Institute of Standards and Technology, + Gaithersburg, MD 20899. October 1994. } \label{rinaudot} +\reference{KROL, E.,}{The Whole Internet --- User's Guide \& Catalog,} + {O'Reilly \& Associates, Inc., + 103 Morris Street, Suite A, Sebastopol, CA 95472. 1993. } \label{krol} +\reference{WILSON, P.R.,}{The hyphenat package,}% + {1999. (Available from CTAN)} \label{bib:hyphenat} +\reference{WILSON, P.R.,}{The xtab package,}% + {1998. (Available from CTAN)} \label{bib:xtab} +\end{references} + + + +\end{document} |