diff options
Diffstat (limited to 'Master/texmf-dist/source/latex/datetime2-romanian/datetime2-romanian.dtx')
-rw-r--r-- | Master/texmf-dist/source/latex/datetime2-romanian/datetime2-romanian.dtx | 420 |
1 files changed, 355 insertions, 65 deletions
diff --git a/Master/texmf-dist/source/latex/datetime2-romanian/datetime2-romanian.dtx b/Master/texmf-dist/source/latex/datetime2-romanian/datetime2-romanian.dtx index ad0b55b624b..a923e58338d 100644 --- a/Master/texmf-dist/source/latex/datetime2-romanian/datetime2-romanian.dtx +++ b/Master/texmf-dist/source/latex/datetime2-romanian/datetime2-romanian.dtx @@ -20,7 +20,7 @@ % \iffalse % Doc-Source file to use with LaTeX2e % Copyright (C) 2015 Nicola Talbot, all rights reserved. -% (New maintainer add relevant lines here.) +% Copyright (C) 2017 Paul A. Patience <pap@papatience.com>, all rights reserved. % \fi % \iffalse %<*driver> @@ -32,13 +32,13 @@ \usepackage[colorlinks, bookmarks, hyperindex=false, - pdfauthor={Nicola L.C. Talbot}, + pdfauthor={Nicola L.C. Talbot and Paul A. Patience}, pdftitle={datetime2.sty Romanian Module}]{hyperref} \setmainfont{Liberation Serif} \setmonofont{Liberation Mono} -\CheckSum{313} +\CheckSum{478} \renewcommand*{\usage}[1]{\hyperpage{#1}} \renewcommand*{\main}[1]{\hyperpage{#1}} @@ -61,14 +61,11 @@ %\MakeShortVerb{"} % %\title{Romanian Module for datetime2 Package} -%\author{Nicola L. C. Talbot (inactive)} -%\date{2015-03-31 (v1.0)} +%\author{Nicola L. C. Talbot (inactive) \\ +% Paul A. Patience\thanks{E-mail: pap@papatience.com}} +%\date{2017-04-08 (v1.01)} %\maketitle % -%This module is currently unmaintained and may be subject to change. -%If you want to volunteer to take over maintanance, contact me at -%\url{http://www.dickimaw-books.com/contact.html} -% %\begin{abstract} %This is the Romanian language module for the \sty{datetime2} %package. If you want to use the settings in this module you must @@ -82,24 +79,6 @@ % depending on the value of the \opt{useregional} setting. %\end{abstract} % -%I've copied the date style from \texttt{babel-romanian}'s \cs{today}. -% -%I don't know if these settings are correct as I can't speak Romanian. -%In particular, I don't know if the "romanian" time style is -%correct. Currently this just uses the "default" time style. Please -%be aware that this may change. Whoever takes over maintanance -%of this module may can change it as appropriate. -% -%The new maintainer should add the line: -%\begin{verbatim} -% The Current Maintainer of this work is Name. -%\end{verbatim} -%to the preamble part in \texttt{datetime2-romanian.ins} where Name -%is the name of the maintainer(s) and replace -%the `inactive' status to `maintained'. -% -%Currently there is only a regionless style. -% %\StopEventually{% %\clearpage %\phantomsection @@ -120,7 +99,7 @@ %\changes{1.0}{2015-03-31}{Initial release} % Identify module % \begin{macrocode} -\ProvidesDateTimeModule{romanian-utf8}[2015/03/31 v1.0] +\ProvidesDateTimeModule{romanian-utf8}[2017/04/08 v1.01] % \end{macrocode} %\begin{macro}{\DTMromanianordinal} % \begin{macrocode} @@ -165,7 +144,7 @@ %\end{macro} % %\begin{macro}{\DTMromanianMonthname} -% As above but capitalize. +% As above but start with a capital. % \begin{macrocode} \newcommand*{\DTMromanianMonthname}[1]{% \ifcase#1 @@ -198,17 +177,84 @@ % \end{macrocode} %\end{macro} % -%If abbreviated dates are supported, short month names should be -%likewise provided. +%\begin{macro}{\DTMromanianshortmonthname} +% Abbreviated Romanian month names. +%\changes{1.01}{2017-04-08}{Add abbreviated month names} +% \begin{macrocode} +\newcommand*{\DTMromanianshortmonthname}[1]{% + \ifcase#1 + \or + ian.% + \or + feb.% + \or + mart.% + \or + apr.% + \or + mai% + \or + iun.% + \or + iul.% + \or + aug.% + \or + sept.% + \or + oct.% + \or + nov.% + \or + dec.% + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTMromanianshortMonthname} +% As above but start with a capital. +% \begin{macrocode} +\newcommand*{\DTMromanianshortMonthname}[1]{% + \ifcase#1 + \or + Ian.% + \or + Feb.% + \or + Mart.% + \or + Apr.% + \or + Mai% + \or + Iun.% + \or + Iul.% + \or + Aug.% + \or + Sept.% + \or + Oct.% + \or + Nov.% + \or + Dec.% + \fi +} +% \end{macrocode} +%\end{macro} % %\begin{macro}{\DTMromanianweekdayname} -% Day of week names. +% Romanian day of week names. +%\changes{1.01}{2017-04-08}{Use T-comma} % \begin{macrocode} \newcommand*{\DTMromanianweekdayname}[1]{% \ifcase#1 luni% \or - marţi% + marți% \or miercuri% \or @@ -231,7 +277,7 @@ \ifcase#1 Luni% \or - Marţi% + Marți% \or Miercuri% \or @@ -247,6 +293,53 @@ % \end{macrocode} %\end{macro} % +%\begin{macro}{\DTMromanianshortweekdayname} +% Abbreviated Romanian day of week names. +%\changes{1.01}{2017-04-08}{Add abbreviated day of week names} +% \begin{macrocode} +\newcommand*{\DTMromanianshortweekdayname}[1]{% + \ifcase#1 + lun.% + \or + mar.% + \or + mie.% + \or + joi% + \or + vin.% + \or + sâm.% + \or + dum.% + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTMromanianshortWeekdayname} +% As above but start with a capital. +% \begin{macrocode} +\newcommand*{\DTMromanianshortWeekdayname}[1]{% + \ifcase#1 + Lun.% + \or + Mar.% + \or + Mie.% + \or + Joi% + \or + Vin.% + \or + Sâm.% + \or + Dum.% + \fi +} +% \end{macrocode} +%\end{macro} +% %\iffalse % \begin{macrocode} %</datetime2-romanian-utf8.ldf> @@ -268,11 +361,9 @@ %\changes{1.0}{2015-03-31}{Initial release} % Identify module % \begin{macrocode} -\ProvidesDateTimeModule{romanian-ascii}[2015/03/31 v1.0] +\ProvidesDateTimeModule{romanian-ascii}[2017/04/08 v1.01] % \end{macrocode} % -%If abbreviated dates are supported, short month names should be -%likewise provided. %\begin{macro}{\DTMromanianordinal} % \begin{macrocode} \newcommand*{\DTMromanianordinal}[1]{% @@ -316,7 +407,7 @@ %\end{macro} % %\begin{macro}{\DTMromanianMonthname} -% As above but capitalize. +% As above but start with a capital. % \begin{macrocode} \newcommand*{\DTMromanianMonthname}[1]{% \ifcase#1 @@ -349,8 +440,77 @@ % \end{macrocode} %\end{macro} % +%\begin{macro}{\DTMromanianshortmonthname} +% Abbreviated Romanian month names. +%\changes{1.01}{2017-04-08}{Add abbreviated month names} +% \begin{macrocode} +\newcommand*{\DTMromanianshortmonthname}[1]{% + \ifcase#1 + \or + ian.% + \or + feb.% + \or + mart.% + \or + apr.% + \or + mai% + \or + iun.% + \or + iul.% + \or + aug.% + \or + sept.% + \or + oct.% + \or + nov.% + \or + dec.% + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTMromanianshortMonthname} +% As above but start with a capital. +% \begin{macrocode} +\newcommand*{\DTMromanianshortMonthname}[1]{% + \ifcase#1 + \or + Ian.% + \or + Feb.% + \or + Mart.% + \or + Apr.% + \or + Mai% + \or + Iun.% + \or + Iul.% + \or + Aug.% + \or + Sept.% + \or + Oct.% + \or + Nov.% + \or + Dec.% + \fi +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\DTMromanianweekdayname} -% Day of week names. +% Romanian day of week names. % \begin{macrocode} \newcommand*{\DTMromanianweekdayname}[1]{% \ifcase#1 @@ -395,6 +555,52 @@ % \end{macrocode} %\end{macro} % +%\begin{macro}{\DTMromanianshortweekdayname} +% Abbreviated Romanian day of week names. +%\changes{1.01}{2017-04-08}{Add abbreviated day of week names} +% \begin{macrocode} +\newcommand*{\DTMromanianshortweekdayname}[1]{% + \ifcase#1 + lun.% + \or + mar.% + \or + mie.% + \or + joi% + \or + vin.% + \or + s\protect\^am.% + \or + dum.% + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTMromanianshortWeekdayname} +% As above but start with a capital. +% \begin{macrocode} +\newcommand*{\DTMromanianshortWeekdayname}[1]{% + \ifcase#1 + Lun.% + \or + Mar.% + \or + Mie.% + \or + Joi% + \or + Vin.% + \or + S\protect\^am.% + \or + Dum.% + \fi +} +% \end{macrocode} +%\end{macro} % %\iffalse % \begin{macrocode} @@ -413,7 +619,7 @@ % % Identify Module % \begin{macrocode} -\ProvidesDateTimeModule{romanian}[2015/03/31 v1.0] +\ProvidesDateTimeModule{romanian}[2017/04/08 v1.01] % \end{macrocode} % Need to find out if XeTeX or LuaTeX are being used. % \begin{macrocode} @@ -438,12 +644,22 @@ % The time style is the same as the "default" style % provided by \sty{datetime2}. This may need correcting. For % example, if a 12 hour style similar to the "englishampm" (from the -% "english-base" module) is required. +% "english-base" module) is required. % % Allow the user a way of configuring the "romanian" and % "romanian-numeric" styles. This doesn't use the package wide % separators such as % \cs{dtm@datetimesep} in case other date formats are also required. +% +%\begin{macro}{\DTMromaniandowdaysep} +% The separator between the day of week name and the day of month +% number for the text format. +%\changes{1.01}{2017-04-08}{Add support for showdow} +% \begin{macrocode} +\newcommand*{\DTMromaniandowdaysep}{\space} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\DTMromaniandaymonthsep} % The separator between the day and month for the text format. % \begin{macrocode} @@ -493,6 +709,7 @@ %Provide keys that can be used in \cs{DTMlangsetup} to set these %separators. % \begin{macrocode} +\DTMdefkey{romanian}{dowdaysep}{\renewcommand*{\DTMromaniandowdaysep}{#1}} \DTMdefkey{romanian}{daymonthsep}{\renewcommand*{\DTMromaniandaymonthsep}{#1}} \DTMdefkey{romanian}{monthyearsep}{\renewcommand*{\DTMromanianmonthyearsep}{#1}} \DTMdefkey{romanian}{datetimesep}{\renewcommand*{\DTMromaniandatetimesep}{#1}} @@ -501,9 +718,16 @@ \DTMdefkey{romanian}{timesep}{\renewcommand*{\DTMromaniantimesep}{#1}} % \end{macrocode} % -% TODO: provide a boolean key to switch between full and abbreviated -% formats if appropriate. (I don't know how the date should be -% abbreviated.) +% Define a boolean key that can switch between full and abbreviated +% formats for the month and day of week names in the text format. +%\changes{1.01}{2017-04-08}{Add support for abbr} +% \begin{macrocode} +\DTMdefboolkey{romanian}{abbr}[true]{} +% \end{macrocode} +% The default is the full name. +% \begin{macrocode} +\DTMsetbool{romanian}{abbr}{false} +% \end{macrocode} % % Define a boolean key that determines if the time zone mappings % should be used. @@ -535,42 +759,108 @@ \DTMsetbool{romanian}{showyear}{true} % \end{macrocode} % -% Define the "romanian" style. (TODO: implement day of week?) +% Define the "romanian" style. +%\changes{1.01}{2017-04-08}{Add support for abbr and showdow} % \begin{macrocode} \DTMnewstyle {romanian}% label {% date style \renewcommand*\DTMdisplaydate[4]{% - \DTMifbool{romanian}{showdayofmonth} - {\DTMromanianordinal{##3}\DTMromaniandaymonthsep}% - {}% - \DTMromanianmonthname{##2}% - \DTMifbool{romanian}{showyear}% + \ifDTMshowdow + \ifnum##4>-1 + \DTMifbool{romanian}{abbr}% + {\DTMromanianshortweekdayname{##4}}% + {\DTMromanianweekdayname{##4}}% + \DTMromaniandowdaysep + \fi + \fi + \DTMifbool{romanian}{showdayofmonth}% {% - \DTMromanianmonthyearsep - \number##1 + \DTMromanianordinal{##3}% + \DTMromaniandaymonthsep }% {}% - }% - \renewcommand*\DTMDisplaydate[4]{% - \DTMifbool{romanian}{showdayofmonth} - {% - \DTMromanianordinal{##3}\DTMromaniandaymonthsep - \DTMromanianmonthname{##2}% - }% - {% - \DTMromanianMonthname{##2}% - }% + \DTMifbool{romanian}{abbr}% + {\DTMromanianshortmonthname{##2}}% + {\DTMromanianmonthname{##2}}% \DTMifbool{romanian}{showyear}% {% \DTMromanianmonthyearsep - \number##1 + \number##1 % space intended }% {}% }% + \renewcommand*\DTMDisplaydate[4]{% + \ifDTMshowdow + \ifnum##4>-1 + \DTMifbool{romanian}{abbr}% + {\DTMromanianshortWeekdayname{##4}}% + {\DTMromanianWeekdayname{##4}}% + \DTMromaniandowdaysep + \DTMifbool{romanian}{showdayofmonth}% + {% + \DTMromanianordinal{##3}% + \DTMromaniandaymonthsep + }% + {}% + \DTMifbool{romanian}{abbr}% + {\DTMromanianshortmonthname{##2}}% + {\DTMromanianmonthname{##2}}% + \DTMifbool{romanian}{showyear}% + {% + \DTMromanianmonthyearsep + \number##1 % space intended + }% + {}% + \else + \DTMifbool{romanian}{showdayofmonth} + {% + \DTMromanianordinal{##3}% + \DTMromaniandaymonthsep + \DTMifbool{romanian}{abbr}% + {\DTMromanianshortmonthname{##2}}% + {\DTMromanianmonthname{##2}}% + }% + {% + \DTMifbool{romanian}{abbr}% + {\DTMromanianshortMonthname{##2}}% + {\DTMromanianMonthname{##2}}% + }% + \DTMifbool{romanian}{showyear}% + {% + \DTMromanianmonthyearsep + \number##1 % space intended + }% + {}% + \fi + \else + \DTMifbool{romanian}{showdayofmonth} + {% + \DTMromanianordinal{##3}% + \DTMromaniandaymonthsep + \DTMifbool{romanian}{abbr}% + {\DTMromanianshortmonthname{##2}}% + {\DTMromanianmonthname{##2}}% + }% + {% + \DTMifbool{romanian}{abbr}% + {\DTMromanianshortMonthname{##2}}% + {\DTMromanianMonthname{##2}}% + }% + \DTMifbool{romanian}{showyear}% + {% + \DTMromanianmonthyearsep + \number##1 % space intended + }% + {}% + \fi + }% }% - {% time style (use default) - \DTMsettimestyle{default}% + {% time style (ignores seconds) + \renewcommand*\DTMdisplaytime[3]{% + \number##1 + \DTMromaniantimesep\DTMtwodigits{##2}% + }% }% {% zone style \DTMresetzones |