diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/datetime2')
-rw-r--r-- | Master/texmf-dist/tex/latex/datetime2/datetime2-calc.sty | 243 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/datetime2/datetime2.sty | 166 |
2 files changed, 401 insertions, 8 deletions
diff --git a/Master/texmf-dist/tex/latex/datetime2/datetime2-calc.sty b/Master/texmf-dist/tex/latex/datetime2/datetime2-calc.sty index d496ec76abd..ced8e9a5a70 100644 --- a/Master/texmf-dist/tex/latex/datetime2/datetime2-calc.sty +++ b/Master/texmf-dist/tex/latex/datetime2/datetime2-calc.sty @@ -7,7 +7,7 @@ %% datetime2.dtx (with options: `datetime2-calc.sty,package') %% %% datetime2.dtx -%% Copyright 2015 Nicola Talbot +%% Copyright 2016 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datetime2-calc}[2015/11/10 v1.2 (NLCT)] +\ProvidesPackage{datetime2-calc}[2016/01/22 v1.3 (NLCT)] \RequirePackage{pgfkeys} \RequirePackage{pgfcalendar} \newcount\@dtm@julianday @@ -223,6 +223,245 @@ \csdef{@dtm@#1@TZhour}{0}% \csdef{@dtm@#1@TZminute}{0}% } +\newcommand*{\dtm@ifdianameexists}[3]{% + \IfTrackedDialect{\languagename}% + {% + \ifcsdef{DTM\TrackedLanguageFromDialect{\languagename}#1}% + {#2}% + {#3}% + }% + {#3}% +} +\newrobustcmd{\DTMmonthname}[1]{% + \ifcsdef{DTM\languagename monthname}% + {% + \csuse{DTM\languagename monthname}{#1}% + }% + {% + \dtm@ifdianameexists{monthname}% + {% + \csuse{DTM\TrackedLanguageFromDialect{\languagename}monthname}{#1}% + }% + {% + \dtmnamewarning{\DTMmonthname}% + \pgfcalendarmonthname{#1}% + }% + }% +} +\newrobustcmd{\DTMMonthname}[1]{% + \ifcsdef{DTM\languagename Monthname}% + {% + \csuse{DTM\languagename Monthname}{#1}% + }% + {% + \dtm@ifdianameexists{Monthname}% + {% + \csuse{DTM\TrackedLanguageFromDialect{\languagename}Monthname}{#1}% + }% + {% + \ifcsdef{DTM\languagename monthname}% + {% + \csuse{DTM\languagename monthname}{#1}% + }% + {% + \dtm@ifdianameexists{monthname}% + {% + \csuse{DTM\TrackedLanguageFromDialect{\languagename}monthname}{#1}% + }% + {% + \dtmnamewarning{\DTMMonthname}% + \ifdef\emakefirstuc + {% + \emakefirstuc{\pgfcalendarmonthname{#1}}% + }% + {% + \protected@edef\dtm@tmp@monthname{\pgfcalendarmonthname{#1}}% + \expandafter\MakeUppercase\dtm@tmp@monthname + }% + }% + }% + }% + }% +} +\newrobustcmd{\DTMshortmonthname}[1]{% + \ifcsdef{DTM\languagename shortmonthname}% + {% + \csuse{DTM\languagename shortmonthname}{#1}% + }% + {% + \dtm@ifdianameexists{shortmonthname}% + {% + \csuse{DTM\TrackedLanguageFromDialect{\languagename}shortmonthname}{#1}% + }% + {% + \dtmnamewarning{\DTMshortmonthname}% + \pgfcalendarmonthshortname{#1}% + }% + }% +} +\newrobustcmd{\DTMshortMonthname}[1]{% + \ifcsdef{DTM\languagename shortMonthname}% + {% + \csuse{DTM\languagename shortMonthname}{#1}% + }% + {% + \dtm@ifdianameexists{shortMonthname}% + {% + \csuse{DTM\TrackedLanguageFromDialect{\languagename}shortMonthname}{#1}% + }% + {% + \ifcsdef{DTM\languagename shortmonthname}% + {% + \csuse{DTM\languagename shortmonthname}{#1}% + }% + {% + \dtm@ifdianameexists{shortmonthname}% + {% + \csuse{DTM\TrackedLanguageFromDialect{\languagename}shortmonthname}% + {#1}% + }% + {% + \dtmnamewarning{\DTMshortMonthname}% + \ifdef\emakefirstuc + {% + \emakefirstuc{\pgfcalendarmonthshortname{#1}}% + }% + {% + \protected@edef\dtm@tmp@monthname{\pgfcalendarmonthshortname{#1}}% + \expandafter\MakeUppercase\dtm@tmp@monthname + }% + }% + }% + }% + }% +} +\newrobustcmd{\DTMweekdayname}[1]{% + \ifcsdef{DTM\languagename weekdayname}% + {% + \csuse{DTM\languagename weekdayname}{#1}% + }% + {% + \dtm@ifdianameexists{weekdayname}% + {% + \csuse{DTM\TrackedLanguageFromDialect{\languagename}weekdayname}{#1}% + }% + {% + \dtmnamewarning{\DTMweekdayname}% + \pgfcalendarweekdayname{#1}% + }% + }% +} +\newrobustcmd{\DTMWeekdayname}[1]{% + \ifcsdef{DTM\languagename Weekdayname}% + {% + \csuse{DTM\languagename Weekdayname}{#1}% + }% + {% + \dtm@ifdianameexists{Weekdayname}% + {% + \csuse{DTM\TrackedLanguageFromDialect{\languagename}Weekdayname}{#1}% + }% + {% + \ifcsdef{DTM\languagename weekdayname}% + {% + \csuse{DTM\languagename weekdayname}{#1}% + }% + {% + \dtm@ifdianameexists{weekdayname}% + {% + \csuse{DTM\TrackedLanguageFromDialect{\languagename}weekdayname}{#1}% + }% + {% + \dtmnamewarning{\DTMWeekdayname}% + \ifdef\emakefirstuc + {% + \emakefirstuc{\pgfcalendarweekdayname{#1}}% + }% + {% + \protected@edef\dtm@tmp@weekdayname{\pgfcalendarweekdayname{#1}}% + \expandafter\MakeUppercase\dtm@tmp@weekdayname + }% + }% + }% + }% + }% +} +\newrobustcmd{\DTMshortweekdayname}[1]{% + \ifcsdef{DTM\languagename shortweekdayname}% + {% + \csuse{DTM\languagename shortweekdayname}{#1}% + }% + {% + \dtm@ifdianameexists{shortweekdayname}% + {% + \csuse{DTM\TrackedLanguageFromDialect{\languagename}shortweekdayname}{#1}% + }% + {% + \dtmnamewarning{\DTMshortweekdayname}% + \pgfcalendarweekdayshortname{#1}% + }% + }% +} +\newrobustcmd{\DTMshortWeekdayname}[1]{% + \ifcsdef{DTM\languagename shortWeekdayname}% + {% + \csuse{DTM\languagename shortWeekdayname}{#1}% + }% + {% + \dtm@ifdianameexists{shortWeekdayname}% + {% + \csuse{DTM\TrackedLanguageFromDialect{\languagename}shortWeekdayname}{#1}% + }% + {% + \ifcsdef{DTM\languagename shortweekdayname}% + {% + \csuse{DTM\languagename shortweekdayname}{#1}% + }% + {% + \dtm@ifdianameexists{shortweekdayname}% + {% + \csuse{DTM\TrackedLanguageFromDialect{\languagename}shortweekdayname}% + {#1}% + }% + {% + \dtmnamewarning{\DTMshortWeekdayname}% + \ifdef\emakefirstuc + {% + \emakefirstuc{\pgfcalendarweekdayshortname{#1}}% + }% + {% + \protected@edef\dtm@tmp@weekdayname{% + \pgfcalendarweekdayshortname{#1}}% + \expandafter\MakeUppercase\dtm@tmp@weekdayname + }% + }% + }% + }% + }% +} +\newrobustcmd{\DTMordinal}[1]{% + \ifcsdef{DTM\languagename ordinal}% + {% + \csuse{DTM\languagename ordinal}{#1}% + }% + {% + \dtm@ifdianameexists{ordinal}% + {% + \csuse{DTM\TrackedLanguageFromDialect{\languagename}ordinal}{#1}% + }% + {% + \number#1 + }% + }% +} +\newcommand*{\dtmnamewarning}[1]{% + \if@dtm@warn + \PackageWarning{datetime2-calc}% + {Can't find underlying language macro for \MessageBreak + \string#1\space(language: \languagename); \MessageBreak + using pgfcalendar macro instead}% + \fi +} \endinput %% %% End of file `datetime2-calc.sty'. diff --git a/Master/texmf-dist/tex/latex/datetime2/datetime2.sty b/Master/texmf-dist/tex/latex/datetime2/datetime2.sty index 8f99dc1e594..4f11b935716 100644 --- a/Master/texmf-dist/tex/latex/datetime2/datetime2.sty +++ b/Master/texmf-dist/tex/latex/datetime2/datetime2.sty @@ -7,7 +7,7 @@ %% datetime2.dtx (with options: `datetime2.sty,package') %% %% datetime2.dtx -%% Copyright 2015 Nicola Talbot +%% Copyright 2016 Nicola Talbot %% %% This work may be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -39,7 +39,7 @@ %% Grave accent \` Left brace \{ Vertical bar \| %% Right brace \} Tilde \~} \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{datetime2}[2015/11/10 v1.2 (NLCT) date and time formats] +\ProvidesPackage{datetime2}[2016/01/22 v1.3 (NLCT) date and time formats] \RequirePackage{tracklang} \RequirePackage{etoolbox} \RequirePackage{xkeyval}[2006/11/18] @@ -152,8 +152,19 @@ }% } \DeclareOptionX*{% - \TrackPredefinedDialect{\CurrentOption}% - \renewcommand*{\DTMifcaseregional}[3]{#2}% + \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.}% + }% + {% + \TrackPredefinedDialect{\CurrentOption}% + \renewcommand*{\DTMifcaseregional}[3]{#2}% + }% } \ProcessOptionsX \disable@keys{datetime2.sty}{calc} @@ -1085,6 +1096,57 @@ \renewcommand*{\DTMDisplay}{\DTMdisplay}% } \DTMnewstyle + {ddmmyy}%label + {% date style + \renewcommand*\DTMdisplaydate[4]{% + \DTMtwodigits{##3}\DTMsep{monthday}% + \DTMtwodigits{##2}\DTMsep{yearmonth}% + \DTMtwodigits{##1}% + }% + \renewcommand*{\DTMDisplaydate}{\DTMdisplaydate}% + }% + {% time style + \renewcommand*\DTMdisplaytime[3]{% + \DTMtwodigits{##1}\DTMsep{hourmin}\DTMtwodigits{##2}% + \ifDTMshowseconds\DTMsep{minsec}\DTMtwodigits{##3}\fi + }% + }% + {% zone style + \renewcommand*{\DTMdisplayzone}[2]{% + \ifboolexpe + { bool{DTMshowisoZ} + and test{\ifnumequal{##1}{0}} + and test{\ifnumequal{##2}{0}} + }% + {% + Z% + }% + {% + \ifnum##1<0\else+\fi\DTMtwodigits{##1}% + \ifDTMshowzoneminutes\DTMsep{hourmin}\DTMtwodigits{##2}\fi + }% + }% + }% + {% full style + \renewcommand*{\DTMdisplay}[9]{% + \ifDTMshowdate + \DTMdisplaydate{##1}{##2}{##3}{##4}% + \DTMsep{datetime}% + \fi + \DTMdisplaytime + {##5}% + {##6}% + {##7}% + \ifDTMshowzone + \DTMsep{timezone}% + \DTMdisplayzone + {##8}% + {##9}% + \fi + }% + \renewcommand*{\DTMDisplay}{\DTMdisplay}% + } +\DTMnewstyle {mmddyyyy}%label {% date style \renewcommand*\DTMdisplaydate[4]{% @@ -1241,6 +1303,57 @@ }% \renewcommand*{\DTMDisplay}{\DTMdisplay}% } +\DTMnewstyle + {mmddyy}%label + {% date style + \renewcommand*\DTMdisplaydate[4]{% + \DTMtwodigits{##2}\DTMsep{monthday}% + \DTMtwodigits{##3}\DTMsep{dayyear}% + \DTMtwodigits{##1}% + }% + \renewcommand*{\DTMDisplaydate}{\DTMdisplaydate}% + }% + {% time style + \renewcommand*\DTMdisplaytime[3]{% + \DTMtwodigits{##1}\DTMsep{hourmin}\DTMtwodigits{##2}% + \ifDTMshowseconds\DTMsep{minsec}\DTMtwodigits{##3}\fi + }% + }% + {% zone style + \renewcommand*{\DTMdisplayzone}[2]{% + \ifboolexpe + { bool{DTMshowisoZ} + and test{\ifnumequal{##1}{0}} + and test{\ifnumequal{##2}{0}} + }% + {% + Z% + }% + {% + \ifnum##1<0\else+\fi\DTMtwodigits{##1}% + \ifDTMshowzoneminutes\DTMsep{hourmin}\DTMtwodigits{##2}\fi + }% + }% + }% + {% full style + \renewcommand*{\DTMdisplay}[9]{% + \ifDTMshowdate + \DTMdisplaydate{##1}{##2}{##3}{##4}% + \DTMsep{datetime}% + \fi + \DTMdisplaytime + {##5}% + {##6}% + {##7}% + \ifDTMshowzone + \DTMsep{timezone}% + \DTMdisplayzone + {##8}% + {##9}% + \fi + }% + \renewcommand*{\DTMDisplay}{\DTMdisplay}% + } \DTMnewtimestyle {hmmss}% label {% @@ -1474,19 +1587,55 @@ {% \edef\@dtm@loadedregions{\@dtm@loadedregions,#1}% }% + \csedef{@dtm@moddialectmap@#1}{\CurrentTrackedDialect}% }% - {}% + {% + \ifcsdef{date\CurrentTrackedDialect} + {% + \letcs{\@dtm@otherdialect}{@dtm@moddialectmap@#1}% + \edef\@dtm@thisdialect{\CurrentTrackedDialect}% + \ifdefequal\@dtm@thisdialect\@dtm@otherdialect + {}% + {% + \ifcsdef{date\@dtm@otherdialect}% + {% + \csletcs{date\@dtm@thisdialect}{date\@dtm@otherdialect}% + }% + {}% + }% + }% + {}% + }% + \csedef{@dtm@dialectmodmap@\CurrentTrackedDialect}{#1}% }% } +\newcommand*{\DTMdialecttomodulemap}[1]{% + \ifcsdef{ver@datetime2-#1.ldf}% + {#1}% + {\csname @dtm@dialectmodmap@#1\endcsname}% +} \newcommand*{\ProvidesDateTimeModule}[1]{% \ProvidesFile{datetime2-#1.ldf}% } +\newcommand*{\DTMusemodule}[2]{% + \ifcsdef{@tracklang@add@#1}% + {% + \TrackPredefinedDialect{#1}% + }% + {}% + \let\@dtm@org@dialect\CurrentTrackedDialect + \def\CurrentTrackedDialect{#1}% + \RequireDateTimeModule{#2}% + \let\CurrentTrackedDialect\@dtm@org@dialect +} \newcommand*{\DTMdefkey}[1]{\define@key[dtm]{#1}} \newcommand*{\DTMdefchoicekey}[1]{\define@choicekey[dtm]{#1}} \newcommand*{\DTMdefboolkey}[1]{\define@boolkey[dtm]{#1}} \newcommand*{\DTMifbool}[4]{\ifbool{dtm@#1@#2}{#3}{#4}} \newcommand*{\DTMsetbool}[3]{\setbool{dtm@#1@#2}{#3}} -\newcommand*{\DTMlangsetup}[2][\@dtm@loadedregions]{% +\newcommand*{\DTMlangsetup}{% + \@ifstar\s@DTMlangsetup\@DTMlangsetup} +\newcommand*{\@DTMlangsetup}[2][\@dtm@loadedregions]{% \@for\@dtm@region:=#1\do{% \setkeys*+[dtm]{\@dtm@region}{#2}% \ifdefempty\XKV@rm{}% @@ -1498,6 +1647,11 @@ }% }% } +\newcommand*{\s@DTMlangsetup}[2][\@dtm@loadedregions]{% + \@for\@dtm@region:=#1\do{% + \setkeys*+[dtm]{\@dtm@region}{#2}% + }% +} \AnyTrackedLanguages {% \ForEachTrackedDialect{\this@dialect}% |