diff options
author | Karl Berry <karl@freefriends.org> | 2007-03-07 18:05:27 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2007-03-07 18:05:27 +0000 |
commit | 1c15eb0bc227a081215bf372a3756aadc4d19d09 (patch) | |
tree | 512213f86181e4a6b05eab611fd4a84f334fc27a /Master/texmf-dist/tex/latex/koma-script/scrkbase.sty | |
parent | f20e65ef1cfe5fc288f66e7af8abc8477511b36a (diff) |
koma-script update (5mar07)
git-svn-id: svn://tug.org/texlive/trunk@4009 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/koma-script/scrkbase.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/koma-script/scrkbase.sty | 341 |
1 files changed, 161 insertions, 180 deletions
diff --git a/Master/texmf-dist/tex/latex/koma-script/scrkbase.sty b/Master/texmf-dist/tex/latex/koma-script/scrkbase.sty index 0f2579aa369..b62bd261183 100644 --- a/Master/texmf-dist/tex/latex/koma-script/scrkbase.sty +++ b/Master/texmf-dist/tex/latex/koma-script/scrkbase.sty @@ -10,7 +10,7 @@ %% scrkbase.dtx (with options: `package,body') %% scrlogo.dtx (with options: `logo') %% -%% Copyright (c) 1994-2006 +%% Copyright (c) 1994-2007 %% Markus Kohm and any individual authors listed elsewhere in this file. %% %% This file was generated from file(s) of the KOMA-Script bundle. @@ -62,102 +62,154 @@ \fi } \fi - \@CheckKOMAScriptVersion{2006/07/30 v2.95b KOMA-Script}% + \@CheckKOMAScriptVersion{2007/03/02 v2.97 KOMA-Script}% \endgroup %%% From File: scrkbase.dtx \ProvidesPackage{scrkbase}[% \KOMAScriptVersion\space package (basics and keyval use)] -%%% From File: scrlfile.dtx -\def\scrlfileversion{2006/03/28 v2.95} -\edef\@tempa{\noexpand\RequirePackage{scrlfile}[\scrlfileversion]} -\@tempa -%%% From File: scrkbase.dtx \RequirePackage{keyval} -\begingroup - \def\@tempa#1=#2=#3\relax{% - \KV@@sp@def\@tempa{#1}% - \ifx\@tempa\@empty\else - \expandafter\let\expandafter\@tempc - \csname\KV@prefix\@tempa\endcsname - \ifx\@tempc\relax - \KV@errx - {\@tempa\space undefined}% - \else - \ifx\@empty#3\@empty - \KV@default - \else - \KV@@sp@def\@tempb{#2}% - \expandafter\@tempc\expandafter{\@tempb}\relax - \fi - \fi - \fi} - \@check@eq\KV@split\@tempa -\endgroup -\def\KV@split#1=#2=#3\relax{% - \KV@@sp@def\@tempa{#1}% - \ifx\@tempa\@empty\else - \expandafter\let\expandafter\@tempc - \csname\KV@prefix\@tempa\endcsname - \ifx\@tempc\relax - \scr@KV@errx{\@tempa}% +\begingroup\expandafter\expandafter\expandafter\endgroup +\expandafter\ifx\csname ifcsname\endcsname + \newcommand{\scr@ifundefined}[1]{% + \ifcsname #1\endcsname + \expandafter\@secondoftwo \else - \ifx\@empty#3\@empty - \KV@default - \else - \KV@@sp@def\@tempb{#2}% - \expandafter\@tempc\expandafter{\@tempb}\relax - \fi + \expandafter\@firstoftwo \fi - \fi} -\CheckCommand*{\KV@default}{% - \expandafter\let\expandafter\@tempb - \csname\KV@prefix\@tempa @default\endcsname - \ifx\@tempb\relax - \KV@err{No value specified for \@tempa}% - \else - \@tempb\relax - \fi} -\renewcommand*{\KV@default}{% - \expandafter\let\expandafter\@tempb - \csname\KV@prefix\@tempa @default\endcsname - \ifx\@tempb\relax - \scr@KV@err{\@tempa}% - \else - \@tempb\relax - \fi} -\newcommand*{\scr@KV@errx}[1]{% - \expandafter\ifx\csname\KV@prefix nokey\endcsname\relax - \KV@errx{#1\space undefined}% - \else - \csname\KV@prefix nokey\endcsname{#1}% - \fi -} -\newcommand*{\scr@KV@err}[1]{% - \expandafter\ifx\csname\KV@prefix noval\endcsname\relax - \KV@err{No value specified for #1}% - \else - \csname\KV@prefix noval\endcsname{#1}% - \fi + } +\else + \newcommand{\scr@ifundefined}[1]{% + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname #1\endcsname\relax + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi + } +\fi +\newcommand*{\DeclareKeyValOption}[2][% + \ifx\@currext\@clsextension\OptionNotUsed\else\@unkownoptionerror\fi +]{% + \DeclareOption*{% + \def\@tempa##1=##2=##3\@nil{% + \scr@ifundefined{KV@#2@##1}{#1}{% + \@expandtwoargs\setkeys{#2}\CurrentOption + }% + }% + \expandafter\@tempa\CurrentOption==\@nil + }% } +\newcommand*{\KOMA@key}{\define@key{KOMA}} +\newcommand*{\dont@let@as@internal@defined}{/} +\KOMA@key{internalonly}{% + \begingroup + \@expandtwoargs\in@{#1}\dont@let@as@internal@defined + \expandafter\endgroup + \ifin@\else\g@addto@macro\dont@let@as@internal@defined{#1/}\fi +} +\DeclareKeyValOption{KOMA} +\ProcessOptions\relax +\newcommand*{\@globaloptionslist}{} +\scr@ifundefined{XKV@classooptionslist}{% + \let\@globaloptionslist\@classoptionslist +}{% + \let\@globaloptionslist\XKV@classoptionslist +} +\@expandtwoargs\in@{,internalonly=}{,\@globaloptionslist} +\ifin@ + \begingroup + \catcode`\=12\catcode`\:=12 + \def\@do@internalonly #1internalonly=#2\@nil{% + \ifx\relax#1\relax\setkeys{KOMA}{internalonly=#2}\fi + \@expandtwoargs\@removeelement{internalonly=#2}\@unusedoptionlist + \@unusedoptionlist + }% + \expandafter\@for\expandafter\@tempa\expandafter:\expandafter=% + \@globaloptionslist\do{% + \expandafter\@do@internalonly\@tempa\@nil + }% + \global\let\@unusedoptionlist\@unusedoptionlist + \endgroup +\fi +%%% From File: scrlfile.dtx +\def\scrlfileversion{2006/07/19 v2.96} +\edef\@tempa{\noexpand\RequirePackage{scrlfile}[\scrlfileversion]} +\@tempa +%%% From File: scrkbase.dtx \newif\if@atdocument \AtBeginDocument{\@atdocumenttrue} \@onlypreamble\@atdocumentrue \@onlypreamble\@atdocumentfalse -\newcommand{\ifundefined}[1]{% - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname #1\endcsname\relax - \expandafter\@firstoftwo +\newcommand*{\let@as@internal@defined}[1]{% + \begingroup + \@expandtwoargs\in@{/#1/}\dont@let@as@internal@defined + \expandafter\endgroup + \ifin@ + \PackageInfo{% + scrkbase% + }{% + \expandafter\string\csname #1\endcsname\space excluded from being + defined% + }% \else - \expandafter\@secondoftwo + \@ifundefined{#1}{% + \begingroup + \expandafter\def\expandafter\@tempa + \expandafter{\csname scr@#1\endcsname} + \expandafter\def\expandafter\@tempb + \expandafter{\csname #1\endcsname} + \expandafter\expandafter\expandafter\endgroup + \expandafter\expandafter\expandafter\let\expandafter\@tempb\@tempa + \if@atdocument\else + \g@addto@macro\document{% + \expandafter\ifx\csname #1\expandafter\endcsname + \csname scr@#1\endcsname + \else + \PackageWarning{scrkbase}{% + \expandafter\string\csname #1\endcsname\space was + redefined\MessageBreak + at the document preamble.\MessageBreak + If you did not redefine it by yourself, have a\MessageBreak + a look at the description of this command at\MessageBreak + the manual of every package you are using\@gobble + }% + \fi + }% + \fi + }{% + \PackageInfo{% + scrkbase% + }{% + \expandafter\string\csname #1\endcsname\space already + defined.\MessageBreak + If \expandafter\string\csname #1\endcsname\space does not behave + like\MessageBreak + it was described at the KOMA-Script manual, try to\MessageBreak + load `scrkbase.sty' earlier or find out at which\MessageBreak + package or class \expandafter\string\csname #1\endcsname\space + was defined before\@gobble + }% + }% \fi } -\newcommand{\ifnotundefined}[1]{% - \begingroup\expandafter\expandafter\expandafter\endgroup - \expandafter\ifx\csname #1\endcsname\relax - \expandafter\@secondoftwo - \else - \expandafter\@firstoftwo - \fi +\let@as@internal@defined{ifundefined} +\scr@ifundefined{ifcsname}{% + \newcommand{\ifnotundefined}[1]{% + \begingroup\expandafter\expandafter\expandafter\endgroup + \expandafter\ifx\csname #1\endcsname\relax + \expandafter\@secondoftwo + \else + \expandafter\@firstoftwo + \fi + }% +}{% + \newcommand{\ifnotundefined}[1]{% + \ifcsname #1\endcsname + \expandafter\@firstoftwo + \else + \expandafter\@secondoftwo + \fi + }% } \newcommand\ifstr[2]{% \begingroup\edef\@tempa{#1}\edef\@tempb{#2}% @@ -251,30 +303,6 @@ }% }% } -\newcommand*{\let@as@internal@defined}[1]{ - \@ifundefined{#1}{% - \begingroup - \expandafter\def\expandafter\@tempa - \expandafter{\csname scr@#1\endcsname} - \expandafter\def\expandafter\@tempb - \expandafter{\csname #1\endcsname} - \expandafter\expandafter\expandafter\endgroup - \expandafter\expandafter\expandafter\let\expandafter\@tempb\@tempa - }{% - \PackageInfo{% - scrkbase% - }{% - \expandafter\string\csname #1\endcsname\space already - defined.\MessageBreak - If \expandafter\string\csname #1\endcsname\space does not behave - like\MessageBreak - it was described at the KOMA-Script manual, try to\MessageBreak - load `scrkbase.sty' earlier or find out at which\MessageBreak - package or class \expandafter\string\csname #1\endcsname\space - was defined before\@gobble - }% - }% -} \newcommand{\scr@ifpdftex}{\ifnotundefined{pdftexversion}} \let@as@internal@defined{ifpdftex} \BeforePackage{pdfcprot}{\let\ifpdftex\relax} @@ -282,8 +310,8 @@ \newcommand{\scr@ifvtex}{\ifnotundefined{VTeXversion}} \let@as@internal@defined{ifvtex} \newcommand{\scr@ifpdfoutput}{% - \ifundefined{pdfoutput}{% - \ifundefined{OpMode}{% + \scr@ifundefined{pdfoutput}{% + \scr@ifundefined{OpMode}{% \expandafter\@secondoftwo% }{% \ifnum\OpMode=1 @@ -322,8 +350,8 @@ } \let@as@internal@defined{ifpsoutput} \newcommand*{\scr@ifdvioutput}{% - \ifundefined{pdfoutput}{% - \ifundefined{OpMode}{% + \scr@ifundefined{pdfoutput}{% + \scr@ifundefined{OpMode}{% \expandafter\@firstoftwo }{% \ifnum\OpMode=0 @@ -341,77 +369,25 @@ }% } \let@as@internal@defined{ifdvioutput} -\newcommand*{\DeclareKeyValOption}[2][% - \ifx\@currext\@clsextension\OptionNotUsed\else\@unkownoptionerror\fi -]{% - \DeclareOption*{ - \expandafter\let\expandafter\@KV@saved@nokey - \csname KV@#2@nokey\endcsname - \@namedef{KV@#2@nokey}{#1\@gobble}% - \@expandtwoargs\setkeys{#2}\CurrentOption - \expandafter\let\csname KV@#2@nokey\endcsname\@KV@saved@nokey - }% -} -\newcommand*{\Pr@cessL@calKeyValOptions}[1]{% - \edef\@curroptions{\@ptionlist{\@currname.\@currext}}% - \ifx\@curroptions\@empty\else - \expandafter\let\expandafter\@KV@saved@nokey\csname KV@#1@nokey\endcsname - \@namedef{KV@#1@nokey}{\in@false\@gobble}% - \@for\CurrentOption:=\@curroptions\do{% - \ifx\CurrentOption\@empty\else - \in@true\@expandtwoargs\setkeys{#1}\CurrentOption - \ifin@ - \ifx\@currext\@clsextension - \@expandtwoargs\@removeelement\CurrentOption - \@unusedoptionlist\@unusedoptionlist - \else - \@expandtwoargs\@removeelement\CurrentOption - \@curroptions\@curroptions - \fi - \fi - \fi - }% - \let\CurrentOption\@empty - \ifx\@currext\@clsextension\else - \expandafter\let\csname opt@\@currname.\@currext\endcsname\@curroptions - \fi - \expandafter\let\csname KV@#1@nokey\endcsname\@KV@saved@nokey - \fi -} -\newcommand*{\Pr@cessGl@balKeyValOptions}[1]{% - \ifx\@currext\@clsextension\else - \expandafter\let\expandafter\@KV@saved@nokey - \csname KV@#1@nokey\endcsname - \@namedef{KV@#1@nokey}{\in@false\@gobble}% - \@for\CurrentOption:=\@classoptionslist\do{% - \ifx\CurrentOption\@empty\else - \in@true\@expandtwoargs\setkeys{#1}\CurrentOption - \ifin@ - \@expandtwoargs\@removeelement\CurrentOption - \@unusedoptionlist\@unusedoptionlist - \fi - \fi - }% - \let\CurrentOption\@empty - \expandafter\let\csname KV@#1@nokey\endcsname\@KV@saved@nokey - \fi -} -\newcommand*{\ProcessKeyValOptions}[1]{% - \Pr@cessGl@balKeyValOptions{#1}% - \Pr@cessL@calKeyValOptions{#1}% -} -\newcommand*{\ProcessAllOptions}{% - \@ifstar\@Pr@cessAll@pti@ns\Pr@cessAll@pti@ns -} -\newcommand*{\@Pr@cessAll@pti@ns}[1]{% - \ProcessKeyValOptions{#1}\ProcessOptions* -} -\newcommand*{\Pr@cessAll@pti@ns}[1]{% - \ProcessKeyValOptions{#1}\ProcessOptions\relax -} -\newcommand*{\KOMA@key}{\define@key{KOMA}} \newcommand*{\KOMAoptions}[1]{% + \let\post@kopt@hook\@empty \setkeys{KOMA}{#1}% + \post@kopt@hook\let\post@kopt@hook\relax +} +\newcommand*{\post@kopt@hook}{} +\let\post@kopt@hook\relax +\newcommand*{\AfterKOMAoptions}{% + \ifx\post@kopt@hook\relax + \PackageWarning{scrkbase}{% + \string\AfterKOMAoptions\space can only be used inside a\MessageBreak + KOMA-Script option that is called using \space\KOMAoptions.\MessageBreak + Because if this, command will be ignored% + }% + \expandafter\@gobbletwo + \else + \expandafter\l@addto@macro + \fi + \post@kopt@hook } \KOMA@key{nokey}{% \PackageError{% @@ -516,8 +492,13 @@ \fi \@tempa } +\newcommand*{\scr@sr@co}{} \newcommand*{\KOMA@DeclareObsoleteOption}[3][\@gobbletwo]{% - \DeclareOption{#2}{\KOMA@UseObsolete{option}{#1}{#2}{#3}}% + \DeclareOption{#2}{% + \let\scr@sr@co\CurrentOption + \KOMA@UseObsolete{option}{#1}{#2}{#3}% + \let\CurrentOption\scr@sr@co + }% } \newcommand*{\KOMA@UseObsolete}[4]{% #2{% |