summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/misc209/portland.sty
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-01-12 23:59:24 +0000
committerKarl Berry <karl@freefriends.org>2006-01-12 23:59:24 +0000
commit5117d5c264e21bf3fd2016f0a4267abeebf15f9b (patch)
tree5c48192ab3adcf56e5ac3eef7b63ea6d541c6ed7 /Master/texmf-dist/tex/latex/misc209/portland.sty
parentba241ca2ae1366aa7f092a7a70430e2d1a7ae851 (diff)
misc209
git-svn-id: svn://tug.org/texlive/trunk@1099 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/misc209/portland.sty')
-rw-r--r--Master/texmf-dist/tex/latex/misc209/portland.sty124
1 files changed, 124 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/misc209/portland.sty b/Master/texmf-dist/tex/latex/misc209/portland.sty
new file mode 100644
index 00000000000..56ebf455e88
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/misc209/portland.sty
@@ -0,0 +1,124 @@
+% This is PORTLAND.STY by H.Partl, TU Wien, as of 16 Dec 1988.
+% Definition of commands and environments \portrait and \landscape
+% for switching between PORTRAIT and LANDSCAPE printing. To be
+% called as document style option with any available style.
+%
+% Commands:
+% \portrait sets or resets the page layout to the initial values
+% (i.e. the values valid at \begin{document})
+% \landscape sets the page layout such that the horizontal and
+% vertical measures are interchanged with respect to
+% the initial values. The text area will occupy the
+% same position on the page as in \portrait mode.
+% Both command issue a \clearpage before changing the layout.
+%
+% Environments:
+% \begin{portrait} ... \end{portrait}
+% \begin{landscape} ... \end{landscape}
+% Both issue \clearpage at the \begin and at the \end.
+%
+% Implementation Dependencies:
+% You should insert the correct paper height (11in or 197mm or ...)
+% into \paperheight for correct positioning.
+% If your printer driver allows mixing of protrait and landscape pages
+% within one printout, you should insert the corresponding \special
+% commands just after the four \clearpage commands.
+% If your printer only allows printing of the whole document either in
+% protrait or in landscape orientation, you should print the document
+% twice (or selected parts of it) - once in portrait and once in landscape -
+% and then merge the correct pages.
+% If your printer can't print in landscape orientation, then these commands
+% can be used only for small pages that fit onto the paper in both direc-
+% tions.
+
+\newdimen \paperheight % needed for calculation of bottom margin.
+\paperheight 297mm % <--- 11in for US paper or 297mm for A4 paper!
+
+\newdimen\phoffset
+\newdimen\pvoffset
+\newdimen\ptextwidth
+\newdimen\ptextheight
+\newdimen\ptopmargin
+\newdimen\poddsidemargin
+\newdimen\pevensidemargin
+
+\newdimen\lhoffset
+\newdimen\lvoffset
+\newdimen\ltextwidth
+\newdimen\ltextheight
+\newdimen\ltopmargin
+\newdimen\loddsidemargin
+\newdimen\levensidemargin
+
+\def\set@portland@values{%
+% portrait values = current values
+\phoffset\hoffset
+\pvoffset\voffset
+\ptextwidth\textwidth
+\ptextheight\textheight
+\ptopmargin\topmargin
+\poddsidemargin\oddsidemargin
+\pevensidemargin\evensidemargin
+% landscape margins will be measured from zero point
+\lhoffset \z@
+\lvoffset \z@
+% landscape textwidth = portrait textheight
+\ltextwidth \ptextheight
+% landscape textheight = portrait textwidth
+\ltextheight \ptextwidth
+% landscape left margin = portrait bottom margin (same for odd and even)
+\loddsidemargin \paperheight
+\advance \loddsidemargin by -\ptextheight
+\advance \loddsidemargin by -\headsep
+\advance \loddsidemargin by -\headheight
+\advance \loddsidemargin by -\ptopmargin
+\advance \loddsidemargin by -\pvoffset
+\advance \loddsidemargin by -2in
+\levensidemargin \loddsidemargin
+% landscape top margin (incl. head) = portrait oddside left margin
+\ltopmargin \poddsidemargin
+\advance \ltopmargin by -\headheight
+\advance \ltopmargin by -\headsep
+\advance \ltopmargin by \phoffset
+}
+
+\def\portrait{\clearpage \message{ \string\portrait }%
+ \hoffset\phoffset
+ \voffset\pvoffset
+ \textwidth\ptextwidth
+ \textheight\ptextheight
+ \@colht\textheight \@colroom\textheight \vsize\textheight
+ \columnwidth\textwidth \@clubpenalty\clubpenalty
+ \if@twocolumn \advance\columnwidth -\columnsep
+ \divide\columnwidth\tw@ \hsize\columnwidth \@firstcolumntrue
+ \fi
+ \hsize\columnwidth \linewidth\hsize
+ \topmargin\ptopmargin
+ \oddsidemargin\poddsidemargin
+ \evensidemargin\pevensidemargin
+ }
+
+\def\endportrait{\clearpage \message{ \string\endportrait }}
+
+\def\landscape{\clearpage \message{ \string\landscape }%
+ \hoffset\lhoffset
+ \voffset\lvoffset
+ \textwidth\ltextwidth
+ \textheight\ltextheight
+ \@colht\textheight \@colroom\textheight \vsize\textheight
+ \columnwidth\textwidth \@clubpenalty\clubpenalty
+ \if@twocolumn \advance\columnwidth -\columnsep
+ \divide\columnwidth\tw@ \hsize\columnwidth \@firstcolumntrue
+ \fi
+ \hsize\columnwidth \linewidth\hsize
+ \topmargin\ltopmargin
+ \oddsidemargin\loddsidemargin
+ \evensidemargin\levensidemargin
+ }
+
+\def\endlandscape{\clearpage \message{ \string\endlandscape }}
+
+\let\set@document@values \document
+\def\document{\set@document@values \set@portland@values}
+
+\endinput