Debian Codegraph @

texmf-dist/source/latex/isorot/isorot.dtx

raw
1 % \iffalse meta-comment
2 %
3 % isorot.dtx
4 %
5 %
6 % This program is provided under the terms of the
7 % LaTeX Project Public License distributed from CTAN
8 % archives in directory macros/latex/base/lppl.txt.
9 %
10 % Author: Peter Wilson (CUA)
11 % now at: [email protected]
12 %
13 % \fi
14 % \CheckSum{1619}
15 %
16 %
17 % \def\fileversion{v2.1}
18 % \def\filedate{2000/02/15}
19 % \title{\LaTeX{} files for typesetting ISO Standards: \\
20 % Source code: The isorot package\thanks{This
21 % file has version number \fileversion, last revised
22 % \filedate.}}
23 %
24 % \author{%
25 % Peter Wilson\\
26 % Catholic University of America\thanks{This work was originally
27 % performed at Rensselaer Polytechnic Institute.} \\
28 % Now at \texttt{[email protected]}
29 % }
30 % \date{\filedate}
31 % \maketitle
32 % \tableofcontents
33 %
34 % \StopEventually{}
35 %
36 %
37 %
38 % \section{Introduction}
39 %
40 % This document provides the commented source for \LaTeX{}
41 % package files designed for the typesetting of
42 % documents according to the rules for ISO international standards.
43 % A seperate document provides the user manual~\cite{PRW96i}.
44 % This manual is typeset according to the conventions of the
45 % \LaTeX{} \textsc{docstrip} utility which enables the automatic
46 % extraction of the \LaTeX{} macro source files~\cite{GOOSSENS94}.
47 %
48 % ISO (the International Organization for Standardisation) specify
49 % their document layout requirements in ISO Directives~\cite{ISOD397}.
50 % Unfortunately these Directives do not completely define the document
51 % layout, leaving several aspects open to interpretation by the
52 % document editor and re-interpretation by the ISO editorial board.
53 % The following specifications are a re-implementation of the \LaTeX{}
54 % macros that have been used for the production of camera ready copy
55 % for the ISO~10303 standard {\em Product data representation and
56 % exchange}. The initial release of ISO~10303:1994 consisted of twelve
57 % parts and over 2400 pages. The editorial board of the ISO Central
58 % Secretariat in Geneva accepted the typographic conventions embodied
59 % in these macros.
60 %
61 % This manual is provided as a service for future developers
62 % and maintainers of the
63 % class and packages for ISO standards. It is assumed that any
64 % any such person is \LaTeX{} literate and accustomed to supporting
65 % complex class and package files~\cite{GOOSSENS94}.
66 %
67 %
68 % Section~\ref{sec:docstrip} describes some
69 % administrative elements and code for general use later in the specification.
70 % Section~\ref{sec:rot} specifies
71 % the macros for rotation of textual and tabular elements.
72 %
73 % \section{The {\sc docstrip} modules} \label{sec:docstrip}
74 %
75 % The following modules are used in the implementation to direct
76 % {\sc docstrip} in generating the external files:
77 % \begin{center}
78 % \begin{tabular}{ll}
79 % rot & produce the isorot package\\
80 % rotne & produce the isorotne style file\\
81 % driver & produce a documentation driver file \\
82 % \end{tabular}
83 % \end{center}
84 %
85 % \subsection{A driver for this document}
86 %
87 % The next series of code contains the documentation driver file for
88 % \LaTeX, i.e., the file that will produce the documentation you are
89 % currently reading. This will be extracted from this file by the
90 % {\sc docstrip} program.
91 %
92 % \begin{macrocode}
93 %<*driver>
94 \documentclass{ltxdoc}
95 % \end{macrocode}
96 %
97 % We do not want the following basic elements to appear in the index.
98 % \begin{macrocode}
99 \DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
100 \DoNotIndex{\@centercr,\@cite}
101 \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue}
102 \DoNotIndex{\@input,\@ixpt,\@m}
103 \DoNotIndex{\@minus,\@mkboth,\@ne,\@nil,\@nomath,\@plus,\@set@topoint}
104 \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb}
105 \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt}
106 \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt}
107 \DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace}
108 \DoNotIndex{\advance,\Alph,\alph}
109 \DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box}
110 \DoNotIndex{\bullet}
111 \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption}
112 \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass}
113 \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist}
114 \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup}
115 \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter}
116 \DoNotIndex{\fbox}
117 \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef}
118 \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule}
119 \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi}
120 \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi}
121 \DoNotIndex{\input}
122 \DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark}
123 \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright}
124 \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment}
125 \DoNotIndex{\NeedsTeXFormat,\newdimen}
126 \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number}
127 \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@}
128 \DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip}
129 \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions}
130 \DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright}
131 \DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font}
132 \DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily,\roman}
133 \DoNotIndex{\roman,\secdef,\selectfont,\setbox,\setcounter,\setlength}
134 \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space}
135 \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase}
136 \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt}
137 \DoNotIndex{\viipt,\vipt,\vskip,\vspace}
138 \DoNotIndex{\wd,\xiipt,\year,\z@}
139 % \end{macrocode}
140 % We do want an index, using linenumbers, but not update information.
141 % \begin{macrocode}
142 \EnableCrossrefs
143 \CodelineIndex
144 %%%% \RecordChanges
145 % \end{macrocode}
146 % We may use so many \file{docstrip} modules that we set the
147 % \texttt{StandardModuleDepth} counter to 1.
148 % \begin{macrocode}
149 \setcounter{StandardModuleDepth}{1}
150 % \end{macrocode}
151 % Some commonly used abbreviations
152 % \begin{macrocode}
153 \newcommand*{\Lopt}[1]{\textsf {#1}} % typeset an option
154 \newcommand*{\file}[1]{\texttt {#1}} % typeset a file
155 \newcommand*{\Lcount}[1]{\textsl {\small#1}} % typeset a counter
156 \newcommand*{\pstyle}[1]{\textsl {#1}} % typeset a pagestyle
157 \newcommand*{\Lenv}[1]{\texttt {#1}} % typeset an environment
158 % \end{macrocode}
159 % We want the full details printed.
160 % \begin{macrocode}
161 \begin{document}
162 \DocInput{isorot.dtx}
163 \end{document}
164 %</driver>
165 % \end{macrocode}
166 %
167 %
168 % \section{Identification} \label{sec:id}
169 %
170 % Announce the name, option files and version for \LaTeX 2e files:
171 % \begin{macrocode}
172 %<rot>\ProvidesPackage{isorot}[2000/02/15 v2.1 ISO rotation package]
173 % \end{macrocode}
174 %
175 % These files are for use with \LaTeX\ v2.09 or a disadvantaged \LaTeX 2e
176 % distribution.
177 % \begin{macrocode}
178 %<rotne>\typeout{isorotne.sty [1997/12/02 v2 LaTeX 2.09 ISO rotation package]}
179 % \end{macrocode}
180 %
181 %
182 % \section{The \file{isorot} package and \file{isorotne} style} \label{sec:rot}
183 %
184 % The \file{isorot} package provides a specialization of the \file{rotating}
185 % package
186 % for use within ISO standard documents. The principal modifications
187 % relate to the table and figure environments. The original \file{rotating}
188 % package was developed by
189 % Sebastian Rahtz and Leonor Barroca\footnote{Sebastian Rahtz and Leonor
190 % Barroca, {\em A style option for rotated objects in TeX,} TUGboat, 13, 2,
191 % pp 156--180, July 1992.}.
192 %
193 % Apparently not all distributions of \LaTeX{} contain the necessary
194 % packages for a simple implementation. The \file{isorotne} style provides
195 % the same capabilities for these users.
196 % This essentially replaces all \LaTeX 2e facilities from \file{rotating}
197 % by generic ones, and includes the relevent package sources within the one
198 % file.
199 %
200 % \changes{v11}{1997/09/30}{Added new dvi drivers to isrotne package}
201 % \changes{v2}{1997/12/02}{Updated rotations to rotating v2.12}
202 % \changes{v2.1}{2000/02/15}{Updated to latest ISO class, and generalised for any class}
203 % \begin{macrocode}
204 %<*rot|rotne>
205 % \end{macrocode}
206 %
207 % The package takes one option which prints debugging information.
208 %
209 % \begin{macro}{\PWRFc@tracing}
210 % A counter controlling debug printing.
211 % \begin{macrocode}
212 \newcount\PWRFc@tracing
213 \DeclareOption{errorshow}{\PWRFc@tracing\z@}
214 \DeclareOption{debugshow}{\PWRFc@tracing5\relax}
215 \DeclareOption*{\PassOptionsToPackage{\CurrentOption}{graphics}}
216 \ProcessOptions
217 % \end{macrocode}
218 % \end{macro}
219 %
220 % \begin{macro}{\PWRF@trace}
221 % A macro that gets the trace message as its argument.
222 % \begin{macrocode}
223 \newcommand\PWRF@trace[2]{%
224 \ifnum\PWRFc@tracing>#1\relax
225 \GenericWarning
226 {(isorot)\@spaces\@spaces}
227 {Package isorot: #2}%
228 \fi
229 }
230 % \end{macrocode}
231 % \end{macro}
232 %
233 % For the \file{isorot} package most of the work is done by the
234 % \file{graphicx} package, so make sure it is loaded. Also, David
235 % Carlisle's \file{lscape} package is required for landscaping some
236 % pages or long wide tables.
237 % \begin{macrocode}
238 %<*rot>
239 \NeedsTeXFormat{LaTeX2e}
240 \RequirePackage{graphicx}
241 \RequirePackage{lscape}
242 %</rot>
243 % \end{macrocode}
244 %
245 % For the disadvantaged user, the required basic facilities are
246 % a portion of the \file{graphics} package, which in turn requires
247 % the \file{trig} package. We also need the code from the
248 % \file{lscape} package.
249 %
250 % \begin{macrocode}
251 %<*rotne>
252 % \end{macrocode}
253 % Firstly, here is the code from the \file{trig} package.
254 %
255 % \subsection{Trigonometry functions}
256 %
257 % \emph{The following is the contents of the \file{trig} package written by
258 % David Carlisle. The code and explanations are from \file{trig.dtx}
259 % version 1.08, dated 1994/10/16. The original file should be consulted
260 % for a full explanation.}
261 %
262 %
263 % These macros implement the trigonometric functions, sin, cos and tan.
264 % In each case two commands are defined. For instance the command
265 % |\CalculateSin{33}| may be isued at some point, and then anywhere
266 % later in the document, the command |\UseSin{33}| will return the
267 % decimal expansion of $\sin(33^\circ)$.
268 %
269 % The arguments to these macros do not have to be whole numbers,
270 % although in the case of whole numbers, \LaTeX\ or plain \TeX\ counters
271 % may be used. In \TeX{}Book syntax, arguments must be of type:
272 % \meta{optional signs}\meta{factor}
273 %
274 % Some other examples are:\\
275 % |\CalculateSin{22.5}|, |\UseTan{\value{mycounter}}|,
276 % |\UseCos{\count@}|.
277 %
278 % Note that unlike the psfig macros, these save all previously
279 % computed values. This could easily be changed, but I thought that in
280 % many applications one would want many instances of the
281 % same value. (eg rotating all the headings of a table by the
282 % \emph{same} amount).
283 %
284 % Some useful constants for converting between degrees and radians.
285 % $$\frac{\pi}{180}\simeq\frac{355}{113\times180}=\frac{71}{4068}$$
286 % \begin{macrocode}
287 \chardef\nin@ty=90
288 \chardef\@clxx=180
289 \chardef\@lxxi=71
290 \mathchardef\@mmmmlxviii=4068
291 % \end{macrocode}
292 %
293 % The approximation to $\sin$.
294 % \begin{eqnarray*}
295 % \sin(x)& \simeq& x - (1/3!)x^3 + (1/5!)x^5 - (1/7!)x^7 + (1/9!)x^9\\
296 % &\simeq&\frac{((((7!/9!x^2-7!/7!)x^2+7!/5!)x^2 +7!/3!)x^2+7!/1!)x}
297 % {7!}\\
298 % &=&\frac{((((1/72x^2-1)x^2+42)x^2 +840)x^2+5040)x}
299 % {5040}
300 % \end{eqnarray*}
301 %
302 % \begin{macrocode}
303 \chardef\@coeffz=72
304 %\chardef\@coefa=1
305 \chardef\@coefb=42
306 \mathchardef\@coefc=840
307 \mathchardef\@coefd=5040
308 % \end{macrocode}
309 %
310 % \begin{macrocode}
311 {\catcode`t=12\catcode`p=12\gdef\noPT#1pt{#1}}
312 \def\TG@rem@pt#1{\expandafter\noPT\the#1\space}
313 % \end{macrocode}
314 %
315 % \begin{macrocode}
316 \def\TG@term#1{%
317 \dimen@\@tempb\dimen@
318 \advance\dimen@ #1\p@}
319 % \end{macrocode}
320 %
321 % \begin{macrocode}
322 \def\TG@series{%
323 \dimen@\@lxxi\dimen@
324 \divide \dimen@ \@mmmmlxviii
325 \edef\@tempa{\TG@rem@pt\dimen@}%
326 \dimen@\@tempa\dimen@
327 \edef\@tempb{\TG@rem@pt\dimen@}%
328 \divide\dimen@\@coeffz
329 \advance\dimen@\m@ne\p@
330 \TG@term\@coefb
331 \TG@term{-\@coefc}%
332 \TG@term\@coefd
333 \dimen@\@tempa\dimen@
334 \divide\dimen@ \@coefd}
335 % \end{macrocode}
336 %
337 % \begin{macrocode}
338 \def\CalculateSin#1{{%
339 \expandafter\ifx\csname sin(\number#1)\endcsname\relax
340 \dimen@=#1\p@\TG@@sin
341 \expandafter\xdef\csname sin(\number#1)\endcsname
342 {\TG@rem@pt\dimen@}%
343 \fi}}
344 % \end{macrocode}
345 %
346 % \begin{macrocode}
347 \def\CalculateCos#1{{%
348 \expandafter\ifx\csname cos(\number#1)\endcsname\relax
349 \dimen@=\nin@ty\p@
350 \advance\dimen@-#1\p@
351 \TG@@sin
352 \expandafter\xdef\csname cos(\number#1)\endcsname
353 {\TG@rem@pt\dimen@}%
354 \fi}}
355 % \end{macrocode}
356 %
357 % \begin{macrocode}
358 \def\TG@reduce#1#2{%
359 \dimen@#1#2\nin@ty\p@
360 \advance\dimen@#2-\@clxx\p@
361 \dimen@-\dimen@
362 \TG@@sin}
363 % \end{macrocode}
364 %
365 % \begin{macrocode}
366 \def\TG@@sin{%
367 \ifdim\TG@reduce>+%
368 \else\ifdim\TG@reduce<-%
369 \else\TG@series\fi\fi}%
370 % \end{macrocode}
371 %
372 % \begin{macrocode}
373 \def\UseSin#1{\csname sin(\number#1)\endcsname}
374 \def\UseCos#1{\csname cos(\number#1)\endcsname}
375 % \end{macrocode}
376 %
377 % \begin{macrocode}
378 \chardef\z@num\z@
379 \expandafter\let\csname sin(0)\endcsname\z@num
380 \expandafter\let\csname cos(0)\endcsname\@ne
381 \expandafter\let\csname sin(90)\endcsname\@ne
382 \expandafter\let\csname cos(90)\endcsname\z@num
383 \expandafter\let\csname sin(-90)\endcsname\m@ne
384 \expandafter\let\csname cos(-90)\endcsname\z@num
385 \expandafter\let\csname sin(180)\endcsname\z@num
386 \expandafter\let\csname cos(180)\endcsname\m@ne
387 % \end{macrocode}
388 %
389 % This is accurate to 4 decimal places for angles up to
390 % $50^\circ$, after that the accuracy tails off, giving
391 % 57.47894 instead of 57.2900 for $89^\circ$.
392 % \begin{macrocode}
393 \def\CalculateTan#1{{%
394 \expandafter\ifx\csname tan(\number#1)\endcsname\relax
395 \CalculateSin{#1}%
396 \CalculateCos{#1}%
397 \@tempdima\UseCos{#1}\p@
398 \divide\@tempdima\@iv
399 \@tempdimb\UseSin{#1}\p@
400 \@tempdimb\two@fourteen\@tempdimb
401 \divide\@tempdimb\@tempdima
402 \expandafter\xdef\csname tan(\number#1)\endcsname
403 {\TG@rem@pt\@tempdimb}%
404 \fi}}
405 % \end{macrocode}
406 %
407 % \begin{macrocode}
408 \def\UseTan#1{\csname tan(\number#1)\endcsname}
409 % \end{macrocode}
410 %
411 % \begin{macrocode}
412 \mathchardef\two@fourteen=16384
413 \chardef\@iv=4
414 % \end{macrocode}
415 %
416 % \begin{macrocode}
417 \expandafter\def\csname tan(90)\endcsname{\errmessage{Infinite tan !}}
418 \expandafter\let\csname tan(-90)\expandafter\endcsname
419 \csname tan(90)\endcsname
420 % \end{macrocode}
421 %
422 % \subsection{Landscape environment}
423 %
424 % The \file{lscape} package by David Carlisle provides a landscape
425 % environment which prints the enclosed pages in landscape rather
426 % than portrait. For 2.09 this package does not work, so we provide
427 % for the functionality here. The following code is taken from
428 % the \file{lscape} package.\footnote{Version 3.0, last revised
429 % 1994/10/05.}
430 %
431 % \begin{environment}{landscape}
432 % \begin{macrocode}
433 \let\LS@makecol=\@makecol
434 \let\LS@makefcolumn=\@makefcolumn
435 \def\LS@rot{%
436 \setbox\@outputbox\vbox{\hbox{\rotatebox{90}{\box\@outputbox}}}}
437 \def\landscape{%
438 \clearpage
439 \begingroup
440 \vsize=\textwidth
441 \hsize=\textheight
442 \linewidth=\hsize
443 \columnwidth=\hsize
444 \@colroom=\vsize
445 \textheight=\vsize
446 \@colht=\vsize
447 \def\@makecol{\LS@makecol\LS@rot}%
448 \def\@makefcolumn##1{\LS@makefcolumn{##1}\LS@rot}}
449 \def\endlandscape{%
450 \clearpage
451 \endgroup
452 \global\@colht=\textheight
453 \global\vsize=\textheight
454 \global\@colroom=\textheight}
455 % \end{macrocode}
456 % \end{environment}
457 %
458 % \begin{macrocode}
459 %</rotne>
460 % \end{macrocode}
461 %
462 % \subsection{Drivers}
463 %
464 % Rotation is not done within \TeX\ but by the device drivers via |\special|
465 % commands appropriate for each driver.
466 %
467 % \begin{macrocode}
468 %<*rot>
469 \def\rotdriver#1{%
470 \message{The .dvi file is to be processed by the #1 driver.}
471 \typeout{Change rotdriver in the source accordingly if you do not have this.}
472 \makeatletter\input{#1.def}\makeatother}
473 %</rot>
474 % \end{macrocode}
475 %
476 % \begin{macrocode}
477 %<*rotne>
478 % \end{macrocode}
479 %
480 % Life is much more difficult for the \file{isorotne} style as we have to
481 % include source (runnable under 2.09) that the \file{isorot} package
482 % gets for free.
483 %
484 % \begin{macro}{\Grot@start}
485 % \begin{macro}{\Grot@end}
486 % The commands |\Grot@start| and |\Grot@end| are defined which assume
487 % that the macro |\Grot@angle| contains the rotation angle. First
488 % set these to do nothing, just in case the user calls for an unsupported
489 % driver.
490 % \begin{macrocode}
491 \def\Grot@start{}
492 \def\Grot@end{}
493 % \end{macrocode}
494 % \end{macro}
495 % \end{macro}
496 %
497 % \begin{macro}{\Dvitops@count}
498 % A counter for the DVITOPS driver.
499 % \begin{macrocode}
500 \newcount\Dvitops@count
501 \Dvitops@count=\@ne
502 % \end{macrocode}
503 % \end{macro}
504 %
505 % \begin{macro}{\listrotdrivers}
506 % Writes out the list of currently available rotdrivers.
507 % \begin{macrocode}
508 \newcommand{\listrotdrivers}{%
509 \typeout{If you do not have this driver then change rotdriver in your source.}
510 \typeout{Available rotdrivers are:}
511 \typeout{ \space\space dvipdf, dvips, dvipsone, dvitops, dviwindo,}
512 \typeout{ \space\space pctex32, pctexps, pubps, textures}
513 }
514 % \end{macrocode}
515 % \end{macro}
516 %
517 % \begin{macro}{\rotdriver}
518 % The command |\rotdriver{|\meta{driver}|}| must be put in the preamble,
519 % where \meta{driver} is the identification of one of the drivers that
520 % support rotation.
521 % \begin{macrocode}
522 \newcommand{\rotdriver}[1]{%
523 % \end{macrocode}
524 % Put the argument into an uppercase string
525 % \begin{macrocode}
526 \bgroup\edef\next{\def\noexpand\tempa{#1}}%
527 \uppercase\expandafter{\next}%
528 % \end{macrocode}
529 % \begin{macro}{\ISOROTSTD}
530 % \begin{macro}{\DVIPS}
531 % \begin{macro}{\DVIPSONE}
532 % \begin{macro}{\DVITOPS}
533 % \begin{macro}{\PCTEXPS}
534 % \begin{macro}{\PUBPS}
535 % \begin{macro}{\TEXTURES}
536 % \begin{macro}{\DVIPDF}
537 % \begin{macro}{\DVIWINDO}
538 % \begin{macro}{\PCTEX32}
539 % These are the currently supported drivers that can cope with rotations.
540 % The code for the drivers has been taken from
541 % \file{drivers.dtx}\footnote{Version v3.0d, revised 1996/12/12.} by
542 % Sebastian Rahtz and David Carlisle.
543 %
544 % The |isorotstd| driver is included against the (improbable) time
545 % when there might be one `standard' driver, or at least all the
546 % |\special| code for rotations might be common.
547 % \begin{macrocode}
548 \def\ISOROTSTD{ISOROTSTD}
549 \def\DVIPS{DVIPS}
550 \def\DVIPSONE{DVIPSONE}
551 \def\DVITOPS{DVITOPS}
552 \def\PCTEXPS{PCTEXPS}
553 \def\PUBPS{PUBPS}
554 \def\TEXTURES{TEXTURES}
555 \def\DVIPDF{DVIPDF}
556 \def\DVIWINDO{DVIWINDO}
557 \def\PCTEXxxxii{PCTEX32}
558 % \end{macrocode}
559 % Later we will use a case statement for picking the proper code. Define
560 % a numeric code for each driver.
561 % \begin{macrocode}
562 \global\chardef\rot@driver=0
563 \ifx\tempa\ISOROTSTD
564 \global\chardef\rot@driver=1\fi
565 \ifx\tempa\DVIPS
566 \global\chardef\rot@driver=2\fi
567 \ifx\tempa\DVIPSONE
568 \global\chardef\rot@driver=3\fi
569 \ifx\tempa\DVITOPS
570 \global\chardef\rot@driver=4\fi
571 \ifx\tempa\PCTEXPS
572 \global\chardef\rot@driver=5\fi
573 \ifx\tempa\PUBPS
574 \global\chardef\rot@driver=6\fi
575 \ifx\tempa\TEXTURES
576 \global\chardef\rot@driver=7\fi
577 \ifx\tempa\DVIPDF
578 \global\chardef\rot@driver=8\fi
579 \ifx\tempa\DVIWINDO
580 \global\chardef\rot@driver=9\fi
581 \ifx\tempa\PCTEXxxxii
582 \global\chardef\rot@driver=10\fi
583 \egroup
584 % \end{macrocode}
585 % \end{macro}
586 % \end{macro}
587 % \end{macro}
588 % \end{macro}
589 % \end{macro}
590 % \end{macro}
591 % \end{macro}
592 % \end{macro}
593 % \end{macro}
594 % \end{macro}
595 %
596 % Now define the particulars for each driver. \\
597 % {\bf Case 0:} We should not be here!
598 % \begin{macrocode}
599 \ifcase\rot@driver % case 0
600 \message{WARNING *** unknown driver --- no rotation.} \listrotdrivers
601 % \end{macrocode}
602 % {\bf Case 1: ISOROTSTD} Not yet available.
603 % \begin{macrocode}
604 \or % case 1: ISOROTSTD
605 \message{WARNING *** isorotstd driver not available yet --- no rotation.}
606 \listrotdrivers
607 % \end{macrocode}
608 % {\bf Case 2: DVIPS} For Tom Rokicki's {\em dvips} driver. Has been tested
609 % with version 5.518 of July 1993.
610 % \begin{macrocode}
611 \or % case 2: DVIPS
612 \typeout{Rotdriver set to dvips.} \listrotdrivers
613 \def\Grot@start{%
614 \special{ps: gsave currentpoint
615 currentpoint translate \Grot@angle\space neg
616 rotate neg exch neg exch translate}}
617 \def\Grot@end{%
618 \special{ps: currentpoint grestore moveto}}
619 % \end{macrocode}
620 % {\bf Case 3: DVIPSONE} For Y\&Y's {\em dvipsone}.
621 % \begin{macrocode}
622 \or % case 3: DVIPSONE
623 \typeout{Rotdriver set to dvipsone.} \listrotdrivers
624 \def\Grot@start{%
625 \special{ps: gsave currentpoint
626 currentpoint translate \Grot@angle\space
627 rotate neg exch neg exch translate}}
628 \def\Grot@end{%
629 \special{ps: currentpoint grestore moveto}}
630 % \end{macrocode}
631 % {\bf Case 4: DVITOPS} For James Clark's {\em dvitops}.
632 % \begin{macrocode}
633 \or % case 4: DVITOPS
634 \typeout{Rotdriver set to dvitops.} \listrotdrivers
635 \def\Grot@start{%
636 \special{dvitops: origin
637 rot\the\@tempdima}%
638 \special{dvitops: begin rot\the\Dvitops@count}}%
639 \def\Grot@end{%
640 \special{dvitops: end}%
641 \special{dvitops: rotate rot\the\Dvips@count \space
642 \Grot@angle}%
643 \global\advance\Dvitops@count by\@ne}
644 % \end{macrocode}
645 % {\bf Case 5: PCTEXPS} For Personal TeX's PC PTI Laser/PS. Information
646 % supplied by Lance Carnes and Tao Wang |<[email protected]>|.
647 % \begin{macrocode}
648 \or % case 5: PCTEXPS
649 \typeout{Rotdriver set to pctexps.} \listrotdrivers
650 \def\Grot@start{%
651 \special{ps:: gsave currentpoint
652 currentpoint translate \Grot@angle\space
653 rotate neg exch neg exch translate}}
654 \def\Grot@end{%
655 \special{ps:: currentpoint grestore moveto}}
656 % \end{macrocode}
657 % {\bf Case 6: PUBPS} For Arbortext's {\em pubps}.
658 % (Interestingly, I (PRW) note
659 % that my original (circa 1991) code for this used |ps::| but the code
660 % has since been modified to |ps:|.)
661 % \begin{macrocode}
662 \or % case 6: PUBPS
663 \typeout{Rotdriver set to pubps.} \listrotdrivers
664 \def\Grot@start{%
665 \special{ps: gsave currentpoint
666 currentpoint translate \Grot@angle\space
667 rotate neg exch neg exch translate}}
668 \def\Grot@end{%
669 \special{ps: currentpoint grestore moveto}}
670 % \end{macrocode}
671 % {\bf Case 7: TEXTURES} For Blue Sky's {\em Textures}. This code is liable
672 % to change as there is ongoing work to produce a new version of Textures.
673 % \begin{macrocode}
674 \or % case 7: TEXTURES
675 \typeout{Rotdriver set to textures.} \listrotdrivers
676 \def\Grot@start{%
677 \special{postscript
678 0 0 transform
679 grestore
680 matrix currentmatrix
681 3 1 roll
682 itransform
683 dup 3 -1 roll
684 dup 4 1 roll exch
685 translate
686 \Grot@angle\space neg rotate
687 neg exch neg exch translate
688 gsave}}
689 \def\Grot@end{\special{postscript grestore setmatrix gsave}}
690 % \end{macrocode}
691 % {\bf Case 8: DVIPDF} For the {\em dvipdf} driver.
692 % \begin{macrocode}
693 \or % case 8: DVIPDF
694 \typeout{Rotdriver set to dvipdf.} \listofdrivers
695 \def\Grot@start{%
696 \special{pdf: /ROT \Grot@angle\space << }}
697 \def\Grot@end{\special{pdf: /ROT >> }}
698 % \end{macrocode}
699 % {\bf Case 9: DVIWINDO} For Y\&Y's {\em dviwindo} driver.
700 % \begin{macrocode}
701 \or % case 9: DVIWINDO (same as DVIPSONE)
702 \typeout{Rotdriver set to dviwindo.} \listofdrivers
703 \def\Grot@start{%
704 \special{ps: gsave currentpoint
705 currentpoint translate \Grot@angle\space
706 rotate neg exch neg exch translate}}
707 \def\Grot@end{%
708 \special{ps: currentpoint grestore moveto}}
709 % \end{macrocode}
710 % {\bf Case 10: PCTEX32} For Personal TeX's PC TeX for 32 bit Windows.
711 % (Code supplied by Tao Wang |<[email protected]>|).
712 % \begin{macrocode}
713 \or % case 10: PCTEX32
714 \typeout{Rotdriver set to pctex32.} \listofdrivers
715 \def\Grot@start{%
716 \special{ps:: gsave currentpoint
717 currentpoint translate \Grot@angle\space neg
718 rotate neg exch neg exch translate}}
719 \def\Grot@end{\special{ps:: currentpoint grestore moveto}}
720 % \end{macrocode}
721 %
722 % {\bf Case unknown:} We should not have got here!
723 % \begin{macrocode}
724 \else
725 \message{WARNING *** unknown driver --- no rotation.} \listrotdrivers
726 \fi
727 }
728 % \end{macrocode}
729 % \end{macro}
730 % Set up a default driver (use DVIPS as it appears the most popular).
731 % \begin{macrocode}
732 \rotdriver{DVIPS}
733 % \end{macrocode}
734 % The default driver has been set to DVIPS for both \file{isorot} and
735 % \file{isorotne}.
736 %
737 % \begin{macrocode}
738 %</rotne>
739 % \end{macrocode}
740 %
741 % \subsection{Box rotation}
742 %
743 % The \file{isorotne} package needs some code that is part of the
744 % \file{graphics} package.
745 %
746 % The following code has been mainly taken from the graphics package
747 % \file{graphics.dtx}\footnote{Version v1.0d, last revised 1997/06/07.}
748 % by D.P. Carlisle and S.P.Q. Rahtz.
749 %
750 %
751 % The \file{isorotne} package requires some macros that are in the
752 % 2e kernel but not the 2.09 kernel.
753 % The following macros are defined in the 2e kernel but
754 % not in all v2.09 kernels. We need them. We use \verb|\def| instead
755 % of \verb|\newcommand|
756 % just in case a v2.09 document is processed in compatibility
757 % mode, but additionally check if 2e is being used.
758 %
759 % \begin{macrocode}
760 %<*rotne>
761 \ifx\usepackage\undefined
762 % \end{macrocode}
763 %
764 % \begin{macro}{\@plus}
765 % \begin{macro}{\@minus}
766 % Save some string space.
767 % \begin{macrocode}
768 \def\@plus{plus}
769 \def\@minus{minus}
770 % \end{macrocode}
771 % \end{macro}
772 % \end{macro}
773 %
774 % \begin{macro}{\on@line}
775 % \begin{macrocode}
776 \ifnum\inputlineno=\m@ne
777 \let\on@line\empty
778 \else
779 \def\on@line{ on input line \the\inputlineno}
780 \fi
781 % \end{macrocode}
782 % \end{macro}
783 %
784 % \begin{macro}{\rem@pt}
785 % Utility macro to assist in removing the string `pt' from a dimension.
786 % It is complicated but appears to work.
787 % \begin{macrocode}
788 \begingroup
789 \catcode`P=12
790 \catcode`T=12
791 \lowercase{
792 \def\x{\def\rem@pt##1.##2PT{##1\ifnum##2>\z@.##2\fi}}}
793 \expandafter\endgroup\x
794 % \end{macrocode}
795 % \end{macro}
796 %
797 % \begin{macro}{\strip@pt}
798 % Call this to strip `pt' from a dimension like |\strip@pt\dim|.
799 % \begin{macrocode}
800 \def\strip@pt{\expandafter\rem@pt\the}
801 % \end{macrocode}
802 % \end{macro}
803 % The end of \LaTeX 2e kernel macros.
804 % \begin{macrocode}
805 \fi
806 % \end{macrocode}
807 %
808 % \begin{macro}{\color@begingroup}
809 % \begin{macro}{\color@endgroup}
810 % \begin{macro}{\color@setgroup}
811 % \begin{macro}{\normalcolor}
812 % \begin{macro}{\color@hbox}
813 % \begin{macro}{\color@vbox}
814 % \begin{macro}{\color@endbox}
815 % These are normally no-ops (but are redefined by the \file{color} package).
816 % \begin{macrocode}
817 \let\color@begingroup\relax
818 \let\color@endgroup\relax
819 \let\color@setgroup\relax
820 \let\normalcolor\relax
821 \let\color@hbox\relax
822 \let\color@vbox\relax
823 \let\color@endbox\relax
824 % \end{macrocode}
825 % \end{macro}
826 % \end{macro}
827 % \end{macro}
828 % \end{macro}
829 % \end{macro}
830 % \end{macro}
831 % \end{macro}
832 %
833 % \begin{environment}{lrbox}
834 % A new 2e environment form of |\sbox|. (This is why the color stuff is
835 % needed.)
836 % \begin{macrocode}
837 \def\lrbox#1{%
838 \edef\reserved@a{%
839 \endgroup
840 \setbox#1\hbox{%
841 \begingroup\aftergroup}%
842 \def\noexpand\@currenvir{\@currenvir}%
843 \def\noexpand\@currenvline{\on@line}}%
844 \reserved@a
845 \@endpefalse
846 \color@setgroup
847 \ignorespaces}
848 \def\endlrbox{\unskip\color@endgroup}
849 % \end{macrocode}
850 % \end{environment}
851 %
852 % We are now basically back to the \file{graphics} package code.
853 %
854 % Some registers are needed to store some sizes and angles.
855 % Local registers are re-used (see the Graphics package documentation).
856 % \begin{macro}{\Grot@height}
857 % \begin{macro}{\Grot@depth}
858 % \begin{macro}{\Grot@right}
859 % \begin{macro}{\Grot@left}
860 % Final rotated box dimensions.
861 % \changes{v2}{1997/12/02}{Graphics updated to version v1.0d}
862 % \begin{macrocode}
863 \let\Grot@height\@ovxx
864 \let\Grot@depth\@ovdy
865 \let\Grot@right\@ovdx
866 \let\Grot@left\@ovyy
867 % \end{macrocode}
868 % \end{macro}
869 % \end{macro}
870 % \end{macro}
871 % \end{macro}
872 % \begin{macro}{\Grot@h}
873 % \begin{macro}{\Grot@d}
874 % \begin{macro}{\Grot@r}
875 % \begin{macro}{\Grot@l}
876 % The original box dimensions.
877 % \begin{macrocode}
878 \let\Grot@h\@xdim
879 \let\Grot@d\@ydim
880 \let\Grot@r\@ovri
881 \let\Grot@l\@ovro
882 % \end{macrocode}
883 % \end{macro}
884 % \end{macro}
885 % \end{macro}
886 % \end{macro}
887 % \begin{macro}{\Grot@x}
888 % \begin{macro}{\Grot@y}
889 % Coordinates of the centre of rotation.
890 % \begin{macrocode}
891 \let\Grot@x\@linelen
892 \let\Grot@y\@dashdim
893 % \end{macrocode}
894 % \end{macro}
895 % \end{macro}
896 %
897 % \begin{macro}{\rotatebox}
898 % The rotation angle is specified by parameter |#1| and the box to be
899 % rotated by |#2|. In the standard interface the center of rotation
900 % is $(0,0)$. Finally |\Grot@box| is called to rotate the box.
901 %
902 % |\rotatebox{|\meta{degrees}|}{|\meta{text}|}| rotates \meta{text}
903 % by \meta{degrees} anticlockwise. The rotation is about the left hand
904 % end of the baseline of \meta{text}.
905 % \changes{v2}{1997/12/02}{Added call to \cs{leavevmode}}
906 % \begin{macrocode}
907 \def\rotatebox#1#2{%
908 \leavevmode
909 \Grot@setangle{#1}%
910 \setbox\z@\hbox{{#2}}%
911 \Grot@x\z@
912 \Grot@y\z@
913 \Grot@box}
914 % \end{macrocode}
915 % \end{macro}
916 %
917 % \begin{macro}{\Grot@setangle}
918 % \begin{macro}{\Grot@angle}
919 % These set the internal macro |\Grot@angle| used by |\Grot@box|.
920 % |\Grot@setangle| is the `standard' definition from the \file{graphics}
921 % package.
922 % \begin{macrocode}
923 \def\Grot@setangle#1{\edef\Grot@angle{#1}}
924 % \end{macrocode}
925 % \end{macro}
926 % \end{macro}
927 %
928 % We need to know the size of the enclosing rectangle of a rotated box.
929 % Two macros are used for calculating coordinate positions. (See Graphics
930 % documentation for details.)
931 %
932 % \begin{macro}{\Grot@Px}
933 % Calculate the x coordinate of a point after rotation. The new x
934 % coordinate is parameter |#1| and the original point coordinates
935 % are parameters |#2| and |#3|.
936 % \begin{macrocode}
937 \def\Grot@Px#1#2#3{%
938 #1\Grot@cos#2%
939 \advance#1-\Grot@sin#3}
940 % \end{macrocode}
941 % \end{macro}
942 %
943 % \begin{macro}{\Grot@Py}
944 % Similarly for the y coordinate.
945 % \begin{macrocode}
946 \def\Grot@Py#1#2#3{%
947 #1\Grot@sin#2%
948 \advance#1\Grot@cos#3}
949 % \end{macrocode}
950 % \end{macro}
951 %
952 % \begin{macro}{\Grot@box}
953 % Rotates |\box0| through |\Grot@angle| degrees anticlockwise.
954 %
955 % For details, consult the Graphics documentation.
956 %
957 % \begin{macrocode}
958 \def\Grot@box{%
959 \begingroup
960 \CalculateSin\Grot@angle
961 \CalculateCos\Grot@angle
962 \edef\Grot@sin{\UseSin\Grot@angle}%
963 \edef\Grot@cos{\UseCos\Grot@angle}%
964 \Grot@r\wd\z@ \advance\Grot@r-\Grot@x
965 \Grot@l\z@ \advance\Grot@l-\Grot@x
966 \Grot@h\ht\z@ \advance\Grot@h-\Grot@y
967 \Grot@d-\dp\z@ \advance\Grot@d-\Grot@y
968 \ifdim\Grot@sin\p@>\z@
969 \ifdim\Grot@cos\p@>\z@
970 \Grot@Py\Grot@height \Grot@r\Grot@h
971 \Grot@Px\Grot@right \Grot@r\Grot@d
972 \Grot@Px\Grot@left \Grot@l\Grot@h
973 \Grot@Py\Grot@depth \Grot@l\Grot@d
974 \else
975 \Grot@Py\Grot@height \Grot@r\Grot@d
976 \Grot@Px\Grot@right \Grot@l\Grot@d
977 \Grot@Px\Grot@left \Grot@r\Grot@h
978 \Grot@Py\Grot@depth \Grot@l\Grot@h
979 \fi
980 \else
981 \ifdim\Grot@cos\p@<\z@
982 \Grot@Py\Grot@height \Grot@l\Grot@d
983 \Grot@Px\Grot@right \Grot@l\Grot@h
984 \Grot@Px\Grot@left \Grot@r\Grot@d
985 \Grot@Py\Grot@depth \Grot@r\Grot@h
986 \else
987 \Grot@Py\Grot@height \Grot@l\Grot@h
988 \Grot@Px\Grot@right \Grot@r\Grot@h
989 \Grot@Px\Grot@left \Grot@l\Grot@d
990 \Grot@Py\Grot@depth \Grot@r\Grot@d
991 \fi
992 \fi
993 \advance\Grot@height\Grot@y
994 \advance\Grot@depth\Grot@y
995 \Grot@Px\dimen@ \Grot@x\Grot@y
996 \Grot@Py\dimen@ii \Grot@x\Grot@y
997 \dimen@-\dimen@ \advance\dimen@-\Grot@left
998 \dimen@ii-\dimen@ii \advance\dimen@ii\Grot@y
999 \setbox\z@\hbox{%
1000 \kern\dimen@
1001 \raise\dimen@ii\hbox{\Grot@start\box\z@\Grot@end}}%
1002 \ht\z@\Grot@height
1003 \dp\z@-\Grot@depth
1004 \advance\Grot@right-\Grot@left\wd\z@\Grot@right
1005 \leavevmode\box\z@
1006 \endgroup}
1007 % \end{macrocode}
1008 % \end{macro}
1009 %
1010 % \begin{macrocode}
1011 %</rotne>
1012 % \end{macrocode}
1013 %
1014 % \subsection{The rotating code}
1015 %
1016 % Much of the code from here on is taken from the
1017 % \file{rotating.dtx}\footnote{Version v2.9, last revised 1995/04/07.}
1018 % package file by Leonor Barroca, but some is hacked for 2.09 users.
1019 % Extensions are made to accomodate the special requirements for ISO
1020 % typesetting.
1021 %
1022 % \subsubsection{Initial macros}
1023 %
1024 % Define some general helper macros.
1025 %
1026 % \begin{macro}{\if@rot@twoside}
1027 % A flag for one or two sided.
1028 % \begin{macrocode}
1029 \newif\if@rot@twoside
1030 % \end{macrocode}
1031 % \end{macro}
1032 %
1033 % \begin{macro}{\Grot@setnegangle}
1034 % \emph{Extension:} |\Grot@setnegangle| sets |\Grot@angle| to be the
1035 % negative of its input
1036 % parameter. We use this for changing rotation direction.
1037 % \begin{macrocode}
1038 \def\Grot@setnegangle#1{%
1039 \dimen@#1\p@
1040 \dimen@-\dimen@
1041 \edef\Grot@angle{\strip@pt\dimen@}}
1042 % \end{macrocode}
1043 % \end{macro}
1044 %
1045 % \begin{macro}{\ifcl@ckwise}
1046 % \begin{macro}{\figuresleft}
1047 % \begin{macro}{\figuresright}
1048 % \begin{macro}{\clockwise}
1049 % \begin{macro}{\counterclockwise}
1050 % \emph{Extension:} The \file{rotating} package has some options.
1051 % Our packages instead define some additional
1052 % macros to enable these to be expressed as commands.
1053 %
1054 % A flag for the desired rotational direction.
1055 % \begin{macrocode}
1056 \newif\ifcl@ckwise
1057 % \end{macrocode}
1058 % The extension commands:
1059 % \begin{macrocode}
1060 \newcommand{\figuresleft}{%
1061 \@rot@twosidefalse
1062 \def\rot@LR{0}%
1063 }
1064 \newcommand{\figuresright}{%
1065 \@rot@twosidefalse
1066 \def\rot@LR{-1}%
1067 }
1068 \newcommand{\clockwise}{%
1069 \cl@ckwisetrue
1070 }
1071 \newcommand{\counterclockwise}{%
1072 \cl@ckwisefalse
1073 }
1074 % \end{macrocode}
1075 % \end{macro}
1076 % \end{macro}
1077 % \end{macro}
1078 % \end{macro}
1079 % \end{macro}
1080 %
1081 % \begin{macro}{\r@protected@write}
1082 % \begin{macro}{\therpage}
1083 % \begin{macro}{\rot@label}
1084 %
1085 % The \file{rotating} package used to use the |\label| command. It now
1086 % uses a special |\rot@label| version. This variant writes the \emph{true}
1087 % page number, not the value of |\thepage|. It also involves a variant
1088 % |\protected@write|\footnote{The original author states `\ldots for reasons
1089 % which I do not fully understand.'}.
1090 %
1091 % \changes{v2}{1997/12/03}{Added \cs{r@protected@write}, \cs{therpage} and \cs{rot@label}}
1092 % \begin{macrocode}
1093 \long\def\r@protected@write#1#2#3{%
1094 \begingroup
1095 \let\therpage\relax
1096 #2%
1097 \let\protect\@unexpandable@protect
1098 \edef\reserved@a{\write#1{#3}}%
1099 \reserved@a
1100 \endgroup
1101 \if@nobreak\ifvmode\nobreak\fi\fi
1102 }
1103 \def\therpage{\arabic{page}}
1104 \def\rot@label#1{\@bsphack
1105 \r@protected@write\@auxout{}%
1106 {\string\newlabel{#1}{{\@currentlabel}{\therpage}}}%
1107 \@esphack}
1108 % \end{macrocode}
1109 % \end{macro}
1110 % \end{macro}
1111 % \end{macro}
1112 %
1113 % \begin{macro}{\r@tfl@t}
1114 % A counter for use later in matching rotations to page numbers.
1115 % \changes{v2}{1997/12/02}{Changed \cs{r@tfl@t} to a \cs{newcounter}}
1116 % \begin{macrocode}
1117 \newcounter{r@tfl@t}
1118 \setcounter{r@tfl@t}{0}
1119 % \end{macrocode}
1120 % \end{macro}
1121 %
1122 % Sideways floats take up the whole page. They can be rotated so that
1123 % the bottom of the float is on the left or the right; the default
1124 % is to always turn to the right. If the main document uses the
1125 % \Lopt{twoside} option then the floats are rotated according to the
1126 % page number (requiring at least two passes through \LaTeX). The
1127 % \Lopt{figuresleft} and \Lopt{figuresright} `options' will ensure
1128 % a constant rotation direction when \Lopt{twoside} is in effect.
1129 %
1130 % \begin{macrocode}
1131 \if@twoside
1132 \@rot@twosidetrue
1133 \else
1134 \@rot@twosidefalse
1135 \fi
1136 % \end{macrocode}
1137 %
1138 % \begin{macro}{\rotatedirection}
1139 % For setting rotation direction for positive angle. The |\rotatedirection|
1140 % command is provided for backwards compatibility.
1141 % \begin{macrocode}
1142 \newcommand{\rotatedirection}[1]{%
1143 \def\@tempa{#1}\def\@tempb{clockwise}%
1144 \ifx\@temp\@tempb
1145 \cl@ckwisetrue
1146 \else
1147 \cl@ckwisefalse
1148 \fi}
1149 % \end{macrocode}
1150 % \end{macro}
1151 %
1152 % Set default to be \Lopt{clockwise} rotation for positive angles,
1153 % and \Lopt{figuresright} to make all bottoms of sideways floats
1154 % to be at the righthand edge of the paper.
1155 % \begin{macrocode}
1156 \clockwise
1157 \figuresright
1158 % \end{macrocode}
1159 %
1160 % \subsubsection{Turn and rotation environments}
1161 %
1162 % These are general rotational environments.
1163 %
1164 % \begin{environment}{sideways}
1165 % The \Lenv{sideways} environment rotates its contents through the fixed
1166 % angle of 90 degrees counterclockwise.
1167 % \begin{macrocode}
1168 \def\sideways{%
1169 \Grot@setangle{90}%
1170 \setbox\z@\hbox\bgroup\ignorespaces}
1171 \def\endsideways{%
1172 \unskip\egroup
1173 \Grot@x\z@
1174 \Grot@y\z@
1175 \Grot@box
1176 }
1177 % \end{macrocode}
1178 % \end{environment}
1179 %
1180 % \begin{environment}{turn}
1181 % The \Lenv{turn} environment rotates its contents through the given
1182 % angle, leaving the appropriate space.
1183 %
1184 % \emph{Extension:} We take account of the specified rotational direction.
1185 % \begin{macrocode}
1186 \def\turn#1{%
1187 \ifcl@ckwise
1188 \Grot@setnegangle{#1}
1189 \else
1190 \Grot@setangle{#1}
1191 \fi
1192 \setbox\z@\hbox\bgroup\ignorespaces}
1193 \def\endturn{%
1194 \unskip\egroup
1195 \Grot@x\z@
1196 \Grot@y\z@
1197 \Grot@box
1198 }
1199 % \end{macrocode}
1200 % \end{environment}
1201 %
1202 % \begin{environment}{rotate}
1203 % The \Lenv{rotate} environment rotates its contents through the given
1204 % angle, leaving no space.
1205 %
1206 % \emph{Extension:} We take account of the specified rotational direction.
1207 % \begin{macrocode}
1208 \def\rotate#1{%
1209 \ifcl@ckwise
1210 \Grot@setnegangle{#1}
1211 \else
1212 \Grot@setangle{#1}
1213 \fi
1214 \setbox\z@\hbox\bgroup\ignorespaces}
1215 \def\endrotate{%
1216 \unskip\egroup
1217 \Grot@x\z@
1218 \Grot@y\z@
1219 \wd0\z@\dp0\z@\ht0\z@
1220 \Grot@box
1221 }
1222 % \end{macrocode}
1223 % \end{environment}
1224 %
1225 % \begin{macro}{\turnbox}
1226 % A macro version of the \Lenv{rotate} environment.
1227 %
1228 % |\turnbox{|\meta{degrees}|}{|\meta{text}|}|
1229 % \begin{macrocode}
1230 \def\turnbox#1#2{%
1231 \ifcl@ckwise
1232 \Grot@setnegangle{#1}
1233 \else
1234 \Grot@setangle{#1}
1235 \fi
1236 \setbox\z@\hbox{{#2}}%
1237 \Grot@x\z@
1238 \Grot@y\z@
1239 \wd0\z@\dp0\z@\ht0\z@
1240 \Grot@box
1241 }
1242 % \end{macrocode}
1243 % \end{macro}
1244 %
1245 % \subsubsection{Sideways figures and tables}
1246 %
1247 % Rotation of floats through a fixed angle of 90 degrees.
1248 %
1249 % First, a generalized |rotfloat| environment.
1250 % \begin{macro}{\rot@float@box}
1251 % \begin{macro}{\@rotfloat}
1252 % \begin{macro}{\@xrotfloat}
1253 % \begin{macrocode}
1254 \newsavebox\rot@float@box
1255 \def\@rotfloat#1{%
1256 \@ifnextchar[%
1257 {\@xrotfloat{#1}}%
1258 {\edef\@tempa{\noexpand\@xrotfloat{#1}[\csname fps@#1\endcsname]}\@tempa}%
1259 }
1260 \def\@xrotfloat#1[#2]{%
1261 \@float{#1}[#2]%
1262 % \end{macrocode}
1263 % Set the float contents in a box of |\textheight| instead of
1264 % |\columnwidth|.
1265 % \begin{macrocode}
1266 \begin{lrbox}\rot@float@box
1267 \begin{minipage}\textheight
1268 }
1269 % \end{macrocode}
1270 % \end{macro}
1271 % \end{macro}
1272 % \end{macro}
1273 %
1274 % \begin{macro}{\end@rotfloat}
1275 %
1276 % We call |\end@float| having previously rotated the box |\@currbox|.
1277 % The rotation is either clockwise or counterclockwise, depending on
1278 % whether the page is odd or even. In |oneside| mode it is always odd.
1279 % See the \file{rotating} package documentation for further details.
1280 %
1281 % \emph{Extension:} Generalised the output messages.
1282 % \changes{v2}{1997/12/02}{Using \cs{rot@label} instead of \cs{label}}
1283 % \begin{macrocode}
1284 \def\end@rotfloat{%
1285 \end{minipage}\end{lrbox}%
1286 \global\addtocounter{r@tfl@t}{1}%
1287 \rot@label{RF\ther@tfl@t}%
1288 \def\R@@page{\pageref{RF\ther@fl@t}}%
1289 \wd\rot@float@box\z@
1290 \ht\rot@float@box\z@
1291 \dp\rot@float@box\z@
1292 \vbox to \textheight{%
1293 \if@rot@twoside
1294 \def\R@@page{\pageref{RF\ther@tfl@t}}%
1295 \else
1296 \let\R@@page\rot@LR
1297 \fi
1298 \ifodd\R@@page
1299 \PWRF@trace\tw@{Adding sideways float on right hand page}%
1300 \vfill
1301 \centerline{\rotatebox{90}{\box\rot@float@box}}%
1302 \else
1303 \PWRF@trace\tw@{Adding sideways float on left hand page}%
1304 \centerline{\rotatebox{-90}{\box\rot@float@box}}%
1305 \vfill
1306 \fi
1307 }%
1308 \end@float
1309 }
1310 % \end{macrocode}
1311 % \end{macro}
1312 %
1313 % \begin{macro}{\@rotdblfloat}
1314 % \begin{macro}{\@rotdblflt}
1315 % \begin{macro}{\@rotxdblfloat}
1316 % General macros for double column floats.
1317 % \changes{v2}{1997/12/03}{Added code for double column floats}
1318 % \begin{macrocode}
1319 \def\@rotdblfloat{%
1320 \if@twocolumn\let\reserved@a\@rotdblflt\else\let\reserved@a\@rotfloat\fi
1321 \reserved@a}
1322 \def\@rotdblflt#1{\@ifnextchar[{\@rotxdblfloat{#1}}{\@rotxdblfloat{#1}[tp]}}
1323 \def\@rotxdblfloat#1[#2]{%
1324 \hsize\textwidth\linewidth\textwidth
1325 \@float{#1}[#2]%
1326 \begin{lrbox}\rot@float@box
1327 \begin{minipage}\textheight
1328 }
1329 \def\end@rotdblfloat{%
1330 \end{minipage}\end{lrbox}%
1331 \global\addtocounter{r@tfl@t}{1}%
1332 \rot@label{RF\ther@tfl@t}%
1333 \def\R@@page{\pageref{RF\ther@tfl@t}}%
1334 \@tempdima\ht\rot@float@box
1335 \advance\@tempdima by \dp\rot@float@box
1336 \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}%
1337 \wd\rot@float@box\z@
1338 \ht\rot@float@box\z@
1339 \dp\rot@float@box\z@
1340 \vbox to \textheight{%
1341 \if@rot@twoside
1342 \def\R@@page{\pageref{RF\ther@tfl@t}}%
1343 \else
1344 \let\R@@page\rot@LR
1345 \fi
1346 \ifodd\R@@page
1347 \PWRF@trace\tw@{Adding sideways float on right hand page}%
1348 \vfill
1349 \hbox to \textwidth{\hfill\rotatebox{90}{\box\rot@float@box}\hfill}%
1350 \else
1351 \PWRF@trace\tw@{Adding sideways float on left hand page}%
1352 \hbox to \textwidth{\hfill\rotatebox{-90}{\box\rot@float@box}\hfill}%
1353 \vfill
1354 \fi
1355 }
1356 \end@dblfloat
1357 }
1358 % \end{macrocode}
1359 % \end{macro}
1360 % \end{macro}
1361 % \end{macro}
1362 %
1363 %
1364 % \begin{macro}{\@initisofig}
1365 % \begin{macro}{\@initisotab}
1366 % \begin{macro}{\rotcapfont}
1367 % \emph{Extension:} The following definitions implement some of
1368 % the ISO-specific stuff. They basically provide for the setting up of
1369 % the \file{lof} and \file{lot} files. |\rotcapfont| is the font for
1370 % typesetting any captions. For ISO it is bold and may be larger than normal.
1371 %
1372 % \changes{v2}{1997/12/03}{Added \cs{PWRF@initfig} and \cs{PWRF@inittab}}
1373 % \changes{v2.1}{2000/02/15}{Added check for iso class}
1374 % \changes{v2.1}{2000/02/15}{Used \cs{@initisofig} instead of
1375 % \cs{PWRF@initfig} and same for tables}
1376 % \begin{macrocode}
1377 \@ifundefined{@initisofig}{%
1378 \newcommand{\@initisofig}{}
1379 \newcommand{\@initisotab}{}
1380 \newif\ifinfloat
1381 \newcommand{\rotcapfont}{}}{\newcommand{\rotcapfont}{\captionsize\bf}}
1382 % \end{macrocode}
1383 % \end{macro}
1384 % \end{macro}
1385 % \end{macro}
1386 %
1387 % \begin{environment}{sidewaysfigure}
1388 % Use |\def| instead of |\...environment| in order to be OK for both
1389 % redefining the \file{rotating} environment and creating a new 2.09
1390 % environment.
1391 % \begin{macrocode}
1392 \def\sidewaysfigure{%
1393 \@initisofig
1394 \@rotfloat{figure}}
1395 \def\endsidewaysfigure{\end@rotfloat\infloatfalse}
1396 % \end{macrocode}
1397 % \end{environment}
1398 %
1399 % \begin{environment}{sidewaystable}
1400 % The \Lenv{sidewaystable} environment is similar.
1401 % It also requires redefinition to take account of the ISO peculiarities.
1402 % \begin{macrocode}
1403 \def\sidewaystable{%
1404 \@initisotab
1405 \@rotfloat{table}}
1406 \def\endsidewaystable{\end@rotfloat\infloatfalse}
1407 % \end{macrocode}
1408 % \end{environment}
1409 %
1410 % \begin{environment}{sidewaysfigure*}
1411 % \begin{environment}{sidewaystable*}
1412 % These are for rotations in a two column setting. The definitions
1413 % are similar to the previous ones for single column.
1414 % \changes{v2}{1997/12/03}{Added sidewaysfigure and sidewaystable for double columns}
1415 % \begin{macrocode}
1416 \newenvironment{sidewaysfigure*}{%
1417 \@initisofig
1418 \@rotdblfloat{figure}}{%
1419 \end@rotdblfloat\infloatfalse}
1420 \newenvironment{sidewaystable*}{%
1421 \@initisotab
1422 \@rotdblfloat{table}}{%
1423 \end@rotdblfloat\infloatfalse}
1424 % \end{macrocode}
1425 % \end{environment}
1426 % \end{environment}
1427 %
1428 % \subsubsection{Rotated captions}
1429 %
1430 % \begin{macro}{\rotcaption}
1431 % \begin{macro}{\@rotcaption}
1432 % This inserts a caption rotated through 90 degrees. The code, which is
1433 % essentially a copy of the normal |\caption| code, is defined
1434 % in the \file{rotation} package.
1435 % \begin{macrocode}
1436 \def\rotcaption{\refstepcounter\@captype\@dblarg{\@rotcaption\@captype}}
1437 \long\def\@rotcaption#1[#2]#3{%
1438 \addcontentsline{\csname ext@#1\endcsname}{#1}{%
1439 \protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}%
1440 \par
1441 \begingroup
1442 \@parboxrestore
1443 \normalsize
1444 \@makerotcaption{\csname fnum@#1\endcsname}{#3}%
1445 \endgroup}
1446 % \end{macrocode}
1447 % \end{macro}
1448 % \end{macro}
1449 %
1450 % \begin{macro}{\@makerotcaption}
1451 % The workhorse for rotated captions.
1452 % \begin{macrocode}
1453 \long\def\@makerotcaption#1#2{%
1454 \hspace{\abovecaptionskip}
1455 \setbox\@tempboxa\hbox{{\rotcapfont #1 -- #2}}%
1456 \ifdim \wd\@tempboxa > .8\vsize
1457 \rotatebox{90}{%
1458 \begin{minipage}{.8\textheight}{\centering{\rotcapfont #1 -- #2}\par}\end{minipage}%
1459 }\par
1460 \else%
1461 \rotatebox{90}{\box\@tempboxa}%
1462 \fi
1463 \hspace{\belowcaptionskip}
1464 }
1465 % \end{macrocode}
1466 % \end{macro}
1467 %
1468 % \begin{macro}{\controtcaption}
1469 % A rotated continuation caption.
1470 % \begin{macrocode}
1471 \newcommand{\controtcaption}{\@controtcaption\@captype}
1472 % \end{macrocode}
1473 % \end{macro}
1474 %
1475 % \begin{macro}{\@controtcaption}
1476 % The worker for a rotated continuation caption.
1477 % \begin{macrocode}
1478 \long\def\@controtcaption#1#2{%
1479 \begingroup
1480 \@parboxrestore
1481 \normalsize
1482 \@makerotcaption{\csname fnum@#1\endcsname}{\ignorespaces #2}\par
1483 \endgroup}
1484 % \end{macrocode}
1485 % \end{macro}
1486 %
1487 % The end of the package code.
1488 % \begin{macrocode}
1489 %</rot|rotne>
1490 % \end{macrocode}
1491 %
1492 %
1493 %
1494 % \bibliographystyle{alpha}
1495 %
1496 % \begin{thebibliography}{GMS94}
1497 %
1498 % \bibitem[GMS94]{GOOSSENS94}
1499 % Michel Goossens, Frank Mittelbach, and Alexander Samarin.
1500 % \newblock {\em The LaTeX Companion}.
1501 % \newblock Addison-Wesley Publishing Company, 1994.
1502 %
1503 % \bibitem[ISO97]{ISOD397}
1504 % {\em {ISO/IEC Directives Part 3 --- Drafting and presentation of International
1505 % Standards}}, third edition, 1997.
1506 %
1507 % \bibitem[Wil96]{PRW96i}
1508 % Peter~R. Wilson.
1509 % \newblock {\em {LaTeX for standards: The LaTeX package files user manual}}.
1510 % \newblock NIST Report NISTIR, June 1996.
1511 %
1512 % \end{thebibliography}
1513 %
1514 %
1515 % \Finale
1516 % \PrintIndex
1517 %
1518 \endinput
1519
1520 %% \CharacterTable
1521 %% {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
1522 %% 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
1523 %% Digits \0\1\2\3\4\5\6\7\8\9
1524 %% Exclamation \! Double quote \" Hash (number) \#
1525 %% Dollar \$ Percent \% Ampersand \&
1526 %% Acute accent \' Left paren \( Right paren \)
1527 %% Asterisk \* Plus \+ Comma \,
1528 %% Minus \- Point \. Solidus \/
1529 %% Colon \: Semicolon \; Less than \<
1530 %% Equals \= Greater than \> Question mark \?
1531 %% Commercial at \@ Left bracket \[ Backslash \\
1532 %% Right bracket \] Circumflex \^ Underscore \_
1533 %% Grave accent \` Left brace \{ Vertical bar \|
1534 %% Right brace \} Tilde \~}
1535
1536