diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/koma-script/scrpage.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/koma-script/scrpage.sty | 227 |
1 files changed, 115 insertions, 112 deletions
diff --git a/Master/texmf-dist/tex/latex/koma-script/scrpage.sty b/Master/texmf-dist/tex/latex/koma-script/scrpage.sty index fcfffc74282..57d06c2d22e 100644 --- a/Master/texmf-dist/tex/latex/koma-script/scrpage.sty +++ b/Master/texmf-dist/tex/latex/koma-script/scrpage.sty @@ -58,7 +58,10 @@ headinclude,footinclude% \fi \def\@tempa{\newif\if@mainmatter\@mainmattertrue} \begingroup\expandafter\expandafter\expandafter\endgroup -\expandafter\ifx\csname mainmatter\endcsname\relax\else\let\@tempa\relax\fi +\expandafter\ifx\csname mainmatter\endcsname\relax +\else + \let\@tempa\relax +\fi \@tempa \let\headmark\relax \DeclareRobustCommand\pagemark{{\pnumfont\thepage}} @@ -81,25 +84,25 @@ headinclude,footinclude% \if@mainmatter\chaptermarkformat\fi\fi ####1}}% \def\sectionmark####1{% \markright {\ifnum \c@secnumdepth >\z@% - \sectionmarkformat\fi ####1}} + \sectionmarkformat\fi ####1}}% \else \def\sectionmark####1{% \markboth {\ifnum \c@secnumdepth >\z@% - \sectionmarkformat\fi ####1}{% + \if@mainmatter\sectionmarkformat\fi\fi ####1}{% \ifnum \c@secnumdepth >\z@% - \sectionmarkformat\fi ####1}} + \ifmainmatter\sectionmarkformat\fi\fi ####1}}% \def\subsectionmark####1{% \markright {\ifnum \c@secnumdepth >\@ne% - \subsectionmarkformat\fi ####1}} + \subsectionmarkformat\fi ####1}}% \fi \else \let\@mkboth\@gobbletwo \if@chapter - \def\chaptermark####1{} + \def\chaptermark####1{}% \else - \def\subsectionmark####1{} + \def\subsectionmark####1{}% \fi - \def\sectionmark####1{} + \def\sectionmark####1{}% \fi \def@twosidehead#3 \def@twosidefoot#4 @@ -116,78 +119,78 @@ headinclude,footinclude% \def\chaptermark####1{% \markright {\ifnum \c@secnumdepth >\m@ne% \if@mainmatter\chaptermarkformat\fi\fi ####1}}% - \def\sectionmark####1{} + \def\sectionmark####1{}% \else \def\sectionmark####1{% \markright{\ifnum \c@secnumdepth >\z@% - \sectionmarkformat\fi ####1}} - \def\subsectionmark####1{} + \if@mainmatter\sectionmarkformat\fi\fi ####1}}% + \def\subsectionmark####1{}% \fi \else \let\@mkboth\@gobbletwo \if@chapter - \def\chaptermark####1{} + \def\chaptermark####1{}% \else - \def\subsectionmark####1{} + \def\subsectionmark####1{}% \fi - \def\sectionmark####1{} + \def\sectionmark####1{}% \fi \def@onesidehead#3 \def@onesidefoot#4 } } \fi -\def\def@twosidehead(#1,#2)#3#4#5(#6,#7){ +\def\def@twosidehead(#1,#2)#3#4#5(#6,#7){% \def\@evenhead{\let\headmark\leftmark% \hss\hskip\@evenheadshift\vbox{\hsize=\@headwidth\relax% \hf@rule{#1}{#2}{\@headwidth}% \vskip#2 - \vskip\baselineskip% + \vskip\baselineskip \hb@xt@\@headwidth{{% \headfont\strut #3}}% \hf@rule{#6}{#7}{\@headwidth}% - }\hskip\@oddheadshift\hss} - \def\@oddhead{\let\headmark\rightmark% - \hss\hskip\@oddheadshift\vbox{\hsize=\@headwidth\relax% + }\hskip\@oddheadshift\hss}% + \def\@oddhead{\let\headmark\rightmark + \hss\hskip\@oddheadshift\vbox{\hsize=\@headwidth\relax \hf@rule{#1}{#2}{\@headwidth}% - \vskip#2 - \vskip\baselineskip% + \vskip#2% + \vskip\baselineskip \hb@xt@\@headwidth{{% \headfont\strut #4}}% \hf@rule{#6}{#7}{\@headwidth}% - }\hskip\@evenheadshift\hss} + }\hskip\@evenheadshift\hss}% } -\def\def@onesidehead(#1,#2)#3#4#5(#6,#7){ - \def\@evenhead{} - \def\@oddhead{\let\headmark\rightmark% - \hss\hskip\@oddheadshift\vbox{\hsize=\@headwidth\relax% +\def\def@onesidehead(#1,#2)#3#4#5(#6,#7){% + \def\@evenhead{}% + \def\@oddhead{\let\headmark\rightmark + \hss\hskip\@oddheadshift\vbox{\hsize=\@headwidth\relax \hf@rule{#1}{#2}{\@headwidth}% \vskip#2% - \vskip\baselineskip% + \vskip\baselineskip \hb@xt@\@headwidth{{% - \headfont\strut #5}} + \headfont\strut #5}}% \hf@rule{#6}{#7}{\@headwidth}% - }\hskip\@evenheadshift\hss} + }\hskip\@evenheadshift\hss}% } -\def\def@twosidefoot(#1,#2)#3#4#5(#6,#7){ - \def\@evenfoot{\let\headmark\leftmark% - \hss\hskip\@evenfootshift\vbox{\hsize=\@footwidth\relax% +\def\def@twosidefoot(#1,#2)#3#4#5(#6,#7){% + \def\@evenfoot{\let\headmark\leftmark + \hss\hskip\@evenfootshift\vbox{\hsize=\@footwidth\relax \topfoot@rule{#1}{#2}\hb@xt@\@footwidth{{% \headfont\strut #3}}% - \botfoot@rule{#6}{#7}}\hskip\@oddfootshift\hss} - \def\@oddfoot{\let\headmark\rightmark% - \hss\hskip\@oddfootshift\vbox{\hsize=\@footwidth\relax% + \botfoot@rule{#6}{#7}}\hskip\@oddfootshift\hss}% + \def\@oddfoot{\let\headmark\rightmark + \hss\hskip\@oddfootshift\vbox{\hsize=\@footwidth\relax \topfoot@rule{#1}{#2}\hb@xt@\@footwidth{{% \headfont\strut #4}}% - \botfoot@rule{#6}{#7}}\hskip\@evenfootshift\hss} + \botfoot@rule{#6}{#7}}\hskip\@evenfootshift\hss}% } -\def\def@onesidefoot(#1,#2)#3#4#5(#6,#7){ - \def\@evenfoot{} - \def\@oddfoot{\let\headmark\rightmark% - \hss\hskip\@oddfootshift\vbox{\hsize=\@footwidth\relax% +\def\def@onesidefoot(#1,#2)#3#4#5(#6,#7){% + \def\@evenfoot{}% + \def\@oddfoot{\let\headmark\rightmark + \hss\hskip\@oddfootshift\vbox{\hsize=\@footwidth\relax \topfoot@rule{#1}{#2}\hb@xt@\@footwidth{{% \headfont\strut #5}} - \botfoot@rule{#6}{#7}}\hskip\@evenfootshift\hss} + \botfoot@rule{#6}{#7}}\hskip\@evenfootshift\hss}% } \newcommand\topfoot@rule[2]{% \@tempdima\baselineskip\advance\@tempdima by-.7\normalbaselineskip @@ -201,7 +204,7 @@ headinclude,footinclude% } \newcommand\hf@rule[3]{% \setlength{\@tempdimb}{#1} - \setlength{\@tempdimb}{.5\@tempdimb} + \setlength{\@tempdimb}{.5\@tempdimb}% \hb@xt@#3{% \hfill% \llap{\vrule\@depth#2\@height\z@\@width\@tempdimb}% @@ -213,46 +216,46 @@ headinclude,footinclude% \@ifstar {\@newpagestyle[-]}% {\@newpagestyle[+]}} -\def\@newpagestyle[#1]#2#3#4{ +\def\@newpagestyle[#1]#2#3#4{% \expandafter\ifx\csname ps@#2\endcsname\relax - \@defpagestyle[#1]{#2}{#3}{#4} + \@defpagestyle[#1]{#2}{#3}{#4}% \else \PackageError - {scrpage} + {scrpage}% {Your command was ignored}% {There is already a pagestyle named ``#1''.\MessageBreak% Use \protect\defpagestyle\space, \protect\renewpagestyle or - \protect\providepagestyle.} + \protect\providepagestyle.}% \fi } \def\renewpagestyle{% \@ifstar {\@renewpagestyle[-]}% {\@renewpagestyle[+]}} -\def\@renewpagestyle[#1]#2#3#4{ +\def\@renewpagestyle[#1]#2#3#4{% \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname ps@#2\endcsname\relax \PackageError - {scrpage} + {scrpage}% {Your command was ignored}% {There is no pagestyle named ``#1''.\MessageBreak% Use \protect\defpagestyle, \protect\newpagestyle or - \protect\providepagestyle.} + \protect\providepagestyle.}% \else - \@defpagestyle[#1]{#2}{#3}{#4} + \@defpagestyle[#1]{#2}{#3}{#4}% \fi } \def\providepagestyle{% \@ifstar {\@providepagestyle[-]}% {\@providepagestyle[+]}} -\def\@providepagestyle[#1]#2#3#4{ +\def\@providepagestyle[#1]#2#3#4{% \expandafter\ifx\csname ps@#2\endcsname\relax - \@defpagestyle[#1]{#2}{#3}{#4} + \@defpagestyle[#1]{#2}{#3}{#4}% \else \PackageInfo - {scrpage} - {\protect\providepagestyle\protect{#1\protect} ignored.} + {scrpage}% + {\protect\providepagestyle\protect{#1\protect} ignored.}% \fi } \def\deftripstyle{% @@ -260,72 +263,72 @@ headinclude,footinclude% {\@deftripstyle[-]}% {\@deftripstyle[+]}} \def\@deftripstyle[#1]#2{% - \@ifnextchar[ + \@ifnextchar[%] {\@@deftripstyle[#1]{#2}}% {\@@deftripstyle[#1]{#2}[\z@]}} -\def\@@deftripstyle[#1]#2[#3]{ - \def\@tempa{#1} - \@ifnextchar[ +\def\@@deftripstyle[#1]#2[#3]{% + \def\@tempa{#1}% + \@ifnextchar[%] {\@@@deftripstyle#2[#3]}% {\@@@deftripstyle#2[\z@][#3]}} \def\@@@deftripstyle#1[#2][#3]#4#5#6#7#8#9{% - \def\@tempb{+} - \ifx\@tempa\@tempb% + \def\@tempb{+}% + \ifx\@tempa\@tempb \defpagestyle{#1}% {(\@headwidth,#2)% {\rlap{#6}\hfill{#5}\hfill\llap{#4}}% {\rlap{#4}\hfill{#5}\hfill\llap{#6}}% {\rlap{#4}\hfill{#5}\hfill\llap{#6}}% - (\@headwidth,#3)} + (\@headwidth,#3)}% {(\@footwidth,#3)% {\rlap{#9}\hfill{#8}\hfill\llap{#7}}% {\rlap{#7}\hfill{#8}\hfill\llap{#9}}% {\rlap{#7}\hfill{#8}\hfill\llap{#9}}% - (\@footwidth,#2)} + (\@footwidth,#2)}% \else \defpagestyle*{#1}% {(\@headwidth,#2)% {\rlap{#6}\hfill{#5}\hfill\llap{#4}}% {\rlap{#4}\hfill{#5}\hfill\llap{#6}}% {\rlap{#4}\hfill{#5}\hfill\llap{#6}}% - (\@headwidth,#3)} + (\@headwidth,#3)}% {(\@footwidth,#3)% {\rlap{#9}\hfill{#8}\hfill\llap{#7}}% {\rlap{#7}\hfill{#8}\hfill\llap{#9}}% {\rlap{#7}\hfill{#8}\hfill\llap{#9}}% - (\@footwidth,#2)} + (\@footwidth,#2)}% \fi } \newcommand*{\settowidthof}[2]{% - \edef\@tempa{#2} + \edef\@tempa{#2}% \edef\@tempb{paper}\ifx\@tempa\@tempb - \setlength{#1}{\paperwidth} + \setlength{#1}{\paperwidth}% \else\edef\@tempb{text}\ifx\@tempa\@tempb - \setlength{#1}{\textwidth} + \setlength{#1}{\textwidth}% \else\edef\@tempb{textwithmarginpar}\ifx\@tempa\@tempb - \setlength{#1}{\textwidth} - \addtolength{#1}{\marginparwidth} - \addtolength{#1}{\marginparsep} + \setlength{#1}{\textwidth}% + \addtolength{#1}{\marginparwidth}% + \addtolength{#1}{\marginparsep}% \else\edef\@tempb{head}\ifx\@tempa\@tempb - \setlength{#1}{\@headwidth} + \setlength{#1}{\@headwidth}% \else\edef\@tempb{foot}\ifx\@tempa\@tempb - \setlength{#1}{\@footwidth} + \setlength{#1}{\@footwidth}% \else\edef\@tempb{headtopline}\ifx\@tempa\@tempb - \setlength{#1}{\scr@headabove@linelength} + \setlength{#1}{\scr@headabove@linelength}% \else\edef\@tempb{headsepline}\ifx\@tempa\@tempb - \setlength{#1}{\scr@headbelow@linelength} + \setlength{#1}{\scr@headbelow@linelength}% \else\edef\@tempb{footsepline}\ifx\@tempa\@tempb - \setlength{#1}{\scr@footabove@linelength} + \setlength{#1}{\scr@footabove@linelength}% \else\edef\@tempb{footbotline}\ifx\@tempa\@tempb - \setlength{#1}{\scr@footbelow@linelength} + \setlength{#1}{\scr@footbelow@linelength}% \else\edef\@tempb{page}\ifx\@tempa\@tempb - \setlength{#1}{\paperwidth} + \setlength{#1}{\paperwidth}% \begingroup\expandafter\expandafter\expandafter\endgroup \expandafter\ifx\csname ta@bcor\endcsname\relax\else - \addtolength{#1}{-\ta@bcor} + \addtolength{#1}{-\ta@bcor}% \fi \else - \setlength{#1}{#2} + \setlength{#1}{#2}% \fi \fi \fi @@ -339,72 +342,72 @@ headinclude,footinclude% } \newcommand*{\deftowidthof}[2]{% \edef\@tempa{#2}\edef\@tempb{autohead}\ifx\@tempa\@tempb - \expandafter\def\csname #1\endcsname{\@headwidth} + \expandafter\def\csname #1\endcsname{\@headwidth}% \else\edef\@tempb{autofoot}\ifx\@tempa\@tempb - \expandafter\def\csname #1\endcsname{\@footwidth} + \expandafter\def\csname #1\endcsname{\@footwidth}% \else - \settowidthof{\@tempdima}{#2} - \expandafter\edef\csname #1\endcsname{\the\@tempdima} + \settowidthof{\@tempdima}{#2}% + \expandafter\edef\csname #1\endcsname{\the\@tempdima}% \fi \fi } \newcommand*{\setheadwidth}[2][\@empty]{% - \set@hf@width{head}{#1}{#2} + \set@hf@width{head}{#1}{#2} % } \newcommand*{\setfootwidth}[2][\@empty]{% - \set@hf@width{foot}{#1}{#2} + \set@hf@width{foot}{#1}{#2}% } \newcommand*{\set@hf@width}[3]{% - \settowidthof{\@tempdima}{#3} + \settowidthof{\@tempdima}{#3}% \ifdim\@tempdima>\paperwidth \PackageWarning - {scrpage} + {scrpage}% {You've set width of #1 to a value\MessageBreak greater than width of page!\MessageBreak% - I`ll reduce width of #1 to width of page} - \setlength{\@tempdima}{\paperwidth} + I`ll reduce width of #1 to width of page}% + \setlength{\@tempdima}{\paperwidth}% \else \ifdim\@tempdima<\z@ \PackageWarning - {scrpage} + {scrpage}% {You've set width of #1 to negative value!\MessageBreak% - I'll set it to 0pt} - \setlength{\@tempdima}{\z@} + I'll set it to 0pt}% + \setlength{\@tempdima}{\z@}% \fi \fi - \expandafter\edef\csname @#1width\endcsname{\the\@tempdima} - \edef\@tempa{#2} - \setlength{\@tempdima}{\textwidth} - \addtolength{\@tempdima}{-\csname @#1width\endcsname} + \expandafter\edef\csname @#1width\endcsname{\the\@tempdima}% + \edef\@tempa{#2}% + \setlength{\@tempdima}{\textwidth}% + \addtolength{\@tempdima}{-\csname @#1width\endcsname}% \ifx\@tempa\@empty \if@twoside - \setlength{\@tempdimb}{.3333333333\@tempdima} + \setlength{\@tempdimb}{.3333333333\@tempdima}% \else - \setlength{\@tempdimb}{.5\@tempdima} + \setlength{\@tempdimb}{.5\@tempdima}% \fi \else - \setlength{\@tempdimb}{#2} + \setlength{\@tempdimb}{#2}% \fi - \addtolength{\@tempdima}{-\@tempdimb} + \addtolength{\@tempdima}{-\@tempdimb}% \ifdim\@tempdimb<\z@ - \setlength{\@tempdimb}{-\@tempdimb} - \expandafter\edef\csname @odd#1shift\endcsname{-\the\@tempdimb} + \setlength{\@tempdimb}{-\@tempdimb}% + \expandafter\edef\csname @odd#1shift\endcsname{-\the\@tempdimb}% \else - \expandafter\edef\csname @odd#1shift\endcsname{\the\@tempdimb} + \expandafter\edef\csname @odd#1shift\endcsname{\the\@tempdimb}% \fi \ifdim\@tempdima<\z@ - \setlength{\@tempdima}{-\@tempdima} - \expandafter\edef\csname @even#1shift\endcsname{-\the\@tempdima} + \setlength{\@tempdima}{-\@tempdima}% + \expandafter\edef\csname @even#1shift\endcsname{-\the\@tempdima}% \else - \expandafter\edef\csname @even#1shift\endcsname{\the\@tempdima} + \expandafter\edef\csname @even#1shift\endcsname{\the\@tempdima}% \fi } -\newcommand*{\@headwidth}{\textwidth} -\newcommand*{\@oddheadshift}{\z@} -\newcommand*{\@evenheadshift}{\z@} -\newcommand*{\@footwidth}{\textwidth} -\newcommand*{\@oddfootshift}{\z@} -\newcommand*{\@evenfootshift}{\z@} +\newcommand*{\@headwidth}{\textwidth}% +\newcommand*{\@oddheadshift}{\z@}% +\newcommand*{\@evenheadshift}{\z@}% +\newcommand*{\@footwidth}{\textwidth}% +\newcommand*{\@oddfootshift}{\z@}% +\newcommand*{\@evenfootshift}{\z@}% \providecommand\pnumfont{\normalfont} \providecommand\headfont{\normalfont% } |