[comp.text.tex] Problems with sideways tables in LaTeX

marty@puppsr.Princeton.EDU (Marty Ryba) (03/24/91)

I've been trying to define a new environment that uses the macros in
rotate.tex (is rotate.sty different??? I haven't seen it) to make a
table sideways.  It seems straightforward, but I can't seem to be able
to define or find the box around the table in order to rotate it.
I've tried (in the environment definition) stuff like:

{\begin{table}#1   %starts table environment}
{\rotl\@currbox \end{table}}

and 

{\begin{table}#1  \global\setbox\rotbox\vbox\bgroup
\hsize\textheight}%        Make my own box inside the table float
{\par\vskip\z@\egroup \rotl\rotbox \end{table}}

but the latter gives me a "control \global not permitted between \csname
\endcsname" error.  I'm at the end of my (limited) rope.  Any ideas???

-- 
Marty Ryba                      | slave physics grad student
Princeton University            | They don't care if I exist,
Pulsars   Unlimited             | let alone what my opinions are!
marty@pulsar.princeton.edu      | Asbestos gloves always on when reading mail

marty@puppsr.Princeton.EDU (Marty Ryba) (03/24/91)

In article <7473@idunno.Princeton.EDU>, marty@puppsr.Princeton.EDU (Marty Ryba) writes:
> I've been trying to define a new environment that uses the macros in
> rotate.tex (is rotate.sty different??? I haven't seen it) to make a
> table sideways.  It seems straightforward, but I can't seem to be able
> to define or find the box around the table in order to rotate it.
> I've tried (in the environment definition) stuff like:

Of course, soon after I punted, I figured it out....here's a segment
of my .sty file that creates the "sidetable" environment.

\input{rotate}\newbox\rotbox
\newenvironment{sidetable}{\begin{table}[t]
\global\setbox\rotbox\vbox\bgroup
\hsize\textheight \@parboxrestore}%
{\par\vskip\z@\egroup \rotl\rotbox \end{table}}

You use sidetable just as you would the table environment except you cannot
give it a position argument - but why would you want to for a table that
has to go sideways just to fit on the page???

-- 
Marty Ryba                      | slave physics grad student
Princeton University            | They don't care if I exist,
Pulsars   Unlimited             | let alone what my opinions are!
marty@pulsar.princeton.edu      | Asbestos gloves always on when reading mail

jdolter@eecs.umich.edu (James W. Dolter) (03/25/91)

>>>>> Regarding Problems with sideways tables in LaTeX; marty@puppsr.Princeton.EDU (Marty Ryba) adds:

marty> I've been trying to define a new environment that uses the macros in
marty> rotate.tex (is rotate.sty different??? I haven't seen it) to make a
marty> table sideways.  It seems straightforward, but I can't seem to be able
marty> to define or find the box around the table in order to rotate it.
marty> I've tried (in the environment definition) stuff like:

marty> [stuff deleted]{\begin{table}#1   %starts table environment}

What I have ended up doing lately for rotated figures and rotated tables
is below.


It defines to environments rotatedfigure and rotatedtable that
fit along with the regular table and figure floats.  Most of the
rotated float stuff is modified right out of latex.tex.

I just add this stuff to rotate.sty that is distributed with 
Tomas Rokickis' dvips fro labrea.stanford.edu.

It's not the cleanest but the format check deadline was getting very close.

\def\@rotatedfloat#1{\@ifnextchar[{\@rotatedxfloat{#1}}{\edef\@tempa{\noexpand\@rotatedxfloat
    {#1}[\csname fps@#1\endcsname]}\@tempa}}

\def\@rotatedxfloat#1[#2]{\ifhmode \@bsphack\@floatpenalty -\@Mii\else
   \@floatpenalty-\@Miii\fi\def\@captype{#1}\ifinner
      \@parmoderr\@floatpenalty\z@
    \else\@next\@currbox\@freelist{\@tempcnta\csname ftype@#1\endcsname
       \multiply\@tempcnta\@xxxii\advance\@tempcnta\sixt@@n
       \@tfor \@tempa :=#2\do
                        {\if\@tempa h\advance\@tempcnta \@ne\fi
                         \if\@tempa t\advance\@tempcnta \tw@\fi
                         \if\@tempa b\advance\@tempcnta 4\relax\fi
                         \if\@tempa p\advance\@tempcnta 8\relax\fi
         }\global\count\@currbox\@tempcnta}\@fltovf\fi
    \global\setbox\@currbox\vbox\bgroup 
%    \boxmaxdepth\z@     % commented out 15 Dec 87
    \hsize\textheight \@parboxrestore
	\setbox\@rotbox=\vbox\bgroup}

\def\l@rotatedfigure{\@dottedtocline{1}{\l@listindent@}{2.3em}}

\let\c@rotatedfigure\c@figure
\let\p@rotatedfigure\p@figure
\let\therotatedfigure\thefigure
\def\fps@rotatedfigure{tbp}
\def\ftype@rotatedfigure{1}
\def\ext@rotatedfigure{lof}
\def\fnum@rotatedfigure{Figure \thefigure}
\def\rotatedfigure{\@rotatedfloat{rotatedfigure}}
\let\endrotatedfigure\end@float

\let\l@rotatedtable\l@rotatedfigure
\let\c@rotatedtable\c@table
\let\p@rotatedtable\p@table
\let\therotatedtable\thetable
\def\fps@rotatedtable{tbp}
\def\ftype@rotatedtable{2}
\def\ext@rotatedtable{lot}
\def\fnum@rotatedtable{Table \thetable}
\def\rotatedtable{\@rotatedfloat{rotatedtable}}
\let\endrotatedtable\end@float

--
+--------------------------------------------+--------------------------------+
| James W. Dolter                            | Real-Time Computing Laboratory |
| Internet: jdolter@sawtooth.eecs.umich.edu  | The University of Michigan     |
| UUCP:     umich!umeecs!jdolter             | 1301 Beal Ave                  |
| Office:   2222 EECS                        | Ann Arbor, MI 48109-2122       |
| Voice:    (313) 763-5363                   |                                |
+--------------------------------------------+--------------------------------+