[comp.text] Rotated tables in TeX documents

morrow@murdu.oz (Christopher Morrow) (09/08/89)

Often wide tables in books (tabulations of biological data for
example) are set in landscape mode.  Often the page number is in the
normal postion.  I doubt if this is possible with standard LaTeX but
if any one can suggest how to do this I would appreciate it.  Failing
that could I please add this to a TeX wish list.

OzTeX provides a facility to print in landscape mode but all pages of
the document would be thus printed.  Indeed the ability to rotate text
does not seem to be present in LaTeX.

Thanks for reading
Chris Morrow
morrow@murdu.oz.au

mikew@wheeler.wrcr.unr.edu (Mike Whitbeck) (09/08/89)

In article <1697@murdu.oz> morrow@murdu.oz (Christopher Morrow) writes:
|Often wide tables in books (tabulations of biological data for
|example) are set in landscape mode.  Often the page number is in the
|normal postion.  I doubt if this is possible with standard LaTeX but
|if any one can suggest how to do this I would appreciate it.  Failing
|that could I please add this to a TeX wish list.
|
|OzTeX provides a facility to print in landscape mode but all pages of
|the document would be thus printed.  Indeed the ability to rotate text
|does not seem to be present in LaTeX.
|
|Thanks for reading
|Chris Morrow
|morrow@murdu.oz.au

Would be really useful! When I have one or a few wide tables
that need to go into landscape I use a separate latex file for
each. I have a wide.sty that helps set things up and macros that
ask for the page number and Table number. I have to process the
main latex files to find what these should be (just like in
troff :-}  ). In the main files where a landscaped table is
needed I put it on a separate page so I get a numbered page and
table number-- next run the wide tables off then use them to
replace the blank pages in the main document! The imagen print
driver can print pages rotated into landscape mode.

Hmmm, can postscript rotate a chunk of output in the middle of a
file? If so then using a PS device maybe one could ...?
Something to ponder!

chris@mimsy.UUCP (Chris Torek) (09/08/89)

>In article <1697@murdu.oz> morrow@murdu.oz (Christopher Morrow) writes:
>|Often wide tables in books (tabulations of biological data for
>|example) are set in landscape mode.  Often the page number is in the
>|normal postion.  I doubt if this is possible with standard LaTeX ....

Indeed, it is not, unless you build rotated versions of the fonts and
write some very hairy table macros.

It is, however, possible to cheat.

In article <2952@tahoe.unr.edu> mikew@wheeler.wrc.unr.edu (Mike Whitbeck)
writes:
>... In the main files where a landscaped table is needed I put it on
>a separate page so I get a numbered page and table number-- next run
>the wide tables off then use them to replace the blank pages in the
>main document!

If you want the page number to appear at the bottom (normal mode, rather
than landscaped), you have to use scissors and paste.  Not a nice
situation.  There has, however, been some talk of standard DVI \special
escapes, and single-page landscape mode is one possible standard, so
one could get a table set properly, except that the page number would
be on the side instead of at the bottom.  In some cases this is not a
problem (e.g., submissions to journals, where all the pages will be
renumbered manually for the final printing).

>The imagen print driver can print pages rotated into landscape mode.

Except that, like most drivers, it applies this globally.  (The Imagen
makes it a bit harder than some other devices to apply it per page.)

>Hmmm, can postscript rotate a chunk of output in the middle of a
>file?

Yes.

If you have a PostScript printer, and a DVI-to-PS driver that allows
\specials, and if you are willing to do horrible things to your TeX
or LaTeX source to make the `right thing' happen, you can embed a
\special that rotates and translates the TeX coordinate system.  For
instance:

	\begin{table}
	% the name SaveSpecial below varies with the implementation
	\special{SaveSpecial restore % now we are `out of' the special
	  -90 rotate	% rotate the TeX coordinate system. (0,0) is to
			% be at upper left corner, so now we need to
			% translate by (-pageheight,0):
	  -11 Resolution mul 0 translate
	  /SaveSpecial save def % make the next restore work right
	}
	\begin{tabular}...\end{tabular}
	% Undo the rotation by reversing the rotate sequence
	\special{SaveSpecial restore 90 rotate /SaveSpecial save def}
	\end{table}

The above is not tested.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris

morrison@grads.cs.ubc.ca (Rick Morrison) (09/09/89)

I wanted this capability and eventually resorted to modifying the page output
macro defined in latex.tex. I haven't had the perseverance to hack
tabulars, but if you are satisfied with landscape tabbing (starting on a
new page) you are welcome to what I have. It relies on a locally
hacked version of dvi2ps to overlay pages (you need this to get headers and
page numbers oriented in portrait and the body of the page oriented in
landscape). I have also found it convenient to use my own versions of article,
report and book in order to define both landscape and portrait page
layouts in the same document style (yes I named the somthing else).
It isn't pretty but it works.

BTW, the problem with landscape tabulars
is that they float. Since this technique uses \specials to invoke
landscape and overlay in the postscript printer you _must_ know when
the tabular is going to be emmited.
--------------------------------
Rick Morrison		 | {alberta,uw-beaver,uunet}!ubc-cs!morrison
Dept. of Computer Science| morrison@cs.ubc.ca
Univ. of British Columbia| morrison%ubc.csnet@csnet-relay.arpa
Vancouver, B.C. V6T 1W5  | morrison@ubc.csnet (ubc-csgrads=128.189.97.20)
(604) 228-4327

edgar@gem.mps.ohio-state.edu (Gerald Edgar) (09/09/89)

In article <19480@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes:
>
>If you want the page number to appear at the bottom (normal mode, rather
>than landscaped), you have to use scissors and paste.

I have been known to run the same piece of paper through the LaserWriter
twice.  Also to photocopy onto the LaserWriter output.  Both of
these seem better than scissors and paste??

-- 
  Gerald A. Edgar          
  Department of Mathematics             Bitnet:    EDGAR@OHSTPY
  The Ohio State University             Internet:  edgar@mps.ohio-state.edu
  Columbus, OH 43210   ...!{att,pyramid}!osu-cis!shape.mps.ohio-state.edu!edgar

jbw@unix.cis.pitt.edu (Jingbai Wang) (09/10/89)

In article <4912@ubc-cs.UUCP> morrison@grads.cs.ubc.ca (Rick Morrison) writes:
>I wanted this capability and eventually resorted to modifying the page output
>macro defined in latex.tex. I haven't had the perseverance to hack
>tabulars, but if you are satisfied with landscape tabbing (starting on a
>new page) you are welcome to what I have. It relies on a locally
>hacked version of dvi2ps to overlay pages (you need this to get headers and

I believe from june.cs.washington.edu in ~/tmp you can find TeXGuide.tar.Z
that demonstrates it very well and in the same place dvi2ps.tar.Z does
the job, tecps.ps shows the similar idea in Scribe (vs. LaTeX).

By the way, these programs were submitted to UNIX distribution by me.

JB Wang