| 1 |
%% BEGIN sem-rot.sty |
| 2 |
\def\fileversion{1.0} |
| 3 |
\def\filedate{93/04/01} |
| 4 |
%% |
| 5 |
%% LaTeX style option `semrot.sty'. |
| 6 |
%% For use with LaTeX v2.09 and the `seminar' document style. |
| 7 |
%% |
| 8 |
%% COPYRIGHT 1993, by Timothy Van Zandt, [email protected] |
| 9 |
%% |
| 10 |
%% This file may be distributed and/or modified under the conditions of |
| 11 |
%% the LaTeX Project Public License, either version 1.2 of this license |
| 12 |
%% or (at your option) any later version. The latest version of this |
| 13 |
%% license is in: |
| 14 |
%% |
| 15 |
%% http://www.latex-project.org/lppl.txt |
| 16 |
%% |
| 17 |
%% and version 1.2 or later is part of all distributions of LaTeX version |
| 18 |
%% 1999/12/01 or later. |
| 19 |
%% |
| 20 |
%% |
| 21 |
%% The following is just an interface for seminar.sty: |
| 22 |
\def\leftsliderotation#1{\@rotate[l]{#1}} |
| 23 |
\def\rightsliderotation#1{\@rotate[r]{#1}} |
| 24 |
\sliderotation{left} |
| 25 |
%% |
| 26 |
%% And the rest is rotate.sty, as distributed with Rokicki's dvips. |
| 27 |
%% |
| 28 |
% These macros allow you to rotate or flip a \TeX\ box. Very useful for |
| 29 |
% sideways tables or upsidedown answers. |
| 30 |
% |
| 31 |
% To use, create a box containing the information you want to rotate. |
| 32 |
% (An hbox or vbox will do.) Now call \@rotr\boxnum to rotate the |
| 33 |
% material and create a new box with the appropriate (flipped) dimensions. |
| 34 |
% \@rotr rotates right, \@rotl rotates left, \@rotu turns upside down, and |
| 35 |
% \@rotf flips. These boxes may contain other rotated boxes. |
| 36 |
% |
| 37 |
\newdimen\@rotdimen |
| 38 |
\newbox\@rotbox |
| 39 |
|
| 40 |
\def\@vspec#1{\special{ps:#1}}% passes #1 verbatim to the output |
| 41 |
\def\@rotstart#1{\@vspec{gsave currentpoint currentpoint translate |
| 42 |
#1 neg exch neg exch translate}}% #1 can be any origin-fixing transformation |
| 43 |
\def\@rotfinish{\@vspec{currentpoint grestore moveto}}% gets back in synch |
| 44 |
% |
| 45 |
% First, the rotation right. The reference point of the rotated box |
| 46 |
% is the lower right corner of the original box. |
| 47 |
% |
| 48 |
\def\@rotr#1{\@rotdimen=\ht#1\advance\@rotdimen by\dp#1% |
| 49 |
\hbox to\@rotdimen{\hskip\ht#1\vbox to\wd#1{\@rotstart{90 rotate}% |
| 50 |
\box#1\vss}\hss}\@rotfinish} |
| 51 |
% |
| 52 |
% Next, the rotation left. The reference point of the rotated box |
| 53 |
% is the upper left corner of the original box. |
| 54 |
% |
| 55 |
\def\@rotl#1{\@rotdimen=\ht#1\advance\@rotdimen by\dp#1% |
| 56 |
\hbox to\@rotdimen{\vbox to\wd#1{\vskip\wd#1\@rotstart{270 rotate}% |
| 57 |
\box#1\vss}\hss}\@rotfinish}% |
| 58 |
% |
| 59 |
% Upside down is simple. The reference point of the rotated box |
| 60 |
% is the upper right corner of the original box. (The box's height |
| 61 |
% should be the current font's xheight, \fontdimen5\font, |
| 62 |
% if you want that xheight to be at the baseline after rotation.) |
| 63 |
% |
| 64 |
\def\@rotu#1{\@rotdimen=\ht#1\advance\@rotdimen by\dp#1% |
| 65 |
\hbox to\wd#1{\hskip\wd#1\vbox to\@rotdimen{\vskip\@rotdimen |
| 66 |
\@rotstart{-1 dup scale}\box#1\vss}\hss}\@rotfinish}% |
| 67 |
% |
| 68 |
% And flipped end for end is pretty ysae too. We retain the baseline. |
| 69 |
% |
| 70 |
\def\@rotf#1{\hbox to\wd#1{\hskip\wd#1\@rotstart{-1 1 scale}% |
| 71 |
\box#1\hss}\@rotfinish}% |
| 72 |
% |
| 73 |
% Now the user interface for LaTeX: \rotate[type]{text} where |
| 74 |
% ``type'' is `l' for left, `r' for right, `u' for upside-down, or |
| 75 |
% `f' for flip. `l' is the default. |
| 76 |
% |
| 77 |
\def\rotate{\@ifnextchar[{\@rotate}{\@rotate[l]}} |
| 78 |
\def\@rotate[#1]#2{\setbox\@rotbox=\hbox{#2}\@nameuse{@rot#1}\@rotbox} |
| 79 |
\endinput |
| 80 |
%% END sem-rot.sty |