summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/koma-script/scrhack.dtx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-09-30 21:16:51 +0000
committerKarl Berry <karl@freefriends.org>2015-09-30 21:16:51 +0000
commit21923df0aa733309adbfcc3169c7ffc0e0ab8b1c (patch)
treef81789ab91c6edd088e331eac5983464e7f21c6b /Master/texmf-dist/source/latex/koma-script/scrhack.dtx
parent197071e9b5aaa66a56c464229f4a9fc81c0c8b1f (diff)
koma-script (30sep15)
git-svn-id: svn://tug.org/texlive/trunk@38504 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/koma-script/scrhack.dtx')
-rw-r--r--Master/texmf-dist/source/latex/koma-script/scrhack.dtx126
1 files changed, 123 insertions, 3 deletions
diff --git a/Master/texmf-dist/source/latex/koma-script/scrhack.dtx b/Master/texmf-dist/source/latex/koma-script/scrhack.dtx
index 4a54d7eeb2e..13460cd2ead 100644
--- a/Master/texmf-dist/source/latex/koma-script/scrhack.dtx
+++ b/Master/texmf-dist/source/latex/koma-script/scrhack.dtx
@@ -1,4 +1,4 @@
-% \CheckSum{768}
+% \CheckSum{814}
% \iffalse meta-comment
% ======================================================================
% scrhack.dtx
@@ -62,7 +62,7 @@
% Right brace \} Tilde \~}
%
% \iffalse
-%%% From File: $Id: scrhack.dtx 2118 2015-05-22 15:34:34Z kohm $
+%%% From File: $Id: scrhack.dtx 2175 2015-08-11 15:51:46Z kohm $
%<package&identify>%%% using: package,identify
%<package&option>%%% using: package,option
%<package&body>%%% using: package,body
@@ -78,6 +78,7 @@
%<floatrow&identify>\ProvidesFile{floatrow.hak}[%
%<listings&identify>\ProvidesFile{listings.hak}[%
%<setspace&identify>\ProvidesFile{setspace.hak}[%
+%<lscape&identify>\ProvidesFile{lscape.hak}[%
%<*driver|manual|identify>
%!KOMAScriptVersion
package
@@ -91,6 +92,7 @@
%<floatrow&identify> floatrow)%
%<listings&identify> listings)%
%<setspace&identify> setspace)%
+%<lscape&identify> lscape)%
%<*driver|manual|identify>
]
%</driver|manual|identify>
@@ -134,6 +136,11 @@
\from{scrhack.dtx}{hack,setspace,identify}%
\from{scrhack.dtx}{hack,setspace,body}%
}%
+ \file{lscape.hak}{%
+ \from{scrkernel-version.dtx}{file,lscape.hak}%
+ \from{scrhack.dtx}{hack,lscape,identify}%
+ \from{scrhack.dtx}{hack,lscape,body}%
+ }%
}
\@@input scrstrop.inc
\else
@@ -147,6 +154,7 @@
\usepackage[english,ngerman]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
+\newcommand*{\Environment}[1]{\texttt{\mbox{#1}}}
\CodelineIndex
\RecordChanges
\begin{document}
@@ -366,7 +374,7 @@ You can switch of the \Package{setspace} hack loading package
\Package{scrhack} with option \OptionValue{setspace}{false}. You may also
switch of the \Package{setspace} hack using
\Macro{KOMAoptions}\PParameter{setspace=false} or
-\Macro{KOMAOption}\PParameter{setspace}\PParameter{false} somewhere after
+\Macro{KOMAoption}\PParameter{setspace}\PParameter{false} somewhere after
loading package \Package{scrhack}, but before loading package
\Package{setspace}.
@@ -374,6 +382,39 @@ Note: If you want to use \Package{setspace} with package option
\Option{onehalfspacing} or \Option{doublespacing} you have to load
\Package{scrhack} before \Package{setspace}.
+
+\section{The \Package{lscape} hack}
+\label{sec:scrhack.lscape}
+
+% \begingroup\let\Length\cs
+Package \Package{lscape} defines an environment \Environment{landscape} to set
+the page contents but not head and foot landscape. Inside this environment it
+changes \Length{textheight} to the value of \Length{textwidth}, but it does
+not change \Length{textwidth} to the former value of \Length{textheight}.
+This is inconsistent. As far a I know, \Length{textwidth} is unchanged because
+setting it to \Length{textheight} could blame other packages or user
+commands. But changing \Length{textheight} could also blame other packages or
+user commands and indeed it breaks, e.\,g., \Package{showframe} and
+\Package{scrlayer}. So best would be, not to change \Length{textheight},
+too. \Package{scrhack} uses package \Package{xpatch} to modify the
+environment start macro \Macro{landscape} appropriately.
+% \endgroup
+
+% \iffalse
+\begin{Declaration}
+ \KOption{lscape}{switch}
+\end{Declaration}
+% \fi
+You can switch of the \Package{lscape} hack loading package \Package{scrhack}
+with option \OptionValue{lscape}{false}. You can also change option
+\Option{lscape} afterwards. If the option is \PValue{false} while loading
+\Package{lscape}, \Package{scrhack} will not patch \Macro{landscape} and later
+changes of the option have no effect. But if the option is \PValue{true} while
+loading \Package{lscape} or if \Package{scrhack} is loaded after
+\Package{lscape} without option \OptionValue{lscape}{false}, every later
+change of the option using \Macro{KOMAoption} or \Macro{KOMAoptions} will have
+the expected effect.
+
% \iffalse
%</manual|dtx>
% \fi
@@ -1159,6 +1200,85 @@ Note: If you want to use \Package{setspace} with package option
% \end{macro}
%
%
+% \subsection{Der \textsf{lscape}-Hack}
+% \changes{v3.18a}{2015/07/07}{Neuer \textsf{lscape}-Hack}
+%
+% Das \textsf{lscape}-Paket setzt innerhalb der
+% \texttt{landscape}-Umgebung die Länge \cs{textheight} auf den Wert
+% von \cs{textwidth} obwohl es auf der anderen Seite \cs{textwidth}
+% nicht auf den Wert von \cs{textheight} setzt. Das ist inkonsequent. Da
+% David~Carlisle außerdem angibt, dass \cs{textwidth} nicht verändert wird,
+% weil das zu Problemen führen konnte, ist es unverständlich, dass
+% \cs{textheight} verändert wird, obwohl das ebenfalls zu Problemen führen
+% kann, beispielsweise für \textsf{showframe} oder \textsf{scrpage}. Daher
+% verändere ich die Definition so, dass auch \cs{textheight} unverändert
+% bleibt. Dabei muss allerdings auch \textsf{pdflscape} berücksichtigt
+% werden. Das ist am einfachsten mit \textsf{xpatch}.
+%
+% \begin{option}{lscape}
+% \changes{v3.18a}{2015/07/07}{Neue Option für neuen Hack}^^A
+% \begin{macrocode}
+%<*package&option>
+\KOMA@ifkey{lscape}{@scrhack@lscape}%
+\KOMAExecuteOptions{lscape=true}%
+%</package&option>
+%<*package&body>
+\AfterPackage*{lscape}{%
+ \if@scrhack@lscape\scr@hack@load\@pkgextension{lscape}\else
+ \KOMA@key[.scrhack.sty]{lscape}{%
+ \PackageWarning{scrhack}{option `lscape' ignored}%
+ \FamilyKeyStateProcessed
+ }%
+ \fi
+}
+%</package&body>
+% \end{macrocode}
+% \end{option}
+%
+% \begin{macro}{\landscape}
+% \changes{v3.18a}{2015/07/07}{Neu}^^A
+% Über diese Anweisung wird die \texttt{landscape}-Umgebung von
+% \textsf{lscape} gestartet. Genau diese muss gepatcht werden. Dafür wird das
+% Paket \textsf{xpatch} benötigt. Da der Patch nur geladen wird, wenn die
+% Option dafür gesetzt ist, kann die Option daher nur ein- und ausgeschaltet
+% werden, wenn sie bis zum Laden des Pakets aktiviert wurde.
+% \begin{macrocode}
+%<*lscape&body>
+\RequirePackage{xpatch}
+\xpatchcmd{\landscape}{\textheight=\vsize}{%
+ \if@scrhack@lscape
+% \end{macrocode}
+% \changes{v3.18a}{2015/08/11}{Patchen von \cs{@outputpage}}^^A
+% Es gibt allerdings in der Tat eine Stelle, an der ein verändertet Wert von
+% \cs{textheight} benötigt wird. Das ist wenn innerhalb von \cs{@outputpage}
+% der Wert von \cs{@colht} reinitialisiert wird. Also wird das entsprechend
+% auch noch hinein gepatcht.
+% \begin{macrocode}
+ \scrh@LT@textheight=\vsize
+ \let\scrh@LT@outputpage\@outputpage
+ \def\@outputpage{\scrh@LT@outputpage\global\@colht\scrh@LT@textheight}%
+ \else
+ \textheight=\vsize
+ \fi
+}{%
+ \PackageInfo{scrhack}{\string\landscape\space patched to make
+ \string\textheight\space change optional}%
+}{%
+ \PackageWarning{scrhack}{Cannot patch \string\landscape!\MessageBreak
+ Maybe you are using a unsupported lscape version}%
+ \@scrhack@lscapefalse
+}
+% \end{macrocode}
+% \begin{Length}{\scrh@LT@textheight}
+% \changes{v3.18a}{2015/08/11}{neue Länge (intern)}
+% \begin{macrocode}
+\newlength{\scrh@LT@textheight}
+%</lscape&body>
+% \end{macrocode}
+% \end{Length}^^A \scrh@LT@textheight
+% \end{macro}^^A \landscape
+%
+%
% \subsection{Optionen ausführen}
%
% Zum Schluss noch die Optionen ausführen. Im Paket wird diese Anweisung