Landscape mode 

Newsgroups: comp.text.tex
Date: 1999/06/28

I have bought 2 books on LaTex, but can not figure out how to compile (print) my .tex file in landscape mode.

My file looks like this:

\documentclass[letterpaper,landscape]{article}
\begin{document}
lots of text....
\end{document}

I run this:

latex data.tex
dvips -t landscape data.tex -o
gv -swap -antialias -scale 1 data.ps

Problems with landscape… 

> This works, but is not acceptable.  Why do I have to tell dvips to use -t
> landscape?  Isn't this why I specified landscape in the source file?  And
> why do I have to use -swap on gv?
>

You aren't doing anything wrong. The landscape option just sets the paper dimension right. (It swaps width and height) You are supposed to use dvips to rotate the dvi-file. I don't know why your margins are wrong - it works fine for me.

There are two possibilties:

  1. If only some pages (or the document is short) you can use the landscape-package 'lscape.sty' that rotates the text in a portrait paper. Then you can drop the '-t l..' option of dvips and '-swap' of gv.
  2. Using the landscape option it's impossible (?) to avoid the '-t l..' option of dvips, but you can (maybe) fix the margins and avoid the swap of gv using this bit of PS-code:

Insert the following code just before the "%%EndSetup" comment line into your PostScript files:

 ---snip---
  /my_beginpage
  {currentpagedevice/PageSize get aload pop translate
-1 -1 scale} cvlit def
  currentpagedevice/BeginPage known
  {<< %start of dict construction
   /BeginPage
  [currentpagedevice/BeginPage get cvlit aload pop % get the original
    my_beginpage aload pop % append own code
   ] %make an array
   cvx % make executable
   >> %now the constructed dict contains the key value pair
      % /BeginPage {old code appended code}
   }
   {<</BeginPage {pop my_beginpage aload pop}>>
   }ifelse
  setpagedevice
 ---snip---

I hope this was any help.

Hans Fredrik Nordhaug