diff options
Diffstat (limited to 'macros/latex/contrib/koma-script/source/scrtime.dtx')
-rw-r--r-- | macros/latex/contrib/koma-script/source/scrtime.dtx | 363 |
1 files changed, 172 insertions, 191 deletions
diff --git a/macros/latex/contrib/koma-script/source/scrtime.dtx b/macros/latex/contrib/koma-script/source/scrtime.dtx index 9829fe01ce..5626f14692 100644 --- a/macros/latex/contrib/koma-script/source/scrtime.dtx +++ b/macros/latex/contrib/koma-script/source/scrtime.dtx @@ -1,8 +1,7 @@ -% \CheckSum{311} % \iffalse % ====================================================================== % scrtime.dtx -% Copyright (c) Markus Kohm, 1995-2019 +% Copyright (c) Markus Kohm, 1995-2022 % % This file is part of the LaTeX2e KOMA-Script bundle. % @@ -18,52 +17,16 @@ % The Current Maintainer and author of this work is Markus Kohm. % % This work consists of all files listed in manifest.txt. -% ---------------------------------------------------------------------- -% scrtime.dtx -% Copyright (c) Markus Kohm, 1995-2019 -% -% Dieses Werk darf nach den Bedingungen der LaTeX Project Public Lizenz, -% Version 1.3c, verteilt und/oder veraendert werden. -% Die neuste Version dieser Lizenz ist -% http://www.latex-project.org/lppl.txt -% und Version 1.3c ist Teil aller Verteilungen von LaTeX -% Version 2005/12/01 oder spaeter und dieses Werks. -% -% Dieses Werk hat den LPPL-Verwaltungs-Status "author-maintained" -% (allein durch den Autor verwaltet). -% -% Der Aktuelle Verwalter und Autor dieses Werkes ist Markus Kohm. -% -% Dieses Werk besteht aus den in manifest.txt aufgefuehrten Dateien. % ====================================================================== -% \fi -% -% \CharacterTable -% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z -% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z -% Digits \0\1\2\3\4\5\6\7\8\9 -% Exclamation \! Double quote \" Hash (number) \# -% Dollar \$ Percent \% Ampersand \& -% Acute accent \' Left paren \( Right paren \) -% Asterisk \* Plus \+ Comma \, -% Minus \- Point \. Solidus \/ -% Colon \: Semicolon \; Less than \< -% Equals \= Greater than \> Question mark \? -% Commercial at \@ Left bracket \[ Backslash \\ -% Right bracket \] Circumflex \^ Underscore \_ -% Grave accent \` Left brace \{ Vertical bar \| -% Right brace \} Tilde \~} -% -% \iffalse -%%% From File: $Id: scrtime.dtx 3256 2019-10-10 07:06:49Z kohm $ +%%% From File: $Id: scrtime.dtx 3688 2022-02-10 08:26:37Z kohm $ %<package&identify>\NeedsTeXFormat{LaTeX2e}[1995/06/01] %<*driver> \ifx\ProvidesFile\undefined\def\ProvidesFile#1[#2]{}\fi \begingroup \def\filedate$#1: #2-#3-#4 #5${\gdef\filedate{#2/#3/#4}} - \filedate$Date: 2019-10-10 09:06:49 +0200 (Thu, 10 Oct 2019) $ + \filedate$Date: 2022-02-10 09:26:37 +0100 (Do, 10. Feb 2022) $ \def\filerevision$#1: #2 ${\gdef\filerevision{r#2}} - \filerevision$Revision: 3256 $ + \filerevision$Revision: 3688 $ \endgroup \ProvidesFile{scrtime.dtx}[\filedate\space\filerevision\space %</driver> @@ -111,63 +74,71 @@ \endbatchfile %</dtx> %<*driver> -\documentclass{scrdoc} -\usepackage[german,english]{babel} -\CodelineIndex -\RecordChanges -\GetFileInfo{scrtime.dtx} -\title{The \textsf{KOMA}-timedate-bundle\thanks{This file has - revision number \fileversion, last revised \filedate.}} -\author{Markus Kohm} -\date{\filedate} +\documentclass[USenglish]{koma-script-source-doc} +\usepackage{babel} +\setcounter{StandardModuleDepth}{2} \begin{document} - \maketitle - \begin{abstract} - This bundle includes a package \texttt{scrtime} defining some macros to - handle compilation-time. It's a very simple implementation similar to - \texttt{time.sty}. I've tried to use no additional register. - - The second package \texttt{scrdate} defines some macros to handle the name - of the day! - \end{abstract} - \tableofcontents \DocInput{scrtime.dtx} \end{document} %</driver> % \fi % +% \changes{v3.36}{2022/02/07}{switch over from \cls*{scrdoc} to +% \cls*{koma-script-source-doc}} +% \changes{v3.36}{2022/02/07}{require package \pkg*{scrlogo} instead of +% defining \cs{KOMAScript}} +% +% \GetFileInfo{scrtime.dtx} +% \title{The Current Time and Name of the Day with +% \href{https://komascript.de}{\KOMAScript} Packages \pkg*{scrtime} and +% \pkg*{scrdate}} +% \author{\href{mailto:komascript@gmx.info}{Markus Kohm}} +% \date{Revision \fileversion{} of \filedate} +% \maketitle +% \begin{abstract} +% This bundle includes a package \pkg*{scrtime} defining some macros to +% handle compilation-time. It's a very simple implementation similar to +% \pkg{time}. I've tried to not use additional registers. +% +% The second package \pkg*{scrdate} defines some macros to handle the name +% of the day! +% \end{abstract} % \tableofcontents % -% \section{Introduction} +% \section{User Manual} % -% See the \KOMAScript{} guide for informations about how to use the package. +% You can find the user manuals of \pkg*{scrtime} and \pkg*{scrdate} in the +% \KOMAScript{} manual, either the German \file{scrguide} or the English +% \file{scrguien}. % -% \StopEventually{\PrintIndex\PrintChanges} +% \MaybeStop{\PrintIndex} % % \section{Implementation} % % \subsection{Options} % -% \iffalse +% Since version~1.2 both packages use \pkg*{scrkbase} for options and +% additional features. This is loaded by the \file{ins}-file, so we don't need +% to load it here. +% +% \begin{macrocode} %<*option> -% \fi -% Since version~1.2 both packages use \textsf{scrkbase} for options and -% additional features. +% \end{macrocode} % % -% \subsubsection{Options of \textsf{scrtime}} +% \subsubsection{Options of \pkg*{scrtime}} % -% \iffalse +% \begin{macrocode} %<*scrtime> -% \fi +% \end{macrocode} % % \begin{option}{12h} -% \changes{v1.1b}{1995/02/15}{Option \texttt{12h} added.} -% \changes{v1.2}{2010/03/10}{Option uses \textsf{scrkbase}.} +% \changes{v1.1b}{1995/02/15}{Option \opt{12h} added.} +% \changes{v1.2}{2010/03/10}{Option uses \pkg*{scrkbase}.} % \begin{option}{24h} -% \changes{v1.1b}{1995/02/15}{Option \texttt{24h} added.} +% \changes{v1.1b}{1995/02/15}{Option \opt{24h} added.} % \changes{v1.2}{2010/03/10}{Option is deprecated.} -% \begin{macro}{\if@Hxii} +% \begin{macro}{\if@Hxii,\@Hxiitrue,\@Hxiifalse} % \changes{v1.1b}{1995/02/15}{new switch} % There are two the two Options |24h| and |12h|. We need a switch to % distinguish. @@ -175,8 +146,7 @@ \newif\if@Hxii % \end{macrocode} % \end{macro} -% -% So the Options are simple. +% So the options are simple. % \begin{macrocode} \KOMA@ifkey{12h}{@Hxii} \KOMA@DeclareDeprecatedOption[scrtime]{24h}{12h=false} @@ -184,35 +154,37 @@ % \end{option} % \end{option} % -% Currently only \textsf{scrtime} uses options, so only \textsf{scrtime} needs +% Currently only \pkg*{scrtime} uses options, so only \pkg*{scrtime} needs % to process them. % \begin{macrocode} \KOMAProcessOptions\relax % \end{macrocode} % -% \iffalse +% \begin{macrocode} %</scrtime> +% \end{macrocode} +% +% \begin{macrocode} %</option> -% \fi +% \end{macrocode} % -% \subsection{Macros} % -% \iffalse +% \subsection{Commands and Macros} +% +% \begin{macrocode} %<*body> -% \fi +% \end{macrocode} +% +% \subsubsection{Commands and Macros of \pkg*{scrtime}} % -% \subsubsection{Macros of \textsf{scrtime}} -% \iffalse +% \begin{macrocode} %<*scrtime> -% \fi -% We use |\@tempcnta| and |\@tempcntb| but we know, that this is not -% a very good idea. -% -% \begin{macro}{\thistime} -% \changes{v1.1b}{1995/02/15}{{\cmd\thistime*} added.}%^^A -% \changes{v1.1b}{1995/02/15}{{\cmd\thistime} works.}%^^A -% \changes{v3.20}{2016/04/12}{\cs{@ifstar} durch \cs{kernel@ifstar} -% ersetzt}%^^A +% \end{macrocode} +% +% \begin{command}{\thistime} +% \changes{v1.1b}{1995/02/15}{\cs{thistime*} added} +% \changes{v1.1b}{1995/02/15}{\cs{thistime} fixed} +% \changes{v3.20}{2016/04/12}{\cs{@ifstar} replaced by \cs{kernel@ifstar}} % First we have to decide, is it a star-version ore not. % \begin{macrocode} \def\thistime{% @@ -220,8 +192,11 @@ {\let\@tempif\iffalse\@thistime} {\let\@tempif\iftrue\@thistime}} % \end{macrocode} -% Know we have to calculate the hours and minutes. |\@tempcnta| are the -% hours and |\@tempcntb| are the minutes. +% \begin{macro}{\@thistime} +% \changes{v1.1b}{1995/02/15}{added} +% Know we have to calculate the hours and minutes. \cs{@tempcnta} are the +% hours and \cs{@tempcntb} are the minutes. We use a group to encapsulate the +% usage of the two local counters of from the \LaTeX{} kernel. % \begin{macrocode} \newcommand*{\@thistime}[1][:]{% \begingroup @@ -230,8 +205,8 @@ \divide\@tempcnta60 % \end{macrocode} % If we use 12h-mode, we have to cut the houres. -% \changes{v1.1d}{1996/01/14}{Space added at \cs{@thistime} between -12 -% and \cs{fi} (Martin Schroeder).} +% \changes{v1.1d}{1996/01/14}{space added at \cs{@thistime} between -12 +% and \cs{fi} (Martin Schroeder)} % \begin{macrocode} \if@Hxii\ifnum\@tempcnta>12 \advance\@tempcnta-12 \fi\fi % \end{macrocode} @@ -241,56 +216,57 @@ \the\@tempcnta{#1}\@tempif\ifnum\@tempcntb<10 0\fi\fi\the\@tempcntb% \endgroup} % \end{macrocode} -% \end{macro} -% -% \begin{macro}{\settime} -% \changes{v1.1b}{1995/02/15}{{\cmd\settime} redefines {\cmd\@thistime}} +% \end{macro} +% \end{command} +% +% \begin{command}{\settime} +% \changes{v1.1b}{1995/02/15}{redefines \cs{@thistime}} % \changes{v1.1c}{1995/05/24}{missing macrocode-environment inserted} -% We simply have to set |\thistime|. +% We simply have to set \cs{@thistime}. % \begin{macrocode} \newcommand*{\settime}[1]{\renewcommand*{\@thistime}[1][]{#1}} % \end{macrocode} -% \end{macro} +% \end{command} % % -% \iffalse +% \begin{macrocode} %</scrtime> -% \fi -% +% \end{macrocode} +% % -% \subsubsection{Macros of \textsf{scrdate}} +% \subsubsection{Commands and Macros of \pkg*{scrdate}} % -% \iffalse +% \begin{macrocode} %<*scrdate> -% \fi -% -% \changes{v1.1a}{1995/02/12}{Changed simply all but the user-interface.} -% \changes{v3.05a}{2010/03/10}{Changed simply everything.} -% Since version~3.05a \textsf{scrdate} was rewritten. First step was to make +% \end{macrocode} +% +% \changes{v1.1a}{1995/02/12}{changed all but the user-interface} +% \changes{v3.05a}{2010/03/10}{changed everything} +% With version~3.05a \pkg*{scrdate} was rewritten. First step was to make % more macros full expandable to provide \cs{MakeUppercase} and % \cs{MakeLowercase}. Second was to extend the user interface by some new % functionality. % -% \begin{macro}{\CenturyPart} -% \changes{v3.05a}{2010/03/10}{New} +% \begin{command}{\CenturyPart} +% \changes{v3.05a}{2010/03/10}{added} % This is the century part of a year number and so only a shortcut to -% |\XdivY{...}{100}|, that is defined at \textsf{scrbase}. +% |\XdivY{...}{100}|, that is defined at \pkg*{scrbase}. % \begin{macrocode} \newcommand*{\CenturyPart}[1]{\XdivY{#1}{100}} % \end{macrocode} -% \end{macro} -% -% \begin{macro}{\DecadePart} -% \changes{v3.05a}{2010/03/10}{New} +% \end{command} +% +% \begin{command}{\DecadePart} +% \changes{v3.05a}{2010/03/10}{added} % This is the year number withoud the century part and therefrso only a -% shortcut to |\XmodY{...}{100}|, that is defined at \textsf{scrbase}. +% shortcut to |\XmodY{...}{100}|, that is defined at \pkg*{scrbase}. % \begin{macrocode} \newcommand*{\DecadePart}[1]{\XmodY{#1}{100}} % \end{macrocode} -% \end{macro} -% +% \end{command} +% % \begin{macro}{\@GaussYear} -% \changes{v3.05a}{2010/03/10}{New (internal)} +% \changes{v3.05a}{2010/03/10}{added} % At the Gauss calculation of the day of the week January and February relates % to the year before. This macro does the correction for any date. % \begin{macrocode} @@ -310,8 +286,8 @@ % \end{macrocode} % \end{macro} % -% \begin{macro}{\DayNumber} -% \changes{v3.05a}{2010/03/10}{New} +% \begin{command}{\DayNumber} +% \changes{v3.05a}{2010/03/10}{added} % Returns the numerical value of the day of week. Note, that Sunday is 0, % Monday is 1, \dots, Saturday is 6. We use the Gauss calculation of the day % of the week. First argument is the year, second the month and last the day @@ -338,93 +314,93 @@ }{7}% } % \end{macrocode} -% \end{macro} -% \begin{macro}{\ISODayNumber} -% \changes{v3.05a}{2010/03/10}{New} -% Das gleiche wie \cs{DayNumber} aber mit einem ISO-Datum als Argument. +% \end{command} +% \begin{command}{\ISODayNumber} +% \changes{v3.05a}{2010/03/10}{added} +% The same like \cs{DayNumber} but with ISO date argument. % \begin{macrocode} \newcommand*{\ISODayNumber}[1]{\expandafter\@IsoDayNumber#1\@nil} % \end{macrocode} % \begin{macro}{\@IsoDayNumber} -% \changes{v3.05a}{2010/03/10}{New (internal)} +% \changes{v3.05a}{2010/03/10}{added} % \begin{macrocode} \newcommand*{\@IsoDayNumber}{} \def\@IsoDayNumber#1-#2-#3\@nil{\DayNumber{#1}{#2}{#3}} % \end{macrocode} % \end{macro} -% \end{macro} -% -% \begin{macro}{\DayName} -% \changes{v3.05a}{2010/03/10}{New} +% \end{command} +% +% \begin{command}{\DayName} +% \changes{v3.05a}{2010/03/10}{added} % Returns the name of the day of the week. Arguments like \cs{DayNumber}. % \begin{macrocode} \newcommand*{\DayName}[3]{\@dayname{\DayNumber{#1}{#2}{#3}}} % \end{macrocode} -% \end{macro} -% \begin{macro}{\ISODayName} -% \changes{v3.05a}{2010/03/10}{New} -% Das gleiche wie \cs{DayName} aber mit einem ISO-Datum als Argument. +% \end{command} +% \begin{command}{\ISODayName} +% \changes{v3.05a}{2010/03/10}{added} +% The same like \cs{DayName} but with ISO date argument. % \begin{macrocode} \newcommand*{\ISODayName}[1]{\@dayname{\ISODayNumber{#1}}} % \end{macrocode} -% \end{macro} -% -% \begin{macro}{\DayNameByNumber} -% \changes{v3.05a}{2010/03/10}{New} +% \end{command} +% +% \begin{command}{\DayNameByNumber} +% \changes{v3.05a}{2010/03/10}{added} % Returns the name of the day of the week. The argument is a number that will -% be transposed to the range 0..6. +% be transposed to the range 0\dots6. % \begin{macrocode} \newcommand*{\DayNameByNumber}[1]{% \@dayname{\XmodY{#1}{7}}% } % \end{macrocode} -% \end{macro} +% \end{command} % -% \begin{macro}{\ISOToday} -% \changes{v3.05a}{2010/03/10}{New} +% \begin{command}{\ISOToday} +% \changes{v3.05a}{2010/03/10}{added} % Returns the ISO date. % \begin{macrocode} \newcommand*{\ISOToday}{% \the\year-\ifnum \month<10 0\fi\the\month-\ifnum \day<10 0\fi\the\day% } % \end{macrocode} -% \end{macro} +% \end{command} % -% \begin{macro}{\IsoToday} -% \changes{v3.05a}{2010/03/10}{New} +% \begin{command}{\IsoToday} +% \changes{v3.05a}{2010/03/10}{added} % Returns the ISO date. % \begin{macrocode} \newcommand*{\IsoToday}{% \the\year-\the\month-\the\day% } % \end{macrocode} -% \end{macro} +% \end{command} % -% \begin{macro}{\todaysname} -% \changes{v3.05a}{2010/03/10}{Rewritten} +% \begin{command}{\todaysname} +% \changes{v3.05a}{2010/03/10}{re-implemented} % Using \cs{DayName} this is very, very simple. % \begin{macrocode} \newcommand*{\todaysname}{\DayName{\year}{\month}{\day}} % \end{macrocode} -% \end{macro} +% \end{command} % -% \begin{macro}{\todaysnumber} -% \changes{v3.05a}{2010/03/11}{New} +% \begin{command}{\todaysnumber} +% \changes{v3.05a}{2010/03/11}{added} % Using \cs{DayNumber} this is very, very simple. % \begin{macrocode} \newcommand*{\todaysnumber}{\DayNumber{\year}{\month}{\day}} % \end{macrocode} -% \end{macro} +% \end{command} % -% \begin{macro}{\nameday} -% \changes{v3.05a}{2010/03/10}{Not longer \cs{long}} -% We simply have to redefine |\todaysname| +% \begin{command}{\nameday} +% \changes{v3.05a}{2010/03/10}{no longer \cs{long}} +% We simply have to redefine \cs{todaysname}. % \begin{macrocode} \newcommand\nameday[1]{\renewcommand*{\todaysname}{#1}} % \end{macrocode} -% \end{macro} +% \end{command} % -% \begin{macro}{\newdaylanguage} +% \begin{command}{\newdaylanguage} % \changes{v3.05a}{2010/03/10}{Sunday is 0} % We write a macro to define the name of the days. % \begin{macro}{\scrdate@languagenamewarning} @@ -452,11 +428,11 @@ \PackageInfoNoLine{scrdate}{Language #1\space not defined.\MessageBreak \protect\dayname@#1\space skipped}% % \end{macrocode} -% \changes{v1.1c}{1995/05/24}{missing \cs{end\{macrocode\}} added.} +% \changes{v1.1c}{1995/05/24}{missing \cs{end\{macrocode\}} added} % If it is defined, we define the name-selection-macro -% |\dayname@|\emph{language}. -% First we define the new macro |\dayname@|\emph{language}: -% \changes{v3.05a}{2010/03/10}{Group removed.} +% \cs{dayname@\meta{language}}. +% First we define the new macro \cs{dayname@\meta{language}}: +% \changes{v3.05a}{2010/03/10}{group removed} % \changes{v3.15}{2014/12/11}{more robust \cs{ifcase}} % \begin{macrocode} }{% @@ -465,12 +441,12 @@ #8\or #2\or #3\or #4\or #5\or #6\or #7\fi% }% % \end{macrocode} -% Then we define, what to do at |\begin{document}|: +% Then we define, what to do at \cs{begin\{document\}}: % \begin{macrocode} \AtBeginDocument{% % \end{macrocode} -% There we first have to test, if |\date|\emph{language} is defined -% (e.g. using |german.sty|). If not, we have to warn once more. +% There we first have to test, if \cs{date\meta{language}} is defined +% (e.g. using package \pkg{german}). If not, we have to warn once more. % \begin{macrocode} \scr@ifundefinedorrelax{date#1}{% \PackageInfoNoLine{scrdate} @@ -482,21 +458,19 @@ % \begin{macrocode} }{% % \end{macrocode} -% There we first save |\date|\emph{language} as |\D@date|\emph{language}. -% This is a bit tricky, but I think, you'll understand it. +% There we first save \cs{date\meta{language}} as \cs{D@date\meta{language}}. % \begin{macrocode} \expandafter\let\csname D@date#1\expandafter\endcsname \csname date#1\endcsname % \end{macrocode} -% Now we redefine |\date|\emph{language}. It first defines |\@dayname| and -% then calls saved macro. If you've understand the definition before, you'll -% understand this tricky one, too. +% Now we redefine \cs{date\meta{language}}. It first defines \cs{@dayname} and +% then calls saved macro. % \begin{macrocode} \@namedef{date#1}{% \expandafter\let\expandafter\@dayname\csname dayname@#1\endcsname \@nameuse{D@date#1}}% % \end{macrocode} -% Last we have to select this new |\date|\emph{language}. +% Last we have to select this new \cs{date\meta{language}}. % \changes{v1.1j}{2000/01/20}{use of \cs{languagename} if defined} % \changes{v3.08b}{2011/03/31}{one \% added} % \begin{macrocode} @@ -515,13 +489,14 @@ }% } % \end{macrocode} -% \end{macro} -% +% \end{command} +% % \begin{macro}{\@dayname} % This should be named selecting the language. Since I changed the definitions -% |german.sty| and equal may be loaded before or after |scrdate.sty| or not. +% package \pkg{german} and equal may be loaded before or after \pkg*{scrdate} +% or not. % -% First we define the usual languages using |\newdaylanguage|: +% First we define the usual languages using \cs{newdaylanguage}: % \begin{macro}{\dayname@german} % \begin{macrocode} \newdaylanguage{german}{Montag}{Dienstag}{Mittwoch} @@ -758,7 +733,7 @@ % \end{macrocode} % \end{macro} % -% Last but not least file \texttt{scrdate.cfg} has to be included, +% Last but not least file \file{scrdate.cfg} has to be included, % if it exists. % \begin{macrocode} \InputIfFileExists{scrdate.cfg} @@ -768,17 +743,23 @@ {} % \end{macrocode} % -% \iffalse +% \begin{macrocode} %</scrdate> -%</body> -% \fi +% \end{macrocode} % +% \begin{macrocode} +%</body> +% \end{macrocode} +% % \Finale -% -\endinput -% -% Ende der Datei `scrtime.dtx' -%%% Local Variables: -%%% mode: doctex -%%% TeX-master: t -%%% End: +% \PrintChanges +% +% \endinput +% Local Variables: +% mode: doctex +% ispell-local-dictionary: "en_US" +% eval: (flyspell-mode 1) +% TeX-master: t +% TeX-engine: luatex-dev +% eval: (setcar (or (cl-member "Index" (setq-local TeX-command-list (copy-alist TeX-command-list)) :key #'car :test #'string-equal) (setq-local TeX-command-list (cons nil TeX-command-list))) '("Index" "mkindex %s" TeX-run-index nil t :help "makeindex for dtx")) +% End: |