diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/koma-script/tocbasic.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/koma-script/tocbasic.dtx | 64 |
1 files changed, 49 insertions, 15 deletions
diff --git a/Master/texmf-dist/source/latex/koma-script/tocbasic.dtx b/Master/texmf-dist/source/latex/koma-script/tocbasic.dtx index e3d6d3a6fbd..25aa733ac46 100644 --- a/Master/texmf-dist/source/latex/koma-script/tocbasic.dtx +++ b/Master/texmf-dist/source/latex/koma-script/tocbasic.dtx @@ -1,8 +1,8 @@ -% \CheckSum{1535} +% \CheckSum{1564} % \iffalse meta-comment % ====================================================================== % tocbasic.dtx -% Copyright (c) Markus Kohm, 2008-2016 +% Copyright (c) Markus Kohm, 2008-2017 % % This file is part of the LaTeX2e KOMA-Script bundle. % @@ -20,7 +20,7 @@ % This work consists of all files listed in manifest.txt. % ---------------------------------------------------------------------- % tocbasic.dtx -% Copyright (c) Markus Kohm, 2008-2016 +% Copyright (c) Markus Kohm, 2008-2017 % % Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz, % Version 1.3c, verteilt und/oder veraendert werden. @@ -55,7 +55,7 @@ % Right brace \} Tilde \~} % % \iffalse -%%% From File: $Id: tocbasic.dtx 2499 2016-09-06 07:00:45Z kohm $ +%%% From File: $Id: tocbasic.dtx 2600 2017-02-23 12:07:58Z kohm $ %<identify>%%% (run: identify) %<prepare>%%% (run: prepare) %<option>%%% (run: option) @@ -66,7 +66,7 @@ \ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi \begingroup \def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}} - \filedate$Date: 2016-09-06 09:00:45 +0200 (Tue, 06 Sep 2016) $ + \filedate$Date: 2017-02-23 13:07:58 +0100 (Thu, 23 Feb 2017) $ \def\filerevision$#1: #2 ${\gdef\filerevision{r#2}} \filerevision$Revision: 1962 $ \endgroup @@ -118,7 +118,7 @@ \endbatchfile %</dtx> %<*driver> -\documentclass[halfparskip-]{scrdoc} +\documentclass[parskip=half-]{scrdoc} \usepackage[latin1]{inputenc} \usepackage[english]{babel} \usepackage{array} @@ -390,11 +390,29 @@ because of feature `nobabel' available\MessageBreak for `#1'}% }{% - \PackageInfo{tocbasic}{setting babel extension for `#1'}% - \expandafter\gdef\expandafter\bbl@set@language\expandafter##\expandafter1% - \expandafter{% - \bbl@set@language{##1}% - \addtocontents{#1}{\xstring\select@language{\languagename}}% +% \end{macrocode} +% \changes{v3.23}{2017/02/23}{using \cs{BabelContentsFiles} if available}^^A +% Since version 3.9a provides adding extensions to the language switch +% preparation. So it is used if it is available. +% \begin{macrocode} + \scr@ifundefinedorrelax{BabelContentsFiles}{% + \PackageInfo{tocbasic}{setting babel extension for `#1'}% + \expandafter\gdef\expandafter\bbl@set@language + \expandafter##\expandafter1% + \expandafter{% + \bbl@set@language{##1}% + \addtocontents{#1}{\xstring\select@language{\languagename}}% + }% + }{% + \@expandtwoargs\in@{,#1,}{,\BabelContentsFiles,}% + \ifin@ + \PackageInfo{tocbasic}{omitting babel extension for + `#1'\MessageBreak + because it is already in \string\BabelContentsFiles}% + \else + \PackageInfo{tocbasic}{setting babel extension for `#1'}% + \xdef\BabelContentsFiles{\BabelContentsFiles,#1}% + \fi }% }% }% @@ -841,6 +859,17 @@ % \end{macro} % \end{macro} % +% \begin{macro}{\ext@toc} +% \changes{v3.23}{2017/02/23}{use indirect extension for toc}^^A +% We do not longer hard code extension \texttt{toc} for the table of +% contents. This allowes users to change it. Classes or other packages may +% also define it. So it seems to be better to \cs{providecommand} instead of +% \cs{newcommand} here. +% \begin{macrocode} +\providecommand*{\ext@toc}{toc} +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\tocbasic@listhead} % \changes{v3.02a}{2009/01/20}{no explicite marks if ``numbered''}% % \changes{v3.09a}{2011/04/12}{again no explicite marks if ``numbered''}% @@ -868,7 +897,8 @@ \ifvmode\@tempcnta\lastpenalty\@tempskipa\lastskip\unskip\fi \begingroup \iftocfeature{\@currext}{totoc}{% - \addxcontentsline{toc}{subsection}{##1}% + \expandafter\addxcontentsline\expandafter{\ext@toc}% + {subsection}{##1}% }{}% \@ifundefined{@mkright}{% \ifx\@mkboth\@gobbletwo\else\markright{\MakeMarkcase{##1}}\fi @@ -886,7 +916,8 @@ \ifvmode\@tempcnta\lastpenalty\@tempskipa\lastskip\unskip\fi \begingroup \iftocfeature{\@currext}{totoc}{% - \addxcontentsline{toc}{section}{##1}% + \expandafter\addxcontentsline\expandafter{\ext@toc}% + {section}{##1}% }{}% \@ifundefined{@mkdouble}{% \@mkboth{\MakeMarkcase{##1}}{\MakeMarkcase{##1}}% @@ -916,7 +947,8 @@ }{% \@mkright{\MakeMarkcase{##1}}% }% - \addxcontentsline{toc}{section}{##1}% + \expandafter\addxcontentsline\expandafter{\ext@toc}% + {section}{##1}% \endgroup \ifvmode\penalty\@tempcnta\vskip\@tempskipa\fi }{% @@ -950,7 +982,8 @@ \@mkdouble{\MakeMarkcase{##1}}% }% \iftocfeature{\@currext}{totoc}{% - \addxcontentsline{toc}{chapter}{##1}% + \expandafter\addxcontentsline\expandafter{\ext@toc}% + {chapter}{##1}% }{}% \endgroup \ifvmode\penalty\@tempcnta\vskip\@tempskipa\fi @@ -1803,6 +1836,7 @@ % Tell the package, what files are used: % \begin{macrocode} \addtotoclist{toc} +\ifstr{\ext@toc}{toc}{}{\expandafter\addtotoclist\expandafter{\ext@toc}} \addtotoclist[float]{lof} \addtotoclist[float]{lot} % \end{macrocode} |