From d9a28f240927d595970990e323f189f3ed45bdaf Mon Sep 17 00:00:00 2001
From: Karl Berry <karl@freefriends.org>
Date: Tue, 31 Mar 2009 00:25:41 +0000
Subject: koma-script update (30mar09)

git-svn-id: svn://tug.org/texlive/trunk@12579 c570f23f-e606-0410-a88d-b1316a301751
---
 .../texmf-dist/tex/latex/koma-script/typearea.sty  | 163 +++++++++++++++------
 1 file changed, 115 insertions(+), 48 deletions(-)

(limited to 'Master/texmf-dist/tex/latex/koma-script/typearea.sty')

diff --git a/Master/texmf-dist/tex/latex/koma-script/typearea.sty b/Master/texmf-dist/tex/latex/koma-script/typearea.sty
index 24e09b20773..c882da7d9db 100644
--- a/Master/texmf-dist/tex/latex/koma-script/typearea.sty
+++ b/Master/texmf-dist/tex/latex/koma-script/typearea.sty
@@ -40,8 +40,10 @@
 %% See `README'.
 %% 
 %% The KOMA-Script bundle (but maybe not this file) was based upon the
-%% LaTeX2.09 Script family created by Frank Neukam 1993 and the LaTeX2e
-%% standard classes created by The LaTeX3 Project 1994-1996.
+%% LaTeX 2.09 Script family created by Frank Neukam 1993 and the LaTeX2e
+%% standard classes created by The LaTeX3 Project 1994-1996.  You may
+%% find a complete unmodified copy of LaTeX2e at
+%% <http://www.ctan.org/pub/tex-archive/macros/latex/base/>.
 %% 
 %%% From File: scrkvers.dtx
 \begingroup
@@ -65,7 +67,7 @@
       \fi
     }
   \fi
-  \@CheckKOMAScriptVersion{2009/01/24 v3.02b KOMA-Script}%
+  \@CheckKOMAScriptVersion{2009/04/01 v3.03 KOMA-Script}%
 \endgroup
 %%% From File: scrktare.dtx
 \ProvidesPackage{typearea}[%
@@ -297,6 +299,7 @@
 \KOMA@key{pagesize}[auto]{%
   \begingroup
     \KOMA@set@ncmdkey{pagesize}{@tempa}{%
+      {off}{-1},{no}{-1},{false}{-1},%
       {auto}{0},{automedia}{1},{dvips}{2},{pdftex}{3}%
     }{#1}%
     \ifcase\number\@tempa\relax
@@ -334,9 +337,14 @@
       \endgroup
       \AtBeginDocument{\AtBeginDvi{%
           \special{papersize=\the\paperwidth,\the\paperheight}%
+          \if@seascape\special{! TeXDict begin /landplus90{true}store end }\fi
         }%
       }%
-      \let\set@dvipspagesize=\setnot@dvipspagesize
+      \ifnum \scr@compatibility>\@nameuse{scr@v@3.02b}\relax
+        \let\set@dvipspagesize=\@empty
+      \else
+        \let\set@dvipspagesize=\setnot@dvipspagesize
+      \fi
     \else
       \endgroup
   \fi
@@ -360,12 +368,57 @@
   }%
   \let\set@vtexpagesize=\@empty
 }
+\newcommand*{\scr@updatedvipspagesize}{%
+  \special{ps::\@percentchar\@percentchar
+    PageBoundingBox: 0 0 \the\numexpr\paperwidth/\dimexpr 1bp\relax\relax
+    \space \the\numexpr\paperheight/\dimexpr 1bp\relax\relax^^J%
+    \@percentchar\@percentchar BeginPageSetup^^J%
+    << /PageSize [\the\numexpr\paperwidth/\dimexpr 1bp\relax\relax\space
+    \the\numexpr\paperheight/\dimexpr 1bp\relax\relax]
+    >> setpagedevice^^J%<<
+    0 0 bop^^J%
+    \@percentchar\@percentchar EndPageSetup}%
+}
 \AtBeginDocument{
   \renewcommand*{\set@pdftexpagesize}{%
     \ifnotundefined{pdfpagewidth}{\pdfpagewidth=\paperwidth}{}%
     \ifnotundefined{pdfpageheight}{\pdfpageheight=\paperheight}{}%
   }%
-  \let\set@dvipspagesize=\setnot@dvipspagesize
+  \ifnum \scr@compatibility>\@nameuse{scr@v@3.02b}\relax
+    \renewcommand*{\set@dvipspagesize}{%
+      \scr@ifundefinedorrelax{AtNextShipout}{%
+        \scr@ifundefinedorrelax{AtBeginShipoutNext}{%
+          \begingroup
+            \protected@edef\reserved@a{\endgroup
+            \scr@updatedvipspagesize}\reserved@a
+        }{%
+          \begingroup
+            \protected@edef\reserved@a{\endgroup
+            \protect\AtBeginShipoutNext{%
+              \protect\bgroup
+                \protect\global\protect\setbox\AtBeginShipoutBox\protect\vbox{%
+                  \scr@updatedvipspagesize
+                  \protect\box\AtBeginShipoutBox
+                }%
+              \protect\egroup
+            }}\reserved@a
+        }%
+      }{%
+        \begingroup
+          \protected@edef\reserved@a{\endgroup
+          \protect\AtNextShipout{%
+            \protect\bgroup
+              \protect\global\protect\setbox\protect\@cclv\protect\vbox{%
+                \scr@updatedvipspagesize
+                \protect\box\protect\@cclv
+              }%
+            \protect\egroup
+          }}\reserved@a
+      }%
+    }%
+  \else
+    \let\set@dvipspagesize=\setnot@dvipspagesize
+  \fi
   \renewcommand*{\set@vtexpagesize}{%
     \ifnotundefined{mediawith}{\mediawidth=\paperwidth}{}%
     \ifnotundefined{mediaheight}{\mediaheight=\paperheight}{}%
@@ -386,7 +439,8 @@
 \KOMA@DeclareStandardOption[typearea]{landscape}{paper=landscape}
 \KOMA@DeclareStandardOption[typearea]{portrait}{paper=portrait}
 \KOMA@key{paper}{%
-  \ifstr{#1}{landscape}{%
+  \ifstr{#1}{seascape}{%
+    \@seascapetrue
     \if@landscape\else
       \setlength{\@tempdima}{\paperwidth}%
       \setlength{\paperwidth}{\paperheight}%
@@ -394,73 +448,84 @@
       \@landscapetrue
     \fi
   }{%
-    \ifstr{#1}{portrait}{%
-      \if@landscape
+    \ifstr{#1}{landscape}{%
+      \@seascapefalse
+      \if@landscape\else
         \setlength{\@tempdima}{\paperwidth}%
         \setlength{\paperwidth}{\paperheight}%
         \setlength{\paperheight}{\@tempdima}%
-        \@landscapefalse
+        \@landscapetrue
       \fi
     }{%
-      \ifstr{#1}{letter}{%
+      \ifstr{#1}{portrait}{%
         \if@landscape
-          \setlength\paperheight{8.5in}%
-          \setlength\paperwidth {11in}%
-        \else
-          \setlength\paperheight{11in}%
-          \setlength\paperwidth {8.5in}%
+          \setlength{\@tempdima}{\paperwidth}%
+          \setlength{\paperwidth}{\paperheight}%
+          \setlength{\paperheight}{\@tempdima}%
+          \@landscapefalse
         \fi
       }{%
-        \ifstr{#1}{legal}{%
+        \ifstr{#1}{letter}{%
           \if@landscape
             \setlength\paperheight{8.5in}%
-            \setlength\paperwidth {14in}%
+            \setlength\paperwidth {11in}%
           \else
-            \setlength\paperheight{14in}%
+            \setlength\paperheight{11in}%
             \setlength\paperwidth {8.5in}%
           \fi
         }{%
-          \ifstr{#1}{executive}{%
+          \ifstr{#1}{legal}{%
             \if@landscape
-              \setlength\paperheight{7.25in}%
-              \setlength\paperwidth {10.5in}%
+              \setlength\paperheight{8.5in}%
+              \setlength\paperwidth {14in}%
             \else
-              \setlength\paperheight{10.5in}%
-              \setlength\paperwidth {7.25in}%
-           \fi
+              \setlength\paperheight{14in}%
+              \setlength\paperwidth {8.5in}%
+            \fi
           }{%
-            \iso@paper{#1}%
-            \if@tempswa\else
-              \expandafter\maybe@pair#1::\@nil
-              \if@tempswa
-                \ifnum \scr@ta@compatibility<\@nameuse{scr@v@3.01b}\relax
-                  \PackageWarningNoLine{typearea}{%
-                    You may have to exchange height and width!\MessageBreak
-                    Until KOMA-Script version 3.01b the semantic\MessageBreak
-                    of option `paper' was `paper=height:width'\MessageBreak
-                    instead of `paper=width:height'.\MessageBreak
-                    I've switched back to that old interpretation\MessageBreak
-                    because of the given compatiblity settings}%
-                  \setlength\paperheight{\@tempa}%
-                  \setlength\paperwidth{\@tempb}%
+            \ifstr{#1}{executive}{%
+              \if@landscape
+                \setlength\paperheight{7.25in}%
+                \setlength\paperwidth {10.5in}%
+              \else
+                \setlength\paperheight{10.5in}%
+                \setlength\paperwidth {7.25in}%
+             \fi
+            }{%
+              \iso@paper{#1}%
+              \if@tempswa\else
+                \expandafter\maybe@pair#1::\@nil
+                \if@tempswa
+                  \ifnum \scr@ta@compatibility<\@nameuse{scr@v@3.01b}\relax
+                    \PackageWarningNoLine{typearea}{%
+                      You may have to exchange height and width!\MessageBreak
+                      Until KOMA-Script version 3.01b the semantic\MessageBreak
+                      of option `paper' was `paper=height:width'\MessageBreak
+                      instead of `paper=width:height'.\MessageBreak
+                      I've switched back to that old interpretation\MessageBreak
+                      because of the given compatiblity settings}%
+                    \setlength\paperheight{\@tempa}%
+                    \setlength\paperwidth{\@tempb}%
+                  \else
+                    \setlength\paperwidth{\@tempa}%
+                    \setlength\paperheight{\@tempb}%
+                  \fi
                 \else
-                  \setlength\paperwidth{\@tempa}%
-                  \setlength\paperheight{\@tempb}%
+                  \KOMA@unknown@keyval{paper}{#1}{%
+                    `letter', `legal', `executive', `a'<nr>, `b'<nr>,
+                    `c'<nr>, `d'<nr>,\MessageBreak
+                    <width>`:'<height>, `landscape' and `portrait'%
+                  }%
                 \fi
-              \else
-                \KOMA@unknown@keyval{paper}{#1}{%
-                  `letter', `legal', `executive', `a'<nr>, `b'<nr>,
-                  `c'<nr>, `d'<nr>,\MessageBreak
-                  <width>`:'<height>, `landscape' and `portrait'%
-                }%
               \fi
-            \fi
+            }%
           }%
         }%
       }%
     }%
   }%
 }
+\newif\if@seascape
 \newif\if@landscape
 \newcommand*{\maybe@pair}{}
 \def\maybe@pair#1:#2:#3\@nil{%
@@ -531,7 +596,9 @@
 \@namedef{scr@v@3.01c}{9}
 \@namedef{scr@v@3.02}{9}
 \@namedef{scr@v@3.02b}{9}
-\@namedef{scr@v@last}{9}
+\@namedef{scr@v@3.02c}{10}
+\@namedef{scr@v@3.03}{0}
+\@namedef{scr@v@last}{10}
 %%% From File: scrktare.dtx
 \InputIfFileExists{typearea.cfg}{%
   \typeout{%
-- 
cgit v1.2.3

