diff options
author | Karl Berry <karl@freefriends.org> | 2017-04-10 22:02:53 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2017-04-10 22:02:53 +0000 |
commit | b0dfd5e7f300bcfe96ad84722848ce8137be7ac9 (patch) | |
tree | bb56ddb0d3eda27e0ac330c020be09c5b2cafa6f /Master/texmf-dist/source | |
parent | 47872b2b657010d6a4d584c38a54b31d038b0539 (diff) |
datetime2-french
git-svn-id: svn://tug.org/texlive/trunk@43742 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/datetime2-french/datetime2-french.dtx | 536 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/datetime2-french/datetime2-french.ins | 7 |
2 files changed, 476 insertions, 67 deletions
diff --git a/Master/texmf-dist/source/latex/datetime2-french/datetime2-french.dtx b/Master/texmf-dist/source/latex/datetime2-french/datetime2-french.dtx index 96f0075eb53..ffcce39e15d 100644 --- a/Master/texmf-dist/source/latex/datetime2-french/datetime2-french.dtx +++ b/Master/texmf-dist/source/latex/datetime2-french/datetime2-french.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> @@ -33,11 +33,11 @@ \usepackage[colorlinks, bookmarks, hyperindex=false, - pdfauthor={Nicola L.C. Talbot}, + pdfauthor={Nicola L.C. Talbot and Paul A. Patience}, pdftitle={datetime2.sty French Module}]{hyperref} -\CheckSum{333} +\CheckSum{580} \renewcommand*{\usage}[1]{\hyperpage{#1}} \renewcommand*{\main}[1]{\hyperpage{#1}} @@ -60,14 +60,11 @@ %\MakeShortVerb{"} % %\title{French Module for datetime2 Package} -%\author{Nicola L. C. Talbot (inactive)} -%\date{2015-03-27 (v1.0)} +%\author{Nicola L. C. Talbot (inactive) \\ +% Paul A. Patience\thanks{E-mail: pap@papatience.com}} +%\date{2017-04-08 (v1.02)} %\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 French language module for the \sty{datetime2} %package. If you want to use the settings in this module you must @@ -81,27 +78,6 @@ % depending on the value of the \opt{useregional} setting. %\end{abstract} % -%I've copied the date style from \texttt{babel-french}'s \cs{today}. -% -%I don't know if these settings are correct. -%In particular, I don't know if the "french" 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-french.ins} where Name -%is the name of the maintainer(s) and replace -%the `inactive' status to `maintained'. -% -%Currently there is only a regionless style. New maintainers may -%want to add regional variants such as "fr-FR"\slash"fr-FR-numeric" -%or "fr-BE"\slash"fr-BE-numeric". This style currently doesn't check the -%\opt{showdow} setting. -% %\StopEventually{% %\clearpage %\phantomsection @@ -122,7 +98,7 @@ %\changes{1.0}{2015-03-27}{Initial release} % Identify module % \begin{macrocode} -\ProvidesDateTimeModule{french-utf8}[2015/03/27 v1.0] +\ProvidesDateTimeModule{french-utf8}[2017/04/08 v1.02] % \end{macrocode} %\begin{macro}{\DTMfrenchordinal} % \begin{macrocode} @@ -210,11 +186,77 @@ % \end{macrocode} %\end{macro} % -%If abbreviated dates are supported, short month names should be -%likewise provided. +%\begin{macro}{\DTMfrenchshortmonthname} +% Abbreviated French month names. +%\changes{1.01}{2017-04-08}{Add abbreviated month names} +% \begin{macrocode} +\newcommand*{\DTMfrenchshortmonthname}[1]{% + \ifcase#1 + \or + janv.% + \or + févr.% + \or + mars% + \or + avr.% + \or + mai% + \or + juin% + \or + juill.% + \or + août% + \or + sept.% + \or + oct.% + \or + nov.% + \or + déc.% + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTMfrenchshortMonthname} +% As above but start with a capital. +% \begin{macrocode} +\newcommand*{\DTMfrenchshortMonthname}[1]{% + \ifcase#1 + \or + Janv.% + \or + Févr.% + \or + Mars% + \or + Avr.% + \or + Mai% + \or + Juin% + \or + Juill.% + \or + Août% + \or + Sept.% + \or + Oct.% + \or + Nov.% + \or + Déc.% + \fi +} +% \end{macrocode} +%\end{macro} % %\begin{macro}{\DTMfrenchweekdayname} -%These are provided here but not currently used in the date format. +% French day of week names. % \begin{macrocode} \newcommand*{\DTMfrenchweekdayname}[1]{% \ifcase#1 @@ -237,7 +279,7 @@ %\end{macro} % %\begin{macro}{\DTMfrenchWeekdayname} -%As above but start with a capital. +% As above but start with a capital. % \begin{macrocode} \newcommand*{\DTMfrenchWeekdayname}[1]{% \ifcase#1 @@ -259,6 +301,112 @@ % \end{macrocode} %\end{macro} % +%\begin{macro}{\DTMfrenchshortweekdayname} +% French abbreviated day of week names. +%\changes{1.01}{2017-04-08}{Add abbreviated day of week names} +% \begin{macrocode} +\newcommand*{\DTMfrenchshortweekdayname}[1]{% + \ifcase#1 + lun.% + \or + mar.% + \or + mer.% + \or + jeu.% + \or + ven.% + \or + sam.% + \or + dim.% + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTMfrenchshortWeekdayname} +% As above but start with a capital. +% \begin{macrocode} +\newcommand*{\DTMfrenchshortWeekdayname}[1]{% + \ifcase#1 + Lun.% + \or + Mar.% + \or + Mer.% + \or + Jeu.% + \or + Ven.% + \or + Sam.% + \or + Dim.% + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTMfrenchmidnight} +% \begin{macrocode} +\newcommand*\DTMfrenchmidnight{minuit}% +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTMfrenchnoon} +% \begin{macrocode} +\newcommand*\DTMfrenchnoon{midi}% +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTMfrenchtimesymsep} +% \begin{macrocode} +\newcommand*\DTMfrenchtimesymsep{\,}% +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTMfrenchhoursym} +% \begin{macrocode} +\newcommand*\DTMfrenchhoursym{h}% +% \end{macrocode} +%\end{macro} +% +% This style ignores seconds. +%\changes{1.01}{2017-04-08}{Add frenchalpha time style} +% \begin{macrocode} +\DTMnewtimestyle + {frenchalpha}% label + {% + \renewcommand*\DTMdisplaytime[3]{% + \ifnum##2=0 + \ifnum##1=12 + \DTMfrenchnoon + \else + \ifnum##1=0 + \DTMfrenchmidnight + \else + \ifnum##1=24 + \DTMfrenchmidnight + \else + \number##1 + \DTMfrenchtimesymsep\DTMfrenchhoursym + \fi + \fi + \fi + \else + \ifnum##1=24 + 0% + \else + \number##1 + \fi + \DTMfrenchtimesymsep\DTMfrenchhoursym + \DTMfrenchtimesymsep\DTMtwodigits{##2}% + \fi + }% + }% +% \end{macrocode} +% %\iffalse % \begin{macrocode} %</datetime2-french-utf8.ldf> @@ -280,11 +428,9 @@ %\changes{1.0}{2015-03-27}{Initial release} % Identify module % \begin{macrocode} -\ProvidesDateTimeModule{french-ascii}[2015/03/27 v1.0] +\ProvidesDateTimeModule{french-ascii}[2017/04/08 v1.02] % \end{macrocode} % -%If abbreviated dates are supported, short month names should be -%likewise provided. %\begin{macro}{\DTMfrenchordinal} % \begin{macrocode} \ifdef\ier @@ -371,8 +517,77 @@ % \end{macrocode} %\end{macro} % +%\begin{macro}{\DTMfrenchshortmonthname} +% Abbreviated French month names. +%\changes{1.01}{2017-04-08}{Add abbreviated month names} +% \begin{macrocode} +\newcommand*{\DTMfrenchshortmonthname}[1]{% + \ifcase#1 + \or + janv.% + \or + f\protect\'evr.% + \or + mars% + \or + avr.% + \or + mai% + \or + juin% + \or + juill.% + \or + ao\protect\^ut% + \or + sept.% + \or + oct.% + \or + nov.% + \or + d\protect\'ec.% + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTMfrenchshortMonthname} +% As above but start with a capital. +% \begin{macrocode} +\newcommand*{\DTMfrenchshortMonthname}[1]{% + \ifcase#1 + \or + Janv.% + \or + F\protect\'evr.% + \or + Mars% + \or + Avr.% + \or + Mai% + \or + Juin% + \or + Juill.% + \or + Ao\protect\^ut% + \or + Sept.% + \or + Oct.% + \or + Nov.% + \or + D\protect\'ec.% + \fi +} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\DTMfrenchweekdayname} -%These are provided here but not currently used in the date format. +% French day of week names. % \begin{macrocode} \newcommand*{\DTMfrenchweekdayname}[1]{% \ifcase#1 @@ -395,7 +610,7 @@ %\end{macro} % %\begin{macro}{\DTMfrenchWeekdayname} -%As above but start with a capital. +% As above but start with a capital. % \begin{macrocode} \newcommand*{\DTMfrenchWeekdayname}[1]{% \ifcase#1 @@ -417,6 +632,111 @@ % \end{macrocode} %\end{macro} % +%\begin{macro}{\DTMfrenchshortweekdayname} +% French abbreviated day of week names. +%\changes{1.01}{2017-04-08}{Add abbreviated day of week names} +% \begin{macrocode} +\newcommand*{\DTMfrenchshortweekdayname}[1]{% + \ifcase#1 + lun.% + \or + mar.% + \or + mer.% + \or + jeu.% + \or + ven.% + \or + sam.% + \or + dim.% + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTMfrenchshortWeekdayname} +% As above but start with a capital. +% \begin{macrocode} +\newcommand*{\DTMfrenchshortWeekdayname}[1]{% + \ifcase#1 + Lun.% + \or + Mar.% + \or + Mer.% + \or + Jeu.% + \or + Ven.% + \or + Sam.% + \or + Dim.% + \fi +} +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTMfrenchmidnight} +% \begin{macrocode} +\newcommand*\DTMfrenchmidnight{minuit}% +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTMfrenchnoon} +% \begin{macrocode} +\newcommand*\DTMfrenchnoon{midi}% +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTMfrenchtimesymsep} +% \begin{macrocode} +\newcommand*\DTMfrenchtimesymsep{\,}% +% \end{macrocode} +%\end{macro} +% +%\begin{macro}{\DTMfrenchhoursym} +% \begin{macrocode} +\newcommand*\DTMfrenchhoursym{h}% +% \end{macrocode} +%\end{macro} +% +% This style ignores seconds. +%\changes{1.01}{2017-04-08}{Add frenchalpha time style} +% \begin{macrocode} +\DTMnewtimestyle + {frenchalpha}% label + {% + \renewcommand*\DTMdisplaytime[3]{% + \ifnum##2=0 + \ifnum##1=12 + \DTMfrenchnoon + \else + \ifnum##1=0 + \DTMfrenchmidnight + \else + \ifnum##1=24 + \DTMfrenchmidnight + \else + \number##1 + \DTMfrenchtimesymsep\DTMfrenchhoursym + \fi + \fi + \fi + \else + \ifnum##1=24 + 0% + \else + \number##1 + \fi + \DTMfrenchtimesymsep\DTMfrenchhoursym + \DTMfrenchtimesymsep\DTMtwodigits{##2}% + \fi + }% + }% +% \end{macrocode} % %\iffalse % \begin{macrocode} @@ -435,7 +755,7 @@ % % Identify Module % \begin{macrocode} -\ProvidesDateTimeModule{french}[2015/03/27 v1.0] +\ProvidesDateTimeModule{french}[2017/04/08 v1.02] % \end{macrocode} % Need to find out if XeTeX or LuaTeX are being used. % \begin{macrocode} @@ -458,16 +778,29 @@ % % Define the \texttt{french} style. % The time style is the same as the "default" style -% provided by \sty{datetime2}. This may need correcting. +% provided by \sty{datetime2}. This may need correcting. % % Allow the user a way of configuring the "french" and % "french-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}{\DTMfrenchdowdaysep} +% 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*{\DTMfrenchdowdaysep}{\space} +% \end{macrocode} +%\end{macro} +% %\begin{macro}{\DTMfrenchdaymonthsep} % The separator between the day and month for the text format. +%\changes{1.02}{2017-04-08}{Use non-breaking space} % \begin{macrocode} -\newcommand*{\DTMfrenchdaymonthsep}{\space} +\newcommand*{\DTMfrenchdaymonthsep}{% + \DTMtexorpdfstring{\protect~}{\space}% +} % \end{macrocode} %\end{macro} % @@ -482,7 +815,7 @@ % The separator between the date and time blocks in the full format % (either text or numeric). % \begin{macrocode} -\newcommand*{\DTMfrenchdatetimesep}{\space} +\newcommand*{\DTMfrenchdatetimesep}{,\space} % \end{macrocode} %\end{macro} % @@ -511,6 +844,7 @@ %Provide keys that can be used in \cs{DTMlangsetup} to set these %separators. % \begin{macrocode} +\DTMdefkey{french}{dowdaysep}{\renewcommand*{\DTMfrenchdowdaysep}{#1}} \DTMdefkey{french}{daymonthsep}{\renewcommand*{\DTMfrenchdaymonthsep}{#1}} \DTMdefkey{french}{monthyearsep}{\renewcommand*{\DTMfrenchmonthyearsep}{#1}} \DTMdefkey{french}{datetimesep}{\renewcommand*{\DTMfrenchdatetimesep}{#1}} @@ -519,9 +853,16 @@ \DTMdefkey{french}{timesep}{\renewcommand*{\DTMfrenchtimesep}{#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{french}{abbr}[true]{} +% \end{macrocode} +% The default is the full name. +% \begin{macrocode} +\DTMsetbool{french}{abbr}{false} +% \end{macrocode} % % Define a boolean key that determines if the time zone mappings % should be used. @@ -553,30 +894,30 @@ \DTMsetbool{french}{showyear}{true} % \end{macrocode} % -% Define the "french" style. (TODO: implement day of week?) +% Define the "french" style. +%\changes{1.01}{2017-04-08}{Add support for abbr and showdow} % \begin{macrocode} \DTMnewstyle {french}% label {% date style \renewcommand*\DTMdisplaydate[4]{% - \DTMifbool{french}{showdayofmonth} - {\DTMfrenchordinal{##3}\DTMfrenchdaymonthsep}% - {}% - \DTMfrenchmonthname{##2}% - \DTMifbool{french}{showyear}% + \ifDTMshowdow + \ifnum##4>-1 + \DTMifbool{french}{abbr}% + {\DTMfrenchshortweekdayname{##4}}% + {\DTMfrenchweekdayname{##4}}% + \DTMfrenchdowdaysep + \fi + \fi + \DTMifbool{french}{showdayofmonth}% {% - \DTMfrenchmonthyearsep - \number##1 % space intended + \DTMfrenchordinal{##3}% + \DTMfrenchdaymonthsep }% {}% - }% - \renewcommand*\DTMDisplaydate[4]{% - \DTMifbool{french}{showdayofmonth} - {% - \DTMfrenchordinal{##3}\DTMfrenchdaymonthsep - \DTMfrenchmonthname{##2}% - }% - {\DTMfrenchMonthname{##2}}% + \DTMifbool{french}{abbr}% + {\DTMfrenchshortmonthname{##2}}% + {\DTMfrenchmonthname{##2}}% \DTMifbool{french}{showyear}% {% \DTMfrenchmonthyearsep @@ -584,9 +925,74 @@ }% {}% }% + \renewcommand*\DTMDisplaydate[4]{% + \ifDTMshowdow + \ifnum##4>-1 + \DTMifbool{french}{abbr}% + {\DTMfrenchshortWeekdayname{##4}}% + {\DTMfrenchWeekdayname{##4}}% + \DTMfrenchdowdaysep + \DTMifbool{french}{showdayofmonth}% + {% + \DTMfrenchordinal{##3}% + \DTMfrenchdaymonthsep + }% + {}% + \DTMifbool{french}{abbr}% + {\DTMfrenchshortmonthname{##2}}% + {\DTMfrenchmonthname{##2}}% + \DTMifbool{french}{showyear}% + {% + \DTMfrenchmonthyearsep + \number##1 % space intended + }% + {}% + \else + \DTMifbool{french}{showdayofmonth} + {% + \DTMfrenchordinal{##3}% + \DTMfrenchdaymonthsep + \DTMifbool{french}{abbr}% + {\DTMfrenchshortmonthname{##2}}% + {\DTMfrenchmonthname{##2}}% + }% + {% + \DTMifbool{french}{abbr}% + {\DTMfrenchshortMonthname{##2}}% + {\DTMfrenchMonthname{##2}}% + }% + \DTMifbool{french}{showyear}% + {% + \DTMfrenchmonthyearsep + \number##1 % space intended + }% + {}% + \fi + \else + \DTMifbool{french}{showdayofmonth} + {% + \DTMfrenchordinal{##3}% + \DTMfrenchdaymonthsep + \DTMifbool{french}{abbr}% + {\DTMfrenchshortmonthname{##2}}% + {\DTMfrenchmonthname{##2}}% + }% + {% + \DTMifbool{french}{abbr}% + {\DTMfrenchshortMonthname{##2}}% + {\DTMfrenchMonthname{##2}}% + }% + \DTMifbool{french}{showyear}% + {% + \DTMfrenchmonthyearsep + \number##1 % space intended + }% + {}% + \fi + }% }% - {% time style (use default) - \DTMsettimestyle{default}% + {% time style + \DTMsettimestyle{frenchalpha}% }% {% zone style \DTMresetzones diff --git a/Master/texmf-dist/source/latex/datetime2-french/datetime2-french.ins b/Master/texmf-dist/source/latex/datetime2-french/datetime2-french.ins index dc656547dfd..d685a6f8f22 100644 --- a/Master/texmf-dist/source/latex/datetime2-french/datetime2-french.ins +++ b/Master/texmf-dist/source/latex/datetime2-french/datetime2-french.ins @@ -4,16 +4,19 @@ datetime2-french.dtx Copyright 2015 Nicola Talbot + Copyright 2017 Paul A. Patience <pap@papatience.com> This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 - of this license of (at your option) any later version. + of this license or (at your option) any later version. The latest version of this license is in http://www.latex-project.org/lppl.txt and version 1.3 or later is part of all distributions of LaTeX version 2005/12/01 or later. - This work has the LPPL maintenance status `inactive'. + This work has the LPPL maintenance status `maintained'. + + The Current Maintainer of this work is Paul A. Patience. This work consists of the files datetime2-french.dtx and datetime2-french.ins and the derived files |