diff options
author | Karl Berry <karl@freefriends.org> | 2019-06-28 21:06:55 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-06-28 21:06:55 +0000 |
commit | 6677e7d16babf1c0596fd30f9aeb6b13433725cd (patch) | |
tree | 84163738e611a8ebcbbed7102f3efa9238211476 /Master/texmf-dist/tex/latex/tudscr/tudscrbase.sty | |
parent | 2a2ad17b85ef254d44022ec0fbcadb62cc90f431 (diff) |
tudscr (28jun19)
git-svn-id: svn://tug.org/texlive/trunk@51500 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/tudscr/tudscrbase.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/tudscr/tudscrbase.sty | 373 |
1 files changed, 215 insertions, 158 deletions
diff --git a/Master/texmf-dist/tex/latex/tudscr/tudscrbase.sty b/Master/texmf-dist/tex/latex/tudscr/tudscrbase.sty index 360fb9e9cf6..d275064a5cc 100644 --- a/Master/texmf-dist/tex/latex/tudscr/tudscrbase.sty +++ b/Master/texmf-dist/tex/latex/tudscr/tudscrbase.sty @@ -9,9 +9,9 @@ %% %% TUD-Script -- Corporate Design of Technische Universitaet Dresden %% -%% 2017/05/30 v2.05m TUD-Script +%% 2019/06/28 v2.06 TUD-Script %% -%% Copyright (C) Falk Hanisch <hanisch.latex@outlook.com>, 2012-2017 +%% Copyright (C) Falk Hanisch <hanisch.latex@outlook.com>, 2012-2019 %% %% This file was generated from file(s) of the TUD-Script bundle. %% ---------------------------------------------------------------------------- @@ -37,7 +37,7 @@ \def\@tempb##1 v##2 ##3\relax##4\relax{\gdef\TUDScriptVersionNumber{##2}}% \edef\@tempa{\TUD@Version}% \expandafter\@tempb\@tempa\relax? ? \relax\relax% - \gdef\TUD@Version@KOMA{3.17}% + \gdef\TUD@Version@KOMA{3.25}% } \else \newcommand*\TUD@Version@Check[1]{% @@ -52,73 +52,48 @@ \fi% } \fi - \TUD@Version@Check{2017/05/30 v2.05m TUD-Script} + \TUD@Version@Check{2019/06/28 v2.06 TUD-Script} \endgroup \NeedsTeXFormat{LaTeX2e} \providecommand*\tudscrmail{hanisch.latex@outlook.com} \@ifundefined{TUDScript}{% \DeclareRobustCommand\TUDScript{% - \ifdin{TUD-SCRIPT}{% - \textsf{T\kern.05em U\kern.05em D\kern.1em-\kern.1em Script}% - }\csname xspace\endcsname% + \begingroup% + \def\tud@res@b##1{T\kern.05em U\kern.05em D\kern.1em-\kern.1em ##1}% + \tud@ifdin{% + \edef\tud@res@a{\tud@res@b{SCRIPT}}% + }{% + \edef\tud@res@a{\noexpand\textsf{\tud@res@b{Script}}}% + }% + \expandafter\endgroup\tud@res@a% + \csname xspace\endcsname% }% }{} %%% From File: tudscr-base.dtx \ProvidesPackage{tudscrbase}[% - 2017/05/30 v2.05m TUD-Script + 2019/06/28 v2.06 TUD-Script package (basics for the bundle)% ] -\RequirePackage{scrbase}[2013/12/19] -\@ifpackagelater{scrbase}{2015/10/04}{}{% - \providecommand*\kernel@ifstar[1]{\kernel@ifnextchar*{\@firstoftwo{#1}}}% -} -\@ifpackagelater{scrbase}{2016/05/11}{}{% - \renewcommand*\test@@ifdimunt[1]{% - \@tempswafalse - \ifstr{#1}{pt}{\@tempswatrue}{% - \ifstr{#1}{pc}{\@tempswatrue}{% - \ifstr{#1}{in}{\@tempswatrue}{% - \ifstr{#1}{bp}{\@tempswatrue}{% - \ifstr{#1}{cm}{\@tempswatrue}{% - \ifstr{#1}{mm}{\@tempswatrue}{% - \ifstr{#1}{dd}{\@tempswatrue}{% - \ifstr{#1}{cc}{\@tempswatrue}{% - \ifstr{#1}{sp}{\@tempswatrue}{% - \ifstr{#1}{ex}{\@tempswatrue}{% - \ifstr{#1}{em}{\@tempswatrue}{% - \scr@ifpdfoutput{% - \ifstr{#1}{px}{\@tempswatrue}{}% - }{}% - }% - }% - }% - }% - }% - }% - }% - }% - }% - }% - }% - }% -} +\RequirePackage{scrbase}[2018/03/30] \RequirePackage{etoolbox}[2011/01/03] +\RequirePackage{xpatch}[2012/10/02] +\RequirePackage{letltxmacro}[2016/05/16] \RequirePackage{etexcmds}[2011/02/16] \RequirePackage{kvsetkeys}[2012/04/25] +\RequirePackage{trimspaces}[2009/09/17] \newcommand*\tud@reserved{} +\newcommand*\tud@res@a{} +\newcommand*\tud@res@b{} +\newcommand*\tud@res@c{} +\newif\if@tud@res@swa +\newcount\tud@res@cnt +\newread\tud@res@read \newtoks\tud@toks@ \newcommand*\eaddto@hook[2]{% \expandafter\addto@hook\expandafter#1\expandafter{#2}% } \newcommand*\ifxblank{\ifstr{}} -\newcommand*\ifxnumber[1]{% - \if\relax\detokenize\expandafter{\romannumeral-0#1}\relax% - \expandafter\@firstoftwo% - \else% - \expandafter\@secondoftwo% - \fi% -} \newcommand*\ifstrbool[4]{% \ifstr{#1}{true}{#2}{% \ifstr{#1}{on}{#2}{% @@ -134,21 +109,6 @@ }% }% } -\newcommand*\ifxlen[1]{% - \begingroup% - \protected@edef\@tempa{#1}% - \@tempswafalse% - \expandafter\ifisdimen\expandafter{\@tempa}{\@tempswatrue}{}% - \expandafter\ifisskip\expandafter{\@tempa}{\@tempswatrue}{}% - \expandafter\ifisdimexpr\expandafter{\@tempa}{\@tempswatrue}{}% - \if@tempswa\edef\@tempa{\the\@tempa}\fi% - \expandafter\ifdimen\expandafter{\@tempa}{% - \aftergroup\@firstoftwo% - }{% - \aftergroup\@secondoftwo% - }% - \endgroup -} \newcommand*\iflanguageloaded[1]{% \PackageWarning{tudscrbase}{% Whether package `babel' nor package `polyglossia' has been loaded% @@ -192,10 +152,10 @@ \@whiledim\dimexpr\@tempcnta\@tempdimc\relax<.01\maxdimen\do{% \multiply\@tempcnta by 10\relax% }% - \setlength{\@tempdimc}{% + \setlength\@tempdimc{% \dimexpr(\@tempcnta\@tempdima / \@tempdimb * \p@)\relax% }% - \setlength{\@tempdimc}{\dimexpr \@tempdimc/\@tempcnta\relax}% + \setlength\@tempdimc{\dimexpr \@tempdimc/\@tempcnta\relax}% \edef\@tempa{\endgroup\def\noexpand#1{\strip@pt\@tempdimc}}% \@tempa% } @@ -205,87 +165,127 @@ \expandafter\def\expandafter #1\expandafter{#1}% }% } -\newcommand*\tud@font@koma@set[2]{% - \ifcsdef{tud@font@koma@#1}{}{\addtokomafont{#1}{\csuse{tud@font@koma@#1}}}% - \csdef{tud@font@koma@#1}{#2\nobreak}% +\newcommand*\tud@komafont@set[2]{% + \ifcsdef{tud@komafont@#1}{}{\addtokomafont{#1}{\csuse{tud@komafont@#1}}}% + \csdef{tud@komafont@#1}{#2\nobreak}% } -\newcommand*\tud@font@koma@unset[1]{% - \ifcsdef{tud@font@koma@#1}{}{\addtokomafont{#1}{\csuse{tud@font@koma@#1}}}% - \csdef{tud@font@koma@#1}{\relax}% +\newcommand*\tud@komafont@unset[1]{% + \ifcsdef{tud@komafont@#1}{}{\addtokomafont{#1}{\csuse{tud@komafont@#1}}}% + \csdef{tud@komafont@#1}{\relax}% } -\newcommand*\tud@font@koma@reset[1]{% - \ifcsdef{tud@font@koma@#1}{\addtokomafont{#1}{\csuse{tud@font@koma@#1}}}{}% +\newcommand*\tud@komafont@reset[1]{% + \ifcsdef{tud@komafont@#1}{\addtokomafont{#1}{\csuse{tud@komafont@#1}}}{}% } \DefineFamily{TUD} \newcommand*\TUDProcessOptions{\FamilyProcessOptions{TUD}} \newcommand*\TUDExecuteOptions{\FamilyExecuteOptions{TUD}} \newcommand*\TUDoptions{\FamilyOptions{TUD}} \newcommand*\TUDoption{\FamilyOption{TUD}} -\newcommand*\TUD@key[1][.\@currname.\@currext]{% +\newcommand*\TUD@key[2][.\@currname.\@currext]{% + \providebool{@tud@key@#2@set}% \DefineFamilyMember[{#1}]{TUD}% - \DefineFamilyKey[{#1}]{TUD}% + \kernel@ifnextchar[%] + {\TUD@key@define{#1}{#2}}% + {\TUD@key@@define{#1}{#2}}% +} +\newcommand*\TUD@key@define{} +\def\TUD@key@define#1#2[#3]#4{% + \DefineFamilyKey[{#1}]{TUD}{#2}[{#3}]{% + #4% + \ifx\FamilyKeyState\FamilyKeyStateProcessed% + \booltrue{@tud@key@#2@set}% + \fi% + }% +} +\newcommand*\TUD@key@@define{} +\def\TUD@key@@define#1#2#3{% + \DefineFamilyKey[{#1}]{TUD}{#2}{% + #3% + \ifx\FamilyKeyState\FamilyKeyStateProcessed% + \booltrue{@tud@key@#2@set}% + \fi% + }% } -\newcommand*\TUD@ifkey[1][.\@currname.\@currext]{% - \DefineFamilyMember{TUD}% - \FamilyBoolKey[#1]{TUD}% +\newcommand*\TUD@key@preset[2]{% + \ifbool{@tud@key@#1@set}{}{% + \TUDoption{#1}{#2}% + \boolfalse{@tud@key@#1@set}% + }% } -\newcommand*\TUD@set@ifkey{\FamilySetBool{TUD}} -\newcommand*\TUD@numkey[1][.\@currname.\@currext]{% - \DefineFamilyMember{TUD}% - \FamilyNumericalKey[#1]{TUD}% +\newcommand*\TUD@set@ifkey[3]{% + \tud@lowerstring\tud@res@a{#3}% + \edef\tud@res@b{% + \etex@unexpanded{\FamilySetBool{TUD}{#1}{#2}}{\tud@res@a}% + }\tud@res@b% +} +\newcommand*\TUD@set@numkey[4]{% + \tud@lowerstring\tud@res@a{#4}% + \edef\tud@res@b{% + \etex@unexpanded{\FamilySetNumerical{TUD}{#1}{#2}{#3}}{\tud@res@a}% + }\tud@res@b% } \newcommand*\TUD@bool@numkey{% {false}{0},{off}{0},{no}{0},{true}{1},{on}{1},{yes}{1}% } -\newcommand*\TUD@set@numkey{\FamilySetNumerical{TUD}} -\newcommand*\TUD@lengthkey[1][.\@currname.\@currext]{% - \DefineFamilyMember{TUD}% - \FamilyLengthKey[#1]{TUD}% -} -\newcommand*\TUD@set@lengthkey{\FamilySetLength{TUD}} \newcommand*\TUD@set@dimenkey[3]{% - \ifxlen{#3}{% - \def#2{#3}% - \FamilyKeyStateProcessed% - }{% - \TUD@unknown@keyval{#1}{#3}{dimens}% - }% + \tud@lowerstring\tud@res@a{#3}% + \edef\tud@res@b{% + \etex@unexpanded{\FamilySetUseLengthMacro{TUD}{#1}{#2}}{\tud@res@a}% + }\tud@res@b% } \newcommand*\TUD@unknown@keyval{\FamilyUnknownKeyValue{TUD}} -\newcommand*\TUD@key@lock[2][.\@currname.\@currext]{% - \newbool{@tud@#2@locked}% - \TUD@key[{#1}]{#2}% +\newcommand*\tud@locked@newnum[2]{% + \expandafter\newcommand\expandafter*\csname#1\endcsname{#2}% + \newbool{#1@locked}% + \tud@num@set{#1}{#2}% } -\newcommand*\TUD@std@ifkey@lock[3]{% - \ifbool{@tud@#1@locked}{}{% - \TUD@set@ifkey{#1}{#2}{#3}% - \boolfalse{@tud@#1@locked}% +\newcommand*\tud@locked@num@preset[2]{% + \ifbool{#1@locked}{}{% + \tud@num@set{#1}{#2}% + \boolfalse{#1@locked}% }% } -\newcommand*\TUD@set@ifkey@lock[1]{% - \booltrue{@tud@#1@locked}% - \TUD@set@ifkey{#1}% +\newcommand*\tud@locked@num@set[2]{% + \tud@num@set{#1}{#2}% + \booltrue{#1@locked}% } -\let\TUD@std@numkey@lock\TUD@std@ifkey@lock -\newcommand*\TUD@set@numkey@lock[1]{% - \booltrue{@tud@#1@locked}% - \TUD@set@numkey{#1}% +\newcommand*\tud@num@set[2]{% + \ifcsdef{#1}{% + \ifnumber{#2}{% + \csdef{#1}{#2}% + }{% + \PackageError{tudscrbase}{% + `#2' is not a valid numerical expression% + }{% + You set the numerical expression `\@backslashchar#1'\MessageBreak% + to value `#2', which isn't numerical.% + }% + }% + }{% + \PackageError{tudscrbase}{% + `\@backslashchar#1' was never defined% + }{% + You tried using the numerical expression `\@backslashchar#1'\MessageBreak% + but you didn't define it with `\string\tud@locked@newnum'.% + }% + }% } -\newcommand*\cs@lock[2]{% - \expandafter\newcommand\expandafter*\csname#1\endcsname{#2}% - \newbool{#1@locked}% +\newcommand*\tud@locked@newbool[2][false]{% + \newbool{#2}% + \newbool{#2@locked}% + \tud@bool@set{#2}{#1}% } -\newcommand*\cs@std@lock[2]{% +\newcommand*\tud@locked@bool@preset[2]{% \ifbool{#1@locked}{}{% - \csdef{#1}{#2}% + \tud@bool@set{#1}{#2}% \boolfalse{#1@locked}% }% } -\newcommand*\cs@set@lock[2]{% - \csdef{#1}{#2}% +\newcommand*\tud@locked@bool@set[2]{% + \tud@bool@set{#1}{#2}% \booltrue{#1@locked}% } -\newcommand*\tud@setbool[2]{% +\newcommand*\tud@bool@set[2]{% \ifstrbool{#2}{\booltrue{#1}}{\boolfalse{#1}}{% \PackageError{tudscrbase}{% `#2' is not a valid boolean expression% @@ -296,54 +296,53 @@ }% }% } -\newcommand*\bool@lock[2][false]{% - \newbool{#2}% - \newbool{#2@locked}% - \tud@setbool{#2}{#1}% +\newcommand*\tud@cs@letltx[2]{% + \expandafter\expandafter\expandafter\LetLtxMacro% + \expandafter\csname #1\expandafter\endcsname\csname #2\endcsname% } -\newcommand*\bool@std@lock[2]{% - \ifbool{#1@locked}{}{% - \tud@setbool{#1}{#2}% - \boolfalse{#1@locked}% +\newrobustcmd*\tud@cs@store[1]{% + \tud@cs@check{#1}% + \ifcsdef{@@tud@#1}{}{% + \tud@cs@letltx{@@tud@#1}{#1}% }% } -\newcommand*\bool@set@lock[2]{% - \tud@setbool{#1}{#2}% - \booltrue{#1@locked}% -} -\newcommand*\tud@cmd@store[1]{% - \tud@cmd@check{#1}% - \ifcsdef{@@tud@#1}{}{\csletcs{@@tud@#1}{#1}}% -} -\newcommand*\tud@cmd@restore[1]{% - \tud@cmd@check{#1}% +\newrobustcmd*\tud@cs@restore[1]{% + \ifcsdef{#1}{}{% + \ifcsdef{@@tud@#1}{% + \cslet{#1}{\relax}% + }{}% + }% + \tud@cs@check{#1}% \ifcsdef{@@tud@#1}{% - \csletcs{#1}{@@tud@#1}% + \tud@cs@letltx{#1}{@@tud@#1}% \csundef{@@tud@#1}% }{}% } -\newcommand*\tud@cmd@reset[1]{% - \tud@cmd@check{#1}% - \ifcsdef{@@tud@#1}{\csletcs{#1}{@@tud@#1}}{}% +\newrobustcmd*\tud@cs@reset[1]{% + \tud@cs@check{#1}% + \ifcsdef{@@tud@#1}{% + \tud@cs@letltx{#1}{@@tud@#1}% + }{}% } -\newcommand*\tud@cmd@update[1]{% - \tud@cmd@check{#1}% - \ifcsdef{@@tud@#1}{\csletcs{@@tud@#1}{#1}}{}% +\newrobustcmd*\tud@cs@update[1]{% + \tud@cs@check{#1}% + \ifcsdef{@@tud@#1}{% + \tud@cs@letltx{@@tud@#1}{#1}% + }{}% } -\newcommand*\tud@cmd@use[1]{% - \tud@cmd@check{#1}% +\newrobustcmd*\tud@cs@use[1]{% + \tud@cs@check{#1}% \ifcsdef{@@tud@#1}{% \csuse{@@tud@#1}% }{% \csuse{#1}% }% } -\newcommand*\tud@cmd@check[1]{% +\newrobustcmd*\tud@cs@check[1]{% \ifcsdef{#1}{}{% - \PackageError{% - tudscrbase% - }{`\@backslashchar#1' is not defined}{% - The command `\@backslashchar#1' was never defined\MessageBreak% + \PackageError{tudscrbase}{% + `\@backslashchar#1' is not defined}{% + The command `\@backslashchar#1' was never defined.\MessageBreak% Please contact the TUD-Script maintainer\MessageBreak% via \tudscrmail. A bugfix is urgently required.% }% @@ -412,7 +411,7 @@ argument of \string\TUD@parameter@family\space has to be\MessageBreak% a unique family name. Alternatively, you can specify\MessageBreak% the family name within the optional argument of\MessageBreak% - \@backslashchar#2. + \@backslashchar#2.% }% }{}% } @@ -428,13 +427,13 @@ \newcommand*\TUD@parameter@nokey{@nokey@} \newcommand*\TUD@parameter@set[2]{% \IfArgIsEmpty{#2}{}{% - \def\@tempb{}% + \let\@tempb\@empty% \def\@tempa##1{% \@expandtwoargs\in@{=}{##1}% \ifin@% \appto\@tempb{##1,}% \else% - \begingroup + \begingroup% \let\IeC\@firstofone% \def\"####1{####1e}% \def\ss{ss}% @@ -478,7 +477,7 @@ }% \appto\@tempa{% \ifstr{\kv@value}{twocolumn}{\def\kv@value{2}}{}% - \ifxnumber{\kv@value}{\def\tud@reserved{columns=\kv@value}}{}% + \ifnumber{\kv@value}{\def\tud@reserved{columns=\kv@value}}{}% \iflanguageloaded{\kv@value}{\def\tud@reserved{language=\kv@value}}{}% \ifx\tud@reserved\relax% \PackageError{tudscrbase}{% @@ -486,7 +485,7 @@ }{% If `\kv@value' is a language, you haven't loaded it.\MessageBreak% Otherwise, there's no handler for the given value.\MessageBreak% - You should specify a certian key (<key>=\kv@value). + You should specify a certian key (<key>=\kv@value).% }% \fi% }% @@ -504,6 +503,64 @@ }% } \newcommand*\TUD@UnwindPackage[2]{\AtEndPreamble{\@ifpackageloaded{#1}{}{#2}}} +\@onlypreamble\TUD@UnwindPackage +\newcommand*\TUD@CheckPackage[2]{% + \tud@if@packagelater@exists{#1}{#2}{}{% + \PackageWarningNoLine{tudscrbase}{% + The version `#2' of package `#1'\MessageBreak% + is urgently required. An erroneous output\MessageBreak + may occur. Please update your distribution% + }% + \IfFileExists{#1.\@pkgextension}{}{\RequirePackage{#1}[#2]}% + }% +} +\@onlypreamble\TUD@CheckPackage +\newcommand*\tud@if@packagelater@exists[2]{% + \begingroup% + \let\tud@res@a\@empty% + \def\tud@res@b[##1]{\def\tud@res@a{##1}}% + \def\ProvidesPackage##1{% + \@ifnextchar[%] + {\tud@res@b}{\tud@res@b[]}% + }% + \IfFileExists{#1.\@pkgextension}{% + \openin\tud@res@read=#1.\@pkgextension% + \@tud@res@swatrue% + \loop% + \read\tud@res@read to\tud@res@c% + \@expandtwoargs\in@{\string\ProvidesPackage}% + {\expandafter\detokenize\expandafter{\tud@res@c}}% + \ifin@% + \@tud@res@swafalse% + \tud@res@c% + \fi% + \ifeof\tud@res@read\@tud@res@swafalse\fi% + \if@tud@res@swa% + \repeat% + \closein\tud@res@read% + }{}% + \edef\tud@res@a{\endgroup\noexpand\@ifl@t@r{\tud@res@a}{#2}} + \tud@res@a% +} +\@onlypreamble\tud@if@packagelater@exists +\newcommand*\TUD@RecommendPackage[1]{% + \kernel@ifnextchar[%] + {\TUD@@RecommendPackage#1}% + {\TUD@@RecommendPackage#1[]}% +} +\@onlypreamble\TUD@RecommendPackage +\newcommand*\TUD@@RecommendPackage{} +\def\TUD@@RecommendPackage#1[#2]{% + \IfFileExists{#1.sty}{% + \RequirePackage{#1}[#2]% + }{% + \PackageWarning{tudscrbase}{% + The usage of package `#1' (#2) is\MessageBreak% + recommended but it isn't installed% + }% + }% +} +\@onlypreamble\TUD@@RecommendPackage \newcommand*\TUD@AfterPackage@set[1]{% \newbool{@tud@#1@loaded}% \AfterPackage!{#1}{\booltrue{@tud@#1@loaded}}% @@ -524,16 +581,16 @@ }% } \newcommand*\TUD@KOMAoptions[1]{} -\ifdef{\KOMAClassName}{% - \let\TUD@KOMAoptions\KOMAoptions -}{% +\ifundef{\KOMAClassName}{% \renewcommand*\TUD@KOMAoptions[1]{% \PackageWarning{tudscrbase}{% You should load package `scrextend' right after the\MessageBreak% documentclass. Option \string\TUD@KOMAoptions{`#1'} is gobbled% }% }% - \AfterPackage*{scrextend}{\let\TUD@KOMAoptions\KOMAoptions} + \AfterPackage*{scrextend}{\let\TUD@KOMAoptions\KOMAoptions}% +}{% + \let\TUD@KOMAoptions\KOMAoptions% } \endinput %% |