summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/koma-script/source-doc/scrguide.cls
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/koma-script/source-doc/scrguide.cls')
-rw-r--r--macros/latex/contrib/koma-script/source-doc/scrguide.cls154
1 files changed, 107 insertions, 47 deletions
diff --git a/macros/latex/contrib/koma-script/source-doc/scrguide.cls b/macros/latex/contrib/koma-script/source-doc/scrguide.cls
index d4c2bbb23d..ca8fca3640 100644
--- a/macros/latex/contrib/koma-script/source-doc/scrguide.cls
+++ b/macros/latex/contrib/koma-script/source-doc/scrguide.cls
@@ -38,7 +38,7 @@
% \section{Identification}
%
% \begin{macrocode}
-\ProvidesClass{scrguide}[2019/10/10 v1.15 internal KOMA-Script guide class]
+\ProvidesClass{scrguide}[2019/12/06 v1.22d internal KOMA-Script guide class]
% \end{macrocode}
%
%
@@ -94,6 +94,7 @@
%
% \begin{macro}{\KOMAProvidesFile}
% \begin{macro}{\@KOMAProvidesFile}
+% \changes{v1.22b}{2019/11/18}{\cs{ifstr} umbenannt in \cs{Ifstr}}%^^A
% Extended version of |\ProvidesFile|, that uses the date from the
% repository.
% \begin{macrocode}
@@ -104,7 +105,7 @@
}
\newcommand*{\@KOMAProvidesFile}{}
\def\@KOMAProvidesFile#1[$#2: #3-#4-#5 #6$#7]{%
- \ifstr{#2}{Date}{%
+ \Ifstr{#2}{Date}{%
\ProvidesFile{#1}[#3/#4/#5 \detokenize{#6 #7}]\relax
}{%
\ClassError{scrguide}{missmatch repository date string}{%
@@ -210,7 +211,7 @@
{headbackground}%
\AddLayersAtBeginOfPageStyle{scrheadings}{headbackground}%
\renewcommand*{\chaptermark}[1]{%
- \@mkdouble{\ifnumbered{chapter}{\chaptermarkformat}{}##1}%
+ \@mkdouble{\Ifnumbered{chapter}{\chaptermarkformat}{}##1}%
}%
\renewcommand*{\chaptermarkformat}{%
\makebox[\dimexpr \oddsidemargin+1in-.5em][r]{%
@@ -255,7 +256,7 @@
\newcommand*{\ThisCommonFile}{}%
\newcommand*{\ThisCommonLabelBase}{}
\newcommand*{\IfThisCommonLabelBase}[1]{%
- \expandafter\ifstr\expandafter{\ThisCommonLabelBase}{#1}%
+ \expandafter\Ifstr\expandafter{\ThisCommonLabelBase}{#1}%
\@firstoftwo\@secondoftwo
}
\newcommand*{\IfThisCommonLabelBaseOneOf}[1]{%
@@ -295,7 +296,7 @@
\else \expandafter\@secondoftwo \fi
}
\newcommand*{\LoadCommonFile}[1]{%
- \ifstr{\ThisCommonFile}{}{%
+ \Ifstr{\ThisCommonFile}{}{%
\def\ThisCommonFile{#1}%
\let\ThisCommonLabelBase\label@base
\@ifundefined{CommonFile@\ThisCommonFile @LabelBase}{%
@@ -652,12 +653,13 @@
% \begin{macro}{\Counter}
% \begin{macro}{\Length}
% \begin{macro}{\PLength}
+% \changes{v1.17}{2019/10/24}{\cs{setplength} verschoben}%^^A
% \begin{macro}{\FloatStyle}
% \begin{macro}{\PageStyle}
% \begin{macro}{\Variable}
% \begin{macro}{\FontElement}
% \begin{macro}{\DoHook}
-% \changes{v1.14}{2019/02/20}{neu}^^A
+% \changes{v1.14}{2019/02/20}{neu}%^^A
% \begin{macro}{\PName}
% \begin{macro}{\PValue}
% \begin{macro}{\Parameter}
@@ -1002,12 +1004,12 @@
\BeginIndex{PLength}{#1}%
\LabelPLength{#1}%
\scr@ifundefinedorrelax{%
- r@\label@desc@prefix scrlttr2-experts.cmd.setplength}{%
+ r@\label@desc@prefix scrlttr2.cmd.setplength}{%
\textMacro{setplength}%
}{%
\begingroup
\let\Macro\textMacro
- \DescRef{scrlttr2-experts.cmd.setplength}%
+ \DescRef{scrlttr2.cmd.setplength}%
\endgroup
}%
\PParameter{#1}\Parameter{\lengthname}%
@@ -1235,9 +1237,10 @@
%
% \begin{macro}{\LabelBase}
% \begin{macro}{\labelbase}
+% \changes{v1.22b}{2019/11/18}{\cs{ifstr} umbenannt in \cs{Ifstr}}%^^A
% \begin{macrocode}
\newcommand*{\labelbase}[1]{%
- \ifstr{\label@base@sec}{unknown}{}{%
+ \Ifstr{\label@base@sec}{unknown}{}{%
\labelofbase[sec]{\label@base@sec.next}%
\gdef\label@base@sec{}%
}%
@@ -1324,7 +1327,8 @@
\newcommand*{\Declaration@UseBox}[1]{%
\colorbox{Declaration}{\usebox\Declaration@Box}%
}
-\newenvironment{Declaration}{%
+\newenvironment{Declaration}[1][2]{%
+ \def\Declare@Lines{#1\baselineskip}%
% Als erstes wird eine neue Index-Gruppe begonnen. Dagegen darf die
% vorherige Index-Gruppe hier nicht automatisch geschlossen werden, weil
% beispielsweise ein Abschnitt oder ein Kapitel ebenfalls eine Index-Gruppe
@@ -1395,10 +1399,10 @@
\end{lrbox}
\vskip 1\baselineskip \@plus .75\baselineskip \@minus .25\baselineskip
% Hier darf ein Seitenumbruch ohne vertikalen Ausgleich erfolgen, wenn nicht
- % mindestens für die Deklaration und zwei Zeilen Platz ist.
- \vskip \dimexpr\ht\Declaration@Box+\dp\Declaration@Box+2\baselineskip\relax
+ % mindestens für die Deklaration und einige Zeilen Platz ist.
+ \vskip \dimexpr\ht\Declaration@Box+\dp\Declaration@Box+\Declare@Lines\relax
\penalty-\@medpenalty
- \vskip -\dimexpr\ht\Declaration@Box+\dp\Declaration@Box+2\baselineskip\relax
+ \vskip -\dimexpr\ht\Declaration@Box+\dp\Declaration@Box+\Declare@Lines\relax
\begingroup% Dann wird die erzeugte Box farbig hinterlegt leicht im linken
% Rand ausgegeben.
\parfillskip\@flushglue
@@ -1425,17 +1429,27 @@
% \end{environment}
%
% \begin{environment}{Example}
-% This environment is used for all examples at the \KOMAScript{} guide.
+% \changes{v1.15a}{2019/10/17}{Space removed}%
+% This environment is used for all examples at the \KOMAScript{} guide.
% \begin{macrocode}
\newenvironment{Example}{%
\lstset{belowskip=0pt plus 1pt minus .5pt}%
- \labeling{{\usekomafont{disposition}\GuideExample:\ }}
- \item[{\usekomafont{disposition}\GuideExample:\ }]%
+ \labeling{{\usekomafont{disposition}\GuideExample:}}
+ \item[{\usekomafont{disposition}\GuideExample:}]%
}{%
\endlabeling
}
% \end{macrocode}
% \end{environment}
+% \begin{macro}{\ExampleEndFix}
+% \changes{v1.18}{2019/10/25}{New}%^^A
+% If an example is at the end of a description and before a new description
+% the vertical spacing is suboptimal. Sorry, but this cannot be fixed
+% automatically currently. But here is a manual fix:
+% \begin{macrocode}
+\newcommand*{\ExampleEndFix}{\vskip -1\ht\strutbox plus .75\strutbox}
+% \end{macrocode}
+% \end{macro}
%
% \begin{environment}{ShowOutput}
% This environment is used for the output of examples. It shows the middle
@@ -1595,11 +1609,12 @@
% will be marked and these marks are referenced at a kind of index.
%
% \begin{macro}{\ChangedAt}
+% \changes{v1.22b}{2019/11/18}{\cs{ifstr} umbenannt in \cs{Ifstr}}%^^A
% Set the margin note and write an entry to the change log.\footnote{TODO:
% Don't use the glossary, use a file by my own.}
% \begin{macrocode}
\providecommand*{\ChangedAt}[3][]{%
- \ifstr{#1}{}{%
+ \Ifstr{#1}{}{%
\marginnote{\tiny\fbox{\strut#2}}%
}{%
\def\reserved@a##1/##2\@nil{%
@@ -1617,8 +1632,8 @@
}%
\begingroup
\let\@tempa\@empty
- \ifstr{#2}{v2.9i}{\def\@tempa{v2.90i=}}{}%
- \ifstr{#2}{v2.9t}{\def\@tempa{v2.90t=}}{}%
+ \Ifstr{#2}{v2.9i}{\def\@tempa{v2.90i=}}{}%
+ \Ifstr{#2}{v2.9t}{\def\@tempa{v2.90t=}}{}%
\let\and\ignorespaces
\def\Package##1{%
\glossary{##1=\string\Package{##1}>\@tempa#2|indexrm}%
@@ -1733,11 +1748,13 @@
% \end{environment}
%
% \begin{macro}{\start@desctab}
-% \changes{v1.7c}{2013/10/13}{\cs{leavevmode}\cs{ignorespaces} added to
-% \cs{nentry}}
-% This is the \emph{worker} macro of \texttt{desctable} and
-% \texttt{desctabular}. It does the complete calculations and definition of
-% the entry (something like |\item|) commands.
+% \changes{v1.7c}{2013/10/13}{\cs{leavevmode}\cs{ignorespaces} added to
+% \cs{nentry}}%^^A
+% \changes{v1.16}{2019/10/23}{links for plengths added}%^^A
+% \changes{v1.17}{2019/10/23}{links for variables added}%^^A
+% This is the \emph{worker} macro of \texttt{desctable} and
+% \texttt{desctabular}. It does the complete calculations and definition of
+% the entry (something like |\item|) commands.
% \begin{macrocode}
\newcommand*{\start@desctab}[1]{%
\setlength{\descwidth}{\linewidth}%
@@ -1751,11 +1768,28 @@
}%
\newcommand{\entry}[2]{\nentry{##1}{##2}[.5\baselineskip]}%
\newcommand*{\pentry}[1]{%
- \entry{\PLength{##1}\IndexPLength[indexmain]{##1}}}%
+ \entry{%
+ \scr@ifundefinedorrelax{r@\label@desc@prefix\LabelBase.plength.##1}{%
+ \ClassWarning{scrguide}{%
+ Reference `\label@desc@prefix\LabelBase.plength.##1' undefined}%
+ \PLength{##1}%
+ }{%
+ \DescRef{\LabelBase.plength.##1}%
+ }%
+ \IndexPLength[indexmain]{##1}}}%
\newcommand*{\pventry}[1]{\entry{\PValue{##1}}}%
\newcommand*{\mentry}[1]{\entry{\Macro{##1}}}%
\newcommand*{\ventry}[1]{%
- \entry{\Variable{##1}\IndexVariable[indexmain]{##1}}%
+ \entry{%
+ \scr@ifundefinedorrelax{r@\label@desc@prefix\LabelBase.variable.##1}{%
+ \ClassWarning{scrguide}{%
+ Reference `\label@desc@prefix\LabelBase.variable.##1 undefined}%
+ \Variable{##1}%
+ }{%
+ \DescRef{\LabelBase.variable.##1}%
+ }%
+ \IndexVariable[indexmain]{##1}%
+ }%
}%
\newcommand*{\feentry}[1]{%
\entry{%
@@ -1884,7 +1918,7 @@
\fi
\endgroup
\ifx\desccaptionb@xnext\desccaptionb@xfirst
- \ifthispageodd{\descpage@ddtrue}{\descpage@ddfalse}%
+ \Ifthispageodd{\descpage@ddtrue}{\descpage@ddfalse}%
\fi
\csname @desclistentryhook\endcsname
{\copy\descentryb@x}%
@@ -1935,8 +1969,10 @@
\lstdefinestyle{code}{%
language=[LaTeX]TeX,%
moretexcs={%
- @auxout,@currext,@dottedtocline,@empty,@float,@hangfrom,@ifpackagelater,
- @ifundefined,
+ @auxout,@currext,@dottedtocline,@empty,@float,
+ @gobble,@gobbletwo,
+ @hangfrom,@ifpackagelater,
+ @ifundefined,@mkboth,
@rightmark,@secondoftwo,
@tempskipa,@tempdima,@tempswafalse,@tempswatrue,
@undefined,
@@ -1945,6 +1981,7 @@
DeclareOption,DeclareRobustCommand,dimexpr,end@float,ExecuteOptions,
gluexpr,
if@filesw,if@tempswa,if@twoside,includegraphics,
+ labelformat,
MessageBreak,
numexpr,
onehalfspacing,
@@ -1966,7 +2003,8 @@
addchap,addrentry,Address,addcontentslinetoeachtocfile,
addxcontentslinetoeachtocfile,addsec,
addtoeachtocfile,
- addtokomafont,addtolengthplength,addtoreffields,addtotoclist,
+ addtokomafont,addtolengthplength,addtoplength,addtoreffields,addtotoclist,
+ addxcontentsline,
adrchar,adrentry,
AddLayersAtBeginOfPageStyle,AddLayersToPageStyle,
AddtoDoHook,AddtoOneTimeDoHook,
@@ -1976,7 +2014,8 @@
AtBeginLetter,At@startsection,
Before@sect,Before@ssect,
BeforeFamilyProcessOptions,
- BeforeClosingMainAux,BeforePackage,bib@beginhook,bib@endhook,
+ BeforeClosingMainAux,BeforePackage,BeforeStartingTOC,
+ bib@beginhook,bib@endhook,
blinddocument,blindtext,Blinddocument,Blindtext,
cc,captionabove,captionaboveof,captionbelow,captionbelowof,captionformat,
captionof,cefoot,cfoot,chapapp, chapappifchapterprefix,
@@ -2014,15 +2053,19 @@
FreeI,FreeII,FreeIII,FreeIV,
GenericMarkFormat,
headfont,headmark,
+ Ifattoclist,Ifkomavar,Ifkomavarempty,Ifstr,Ifstrstart,Ifthispageodd,
+ Ifundefinedorrelax,IfUsePrefixLine,
ifundefinedorrelax,
- ifattoclist,ifoot,ihead,ifkomavarempty,ifstr,ifthispageodd,InputAddressFile,
+ ifattoclist,ifoot,ihead,ifkomavarempty,ifstr,ifthispageodd,
+ IfActiveMkBoth,InputAddressFile,
KOMAoption,KOMAoptions,KOMAScript, l@addto@macro,
LastName,layerwidth,layerheight,lefoot,lefttopmark,leftbotmark,
leftfirstmark,lehead,LetterOptionNeedsPapersize,
LenToUnit,
lipsum,listoffigures,
listoftables,listoftoc,LoadLetterOption,lofoot,lohead,lowertitleback,
- MakeMarkcase,makenote,maketitle,manualmark,marginline,minisec,
+ MakeMarkcase,makenote,maketitle,manualmark,marginline,markleft,markdouble,
+ minisec,
multfootsep,multiplefootnoteseparator,
Name,nameday,newbibstyle,newcaptionname,newkomavar,nexthead,
ofoot,ohead,opening,othersectionlevelsformat,
@@ -2057,7 +2100,8 @@
setbibpreamble,setcapindent,setcapwidth,setcaptionalignment,
setchapterpreamble,setfootbotline,setfootsepline,setfootwidth,
setheadsepline,setheadtopline,setheadwidth,setindexpreamble,setkomafont,
- setkomavar,setlengthtoplength,setparsizes,setpartpreamble,setuptoc,
+ setkomavar,setlengthtoplength,setparsizes,setpartpreamble,
+ setplength,setuptoc,
showfields,showenvelope,showISOenvelope,showUScommercial,showUScheck,
SplitDoHook,
storeareas,StorePreventPackageFromLoading,
@@ -2073,14 +2117,15 @@
}%
}%
\lstnewenvironment{lstoutput}[1][]{%
- \lstset{style=output,basicstyle=\ttfamily\small,#1}%
+ \lstset{style=output,basicstyle=\ttfamily\codesize,#1}%
}{}%
\lstnewenvironment{lstcode}[1][]{%
- \lstset{style=KOMA,basicstyle=\ttfamily\small,#1}%
+ \lstset{style=KOMA,basicstyle=\ttfamily\codesize,#1}%
}{}%
\newcommand*{\lstinputcode}[1][]{%
- \lstinputlisting[style=KOMA,basicstyle=\ttfamily\small,#1]%
+ \lstinputlisting[style=KOMA,basicstyle=\ttfamily\codesize,#1]%
}
+\newcommand*{\codesize}{\small}
% \end{macrocode}
%
%
@@ -2101,14 +2146,15 @@ KOMAScript \endcsname
% \end{macro}
%
% \begin{macro}{\url@}
-% \changes{v1.9b}{2015/09/30}{\cs{GuideCTANserver} not needed and removed}^^A
-% Redefine to make \texttt{CTAN://} be an alias for
-% \texttt{http://mirror.ctan.org/}.
+% \changes{v1.9b}{2015/09/30}{\cs{GuideCTANserver} not needed and removed}%^^A
+% \changes{v1.22a}{2019/11/18}{https instead of http}%^^A
+% Redefine to make \texttt{CTAN://} be an alias for
+% \texttt{https://mirror.ctan.org/}.
% \begin{macrocode}
\def\url@#1{\expandafter\url@@#1\@nil}
\def\url@@#1://#2\@nil{%
\def\@tempa{#1}\def\@tempb{CTAN}\ifx\@tempa\@tempb
- \hyper@linkurl{\Hurl{#1://#2}}{http://mirror.ctan.org/#2}%
+ \hyper@linkurl{\Hurl{#1://#2}}{https://mirror.ctan.org/#2}%
\else
\hyper@linkurl{\Hurl{#1://#2}}{#1://#2}%
\fi
@@ -2505,6 +2551,7 @@ KOMAScript \endcsname
%
% \begin{macro}{\BeginIndex}
% \begin{macro}{\EndIndex}
+% \changes{v1.22b}{2019/11/18}{\cs{ifstr} umbenannt in \cs{Ifstr}}%^^A
% Its also usefull to define index range entries. These have three
% arguments. First (optiona) argument is the page number style. Default of
% this parameter is \texttt{indexmain}. See |\Index| for more information
@@ -2589,9 +2636,9 @@ KOMAScript \endcsname
\begingroup
\@tempswatrue
\def\do##1##2##3{%
- \ifstr{#1}{##1}{%
- \ifstr{#2}{##2}{%
- \ifstr{\detokenize{#3}}{\detokenize{##3}}{}{\@tempswafalse}%
+ \Ifstr{#1}{##1}{%
+ \Ifstr{#2}{##2}{%
+ \Ifstr{\detokenize{#3}}{\detokenize{##3}}{}{\@tempswafalse}%
}{\@tempswafalse}%
}{\@tempswafalse}%
\if@tempswa
@@ -2674,7 +2721,8 @@ KOMAScript \endcsname
% index with reference to that index at another index. And there are even
% entries that will be added to one index with reference to that index from
% another index and from the main index.
-% \begin{macro}{\DefineSingeIndex}
+% \begin{macro}{\DefineSingleIndex}
+% \changes{v1.22}{2019/11/14}{support \cs{PName} in second argument}%^^A
% This defines a single index entry, e.g. of commands. A macro will be
% defined that addes the entry only to one index. First (optional)
% agrument is a not, which shows the kind of entry (e.g. |\GuideMacro|). The
@@ -2687,12 +2735,24 @@ KOMAScript \endcsname
\ifx\relax#1\relax
\expandafter\newcommand\expandafter*%
\csname Index#2\endcsname[2][indexother]{%
- \Index[##1]{##2=\UseIndex{#3}#4{##2}}%
+ \begingroup
+ \let\PName\@firstofone
+ \protected@edef\reserved@a{%
+ \unexpanded{\endgroup\Index[##1]}%
+ {##2\unexpanded{=\UseIndex{#3}#4{##2}}}%
+ }%
+ \reserved@a
}%
\else
\expandafter\newcommand\expandafter*%
\csname Index#2\endcsname[2][indexother]{%
- \Index[##1]{##2 (#1)=\UseIndex{#3}#4{##2} (\protect #1)}%
+ \begingroup
+ \let\PName\@firstofone
+ \protected@edef\reserved@a{%
+ \unexpanded{\endgroup\Index[##1]}%
+ {##2 \unexpanded{(#1)=\UseIndex{#3}#4{##2} (\protect #1)}}%
+ }%
+ \reserved@a
}%
\fi
}