diff options
author | Karl Berry <karl@freefriends.org> | 2019-11-17 22:38:43 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-11-17 22:38:43 +0000 |
commit | 8a79552abe489b9b36d0986944dfc616595e63a4 (patch) | |
tree | 2ec6544e4c2edc1f083f193fbc09520abaca25c4 /Master/texmf-dist/source/latex | |
parent | a319b877e3db590613748f78848498aea73114dc (diff) |
datetime2 (17nov19)
git-svn-id: svn://tug.org/texlive/trunk@52846 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex')
-rw-r--r-- | Master/texmf-dist/source/latex/datetime2/datetime2.dtx | 162 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/datetime2/datetime2.ins | 2 |
2 files changed, 141 insertions, 23 deletions
diff --git a/Master/texmf-dist/source/latex/datetime2/datetime2.dtx b/Master/texmf-dist/source/latex/datetime2/datetime2.dtx index 401236b8d04..75c965671fb 100644 --- a/Master/texmf-dist/source/latex/datetime2/datetime2.dtx +++ b/Master/texmf-dist/source/latex/datetime2/datetime2.dtx @@ -1,13 +1,13 @@ %\iffalse % datetime2.dtx generated using makedtx version 1.2 (c) Nicola Talbot % Command line args: -% -src "datetime2.sty\Z=>datetime2.sty" -% -src "datetime2-calc.sty\Z=>datetime2-calc.sty" +% -author "Nicola Talbot" % -doc "datetime2-manual.tex" % -section "chapter" -% -author "Nicola Talbot" +% -src "datetime2.sty\Z=>datetime2.sty" +% -src "datetime2-calc.sty\Z=>datetime2-calc.sty" % datetime2 -% Created on 2019/10/21 11:37 +% Created on 2019/11/11 18:31 %\fi %\iffalse %<*package> @@ -47,7 +47,7 @@ pdfauthor={Nicola L.C. Talbot}, pdftitle={datetime2: date and time formats}]{hyperref} -\CheckSum{2622} +\CheckSum{2658} \RecordChanges \DisableCrossrefs @@ -91,11 +91,11 @@ % %\MakeShortVerb{"} % -%\title{datetime2 v1.5.4: +%\title{datetime2 v1.5.5: %date and time formats} %\author{Nicola L. C. Talbot\\\url{http://www.dickimaw-books.com/}} % -%\date{2019-10-21} +%\date{2019-11-11} %\maketitle % %\begin{abstract} @@ -399,6 +399,12 @@ %this is to first save the date and then use it (see %\sectionref{sec:store}). % +%Some regional styles may end the date with a period (full stop). +%This can cause a problem if the date occurs at the end of a +%sentence. If the style has used \cs{DTMfinaldot} then you can use +%\cs{DTMdate*} to suppress the terminating period if required. (See +%below.) +% %Examples (with the \pkgopt{showdow} package option set): %\begin{itemize} %\item Ignore day of week: @@ -531,7 +537,30 @@ %\begin{definition}[\DescribeMacro\DTMDate] %\cs{DTMDate}\marg{date} %\end{definition} -%In these cases the date should be provided as +%As from v1.5.5 there are also starred versions of these commands: +%\begin{definition}[\DescribeMacro{\DTMdate*}] +%\cs{DTMdate*}\marg{date} +%\end{definition} +%which essentially behaves like: +%\begin{display} +%\string{\cs{let}\cs{DTMfinaldot}\cs{empty}\cs{DTMdate}\marg{date}\string} +%\end{display} +%and +%\begin{definition}[\DescribeMacro{\DTMDate*}] +%\cs{DTMDate*}\marg{date} +%\end{definition} +%which essentially behaves like: +%\begin{display} +%\string{\cs{let}\cs{DTMfinaldot}\cs{empty}\cs{DTMDate}\marg{date}\string} +%\end{display} +%These commands are provided for date styles that use +%\cs{DTMfinaldot} to produce a period (full stop) at the end of the date. These +%two star-commands may be used at the end of a sentence to prevent +%a double period. Note that there is no equivalent starred form of +%\cs{DTMdisplaydate} or \cs{DTMDisplaydate}. (It would break their +%ability to fully expand, which was their principle design feature.) +% +%In these cases (starred and unstarred) the date should be provided as %\meta{YYYY}\texttt{-}\meta{MM}\texttt{-}\meta{DD} in the argument %\meta{date}. For example: %\begin{verbatim} @@ -1300,7 +1329,17 @@ %\end{definition} %This defines a \term{partial style} that should only modify %\cs{DTMdisplaydate} and \cs{DTMDisplaydate}. The redefinition of -%these commands should be placed in \meta{definition}. +%these commands should be placed in \meta{definition}. If the date +%should end with a period (full stop) use: +%\begin{definition}[\DescribeMacro\DTMfinaldot] +%\cs{DTMfinaldot} +%\end{definition} +%at the end of the definitions of \cs{DTMdisplaydate} and +%\cs{DTMDisplaydate}. +% +%This command is simply defined as ``\texttt{.}'' but it's locally +%redefined to do nothing by the starred versions of \cs{DTMdate} and +%\cs{DTMDate} allowing the dot to be discarded. % %A new \term{time style} can be defined using: %\begin{definition}[\DescribeMacro\DTMnewtimestyle] @@ -1608,6 +1647,14 @@ %the currently selected date style. %\end{important} % +%The document languages are detected using \sty{tracklang}'s +%interface. This has limitations. In particular, it can't detect the +%region with \sty{polyglossia} nor can it detect languages specified +%after \sty{tracklang} has been loaded, and it can't pick up \sty{babel}'s new +%\cs{babelprovide} command. See the \sty{tracklang} documentation for +%further details. Please check that you have an up-to-date version of +%\sty{tracklang}. +% %Each language module defines a textual style (where the month is %displayed as a word) for that language or region %which can be used in the argument of \cs{DTMsetstyle}, @@ -1675,7 +1722,7 @@ %\usepackage[en-GB,en-CA]{datetime2} %\begin{document} %\DTMsetstyle{en-GB}\today. -%\DTMsetstyle{en-CA}\today +%\DTMsetstyle{en-CA}\today. %\end{document} %\end{verbatim} % @@ -5686,7 +5733,7 @@ %\changes{1.0}{2015-03-24}{Initial release} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datetime2}[2019/10/21 v1.5.4 (NLCT) date and time formats] +\ProvidesPackage{datetime2}[2019/11/11 v1.5.5 (NLCT) date and time formats] % \end{macrocode} % Use \sty{tracklang} to find out what languages have been loaded. % \begin{macrocode} @@ -6100,16 +6147,33 @@ % This will automatically switch the "useregional" setting to % \texttt{text}. %\changes{1.3}{2016-01-22}{added predefined dialect test} +%\changes{1.5.5}{2019-11-11}{add check for \cs{TrackIfKnownLanguage}} % \begin{macrocode} \DeclareOptionX*{% \ifcsundef{@tracklang@add@\CurrentOption}% {% - \PackageError{datetime2}{`\CurrentOption' is not a recognised dialect. - \MessageBreak Perhaps you have misspelt it or the - \MessageBreak named dialect may be unsupported or - \MessageBreak perhaps you forgot to use the `style' key}% - {Any options that aren't described in the manual are assumed - \MessageBreak to be language or dialect names.}% + \ifundef\TrackIfKnownLanguage + {% + \PackageError{datetime2}{Unrecognised dialect `\CurrentOption'. + If you are using a valid ISO language code + please update tracklang.sty to at least v1.3.9}% + {Any options that aren't described in the manual are assumed + \MessageBreak to be language or dialect names.}% + }% + {% + \TrackIfKnownLanguage{\CurrentOption}% + {\renewcommand*{\DTMifcaseregional}[3]{#2}}% + {% + \PackageError{datetime2}{`\CurrentOption' is not a recognised dialect + \MessageBreak and doesn't contain a known language code. + \MessageBreak Perhaps you have misspelt it or the + \MessageBreak named dialect may be unsupported or + \MessageBreak perhaps you forgot the `<key>=' part + \MessageBreak for example, `style=\CurrentOption'}% + {Any options that aren't described in the manual are assumed + \MessageBreak to be language or dialect names.}% + }% + }% }% {% \TrackPredefinedDialect{\CurrentOption}% @@ -6585,29 +6649,83 @@ % \end{macrocode} %\end{macro} % +%\begin{macro}{\DTMfinaldot} +%\changes{1.5.5}{2019-11-11}{new} +%Some date styles require the date to end with a period (full stop). +%These styles should use \cs{DTLfinaldot} for the terminating +%period. This allows the starred version of \cs{DTMdate} to +%locally redefine this command to do nothing when the date is +%required at the end of a sentence. +% \begin{macrocode} +\newcommand*{\DTMfinaldot}{.} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\DTMdate} % Display date where date is specified in the format %\meta{yyyy}-\meta{mm}-\meta{dd}. Use \cs{expandafter} in case %argument is a control sequence containing the date. -% This command isn't expandable +%This command isn't expandable. This now has a starred version that +%locally redefines \cs{DTMfinaldot} to do nothing. +%\changes{1.5.5}{2019-11-11}{added starred version} +% \begin{macrocode} +\newrobustcmd*{\DTMdate}{\@ifstar\@sDTMdate\@DTMdate} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@DTMdate} +%\changes{1.5.5}{2019-11-11}{new} % \begin{macrocode} -\newrobustcmd*{\DTMdate}[1]{% +\newcommand*{\@DTMdate}[1]{% \expandafter\@dtm@parsedate#1\@dtm@endparsedate \DTMdisplaydate{\@dtm@year}{\@dtm@month}{\@dtm@day}{\@dtm@dow}% } % \end{macrocode} %\end{macro} % +%\begin{macro}{\@sDTMdate} +%\changes{1.5.5}{2019-11-11}{new} +% \begin{macrocode} +\newcommand*{\@sDTMdate}[1]{% + {% + \let\DTMfinaldot\empty + \@DTMdate{#1}% + }% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\DTMDate} -% Upper case version. +% Upper case version. This now has a starred version that +%locally redefines \cs{DTMfinaldot} to do nothing. +%\changes{1.5.5}{2019-11-11}{added starred version} +% \begin{macrocode} +\newrobustcmd*{\DTMDate}{\@ifstar\@sDTMDate\@DTMDate} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\@sDTMDate} +%\changes{1.5.5}{2019-11-11}{new} % \begin{macrocode} -\newrobustcmd*{\DTMDate}[1]{% +\newcommand*{\@DTMDate}[1]{% \expandafter\@dtm@parsedate#1\@dtm@endparsedate \DTMDisplaydate{\@dtm@year}{\@dtm@month}{\@dtm@day}{\@dtm@dow}% } % \end{macrocode} %\end{macro} % +%\begin{macro}{\@sDTMDate} +%\changes{1.5.5}{2019-11-11}{new} +% \begin{macrocode} +\newcommand*{\@sDTMDate}[1]{% + {% + \let\DTMfinaldot\empty + \@DTMDate{#1}% + }% +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\DTMcurrenttime} % Display the current time. % \begin{macrocode} @@ -8862,7 +8980,7 @@ %\section{datetime2-calc.sty code} % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datetime2-calc}[2019/10/21 v1.5.4 (NLCT)] +\ProvidesPackage{datetime2-calc}[2019/11/11 v1.5.5 (NLCT)] % \end{macrocode} % Load other required packages % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/datetime2/datetime2.ins b/Master/texmf-dist/source/latex/datetime2/datetime2.ins index d839777cd70..b7c5abb20c6 100644 --- a/Master/texmf-dist/source/latex/datetime2/datetime2.ins +++ b/Master/texmf-dist/source/latex/datetime2/datetime2.ins @@ -1,4 +1,4 @@ -% datetime2.ins generated using makedtx version 1.2 2019/10/21 11:37 +% datetime2.ins generated using makedtx version 1.2 2019/11/11 18:31 \input docstrip \preamble |