From fabf181c6946e1e5ea931f003df726c9c1c553b8 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 24 Aug 2007 18:42:16 +0000 Subject: datetime 2.55 (20aug07) git-svn-id: svn://tug.org/texlive/trunk@4803 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/datetime/CHANGES | 9 + Master/texmf-dist/doc/latex/datetime/README | 12 +- .../doc/latex/datetime/datetime-manual.html | 865 ++++++++++++++++++++ Master/texmf-dist/doc/latex/datetime/datetime.pdf | Bin 160888 -> 170340 bytes Master/texmf-dist/doc/latex/datetime/datetime.perl | 121 +-- Master/texmf-dist/doc/latex/datetime/dt-lang.tex | 20 + Master/texmf-dist/doc/latex/datetime/dt-sampl.tex | 53 +- Master/texmf-dist/doc/latex/datetime/manual.html | 870 --------------------- 8 files changed, 980 insertions(+), 970 deletions(-) create mode 100644 Master/texmf-dist/doc/latex/datetime/datetime-manual.html create mode 100644 Master/texmf-dist/doc/latex/datetime/dt-lang.tex delete mode 100644 Master/texmf-dist/doc/latex/datetime/manual.html (limited to 'Master/texmf-dist/doc/latex/datetime') diff --git a/Master/texmf-dist/doc/latex/datetime/CHANGES b/Master/texmf-dist/doc/latex/datetime/CHANGES index 4c7b14e1d29..e09bc06c7f4 100644 --- a/Master/texmf-dist/doc/latex/datetime/CHANGES +++ b/Master/texmf-dist/doc/latex/datetime/CHANGES @@ -1,5 +1,14 @@ datetime.sty history +Version 2.55: + + * fixed bug preventing multilingual support + * fixed copyright text + +Version 2.54: added check for british babel setting. + +Version 2.53: added checks for UKenglish and USenglish. + Version 2.52: fixed bug in \textdate arising from change in fmtcount internals. diff --git a/Master/texmf-dist/doc/latex/datetime/README b/Master/texmf-dist/doc/latex/datetime/README index 556a0154b69..66fffe3d3a8 100644 --- a/Master/texmf-dist/doc/latex/datetime/README +++ b/Master/texmf-dist/doc/latex/datetime/README @@ -1,11 +1,14 @@ -LaTeX Package : datetime v 2.52 +LaTeX Package : datetime v 2.55 -Last Modified : 21 April 2007 +Last Modified : 20 Aug 2007 Author : Nicola Talbot Files : datetime.dtx - documented source file datetime.ins - installation script + datetime.perl - LaTeX2HTML style file + dt-sampl.tex - sample files + dt-lang.tex / The package datetime.sty provides various different @@ -18,15 +21,14 @@ To extract the code do: latex datetime.ins -This will create datetime.sty, lots of .def files, -datetime.perl files and one sample file: dt-sampl.tex. +This will create datetime.sty and lots of dt-*.def files, (NB it may take a while to extract if you have a slow computer!) Move the .sty and .def files to somewhere LaTeX will find it (e.g. texmf/tex/latex/datetime/) and remember to update the TeX database. -Copy the .perl file to somewhere where LaTeX2HTML will find it +Copy the datetime.perl file to somewhere where LaTeX2HTML will find it (e.g. latex2html/styles/). To extract the documentation do: diff --git a/Master/texmf-dist/doc/latex/datetime/datetime-manual.html b/Master/texmf-dist/doc/latex/datetime/datetime-manual.html new file mode 100644 index 00000000000..48ce608fd40 --- /dev/null +++ b/Master/texmf-dist/doc/latex/datetime/datetime-manual.html @@ -0,0 +1,865 @@ + + + + + +datetime.sty v2.55: Formatting Current Date and Time + + + + + + + + + + + + + + +

+ +

datetime.sty v2.55: Formatting Current Date and +Time

+

Nicola L. C. Talbot +
+
+School of Computing Sciences +
+University of East Anglia +
+Norwich. NR4 7TJ. +
+United Kingdom. +
http://theoval.cmp.uea.ac.uk/~nlct/

+

20 Aug 2007

+
+ +

+Contents +

+ + + + +

+Introduction +

+ +The datetime package is a LaTeX2e package that +provides various different formats for \today, +and provides commands for displaying the current time. +If you only want the +time commands but not the date changing commands, you can pass +the option nodate to the package. + +

+Since version 2.4, the datetime package has been +separated into two packages: datetime and +fmtcount. When I originally created this package, +I defined the commands, \ordinal etc which could be used +in the definition of \today. Since then, I have extended +the number of commands available that can be used to display the +value of a LaTeX counter, however it seems more appropriate to +define all these counter-related commands in a separate package. +The fmtcount package is now distributed separately +from the datetime package, and will also need to +be installed. + +

+As from version 2.42, the datetime package is now +compatible with babel, however you must load the +datetime package after the babel package. +For example: +

+\usepackage[francais]{babel}
+\usepackage{datetime}
+
+ +

+ +

+Date Declarations +

+ There are various declarations that change the effect of +\today. The change can be localised by placing the +declaration within a group. + +

+ + Day Month Year formats: +
+The declaration \longdate will redefine +\today to produce the current date displayed in the form +Wednesday 8th March, 2000 + if the package option dayofweek is used, or +8th March, 2000 if the package option + nodayofweek is used. +
+The declaration \shortdate will redefine +\today to produce the current date displayed in the form +Wed 8th Mar, 2000 if the package option +dayofweek is used, or 8th Mar, 2000 +if the package option nodayofweek is used. +
+The declaration \ddmmyyyydate will redefine +\today to produce + the current date displayed in the form 08/03/2000 +
+The declaration \dmyyyydate will redefine +\today to produce + the current date displayed in the form 8/3/2000 +
+The declaration \ddmmyydate will redefine +\today to produce + the current date displayed in the form 08/03/00 +
+The declaration \dmyydate will redefine +\today to produce + the current date displayed in the form 8/3/00 +
+The declaration \textdate will redefine +\today to produce the current date displayed in the form: +Wednesday the Eighth of March, Two Thousand if the package option +dayofweek is used, or Eighth of March, Two Thousand if +the package option nodayofweek is used. Note that +\textdate is defined for use with English, it won't +look right if it is used when another language has been +selected1. If you want to define a similar command for +another language, you will first need to check that the +fmtcount package supports that language. + +

+ + Month Day Year formats: +
+The declaration \usdate will redefine +\today to produce the current date displayed in the form +March 8, 2000. (As TeX and LaTeX do by default.) +
+The declaration \mmddyyyydate will redefine +\today to produce the current date displayed in the form +03/08/2000 +
+The declaration \mdyyyydate will redefine +\today to produce the current date displayed in the form +3/8/2000 +
+The declaration \mmddyydate will redefine +\today to produce the current date displayed in the form +03/08/00 +
+The declaration \mdyydate will redefine +\today to produce the current date displayed in the form +3/8/00 + +

+In addition, the declarations \datelang are +available for all languages defined either by +calling babel prior to datetime or by +passing the language name as an option to datetime. +See later +if you want to define your own customised date format. + +

+As from version 2.43, the numerical date formats (such as +\ddmmyyyydate) use the command +\dateseparator to separate the numbers. So, for example, +if you want to hyphens instead of slashes, you can do: +

+\renewcommand{\dateseparator}{-}
+
+ +

+ +

+Time Commands +

+ + The current time is displayed using the command +\currenttime. + + The format can be changed using the declaration +\settimeformat{style}, where style is the name of the +format2. Available formats +are: +
+
xxivtime
+
Twenty-four hour time in the form 22:28 (Default) +
+
ampmtime
+
Twelve hour time in the form 10:28pm +
+
oclock
+
Displays the current time as a string, e.g. +Twenty-Eight minutes past Ten in the afternoon. +
+
+ +

+New time formats can be defined using the command: +
+
\newtimeformat{name}{format} +
+
+where name is the name of the new format (used in +\settimeformat), and format is how to format the +time. Within format you can use the counters +HOUR (number of hours after midnight), MINUTE +(number of minutes past the hour), HOURXII (number of +hours after midnight/midday), TOHOUR (the next hour) and +TOMINUTE (number of minutes to the next hour), and the +corresponding commands: \THEHOUR, \THEMINUTE, +\THEHOURXII, \THETOHOUR and \THETOMINUTE. + +

+For example, to define a new time format that uses a dot instead of a +colon: +

+\newtimeformat{dottime}{\twodigit{\THEHOUR}.\twodigit{\THEMINUTE}}
+
+You then need to switch to this new format before you can use it: +
+\settimeformat{dottime}
+\currenttime
+
+ +

+As from version 2.43, if you only want to change the separator, +you can simply redefine \timeseparator +instead of defining a new time format. For example: +

+\renewcommand{\timeseparator}{.}
+
+The xxivtime format will now work like the dottime +format defined above. + +

+ +

+Formating Dates +

+ + The command \pdfdate3 prints the date in the format required for + PDF files, e.g. if the date is 1 May 2004 and time is + 22:02, \pdfdate will print 20040501220200. The reason +this date format is separate from all the others is because the +other form doesn't get properly expanded by PDFTeX. (This +command is defined regardless of whether the package option +nodate is called.) +Example: +
+\pdfinfo{
+   /Author (Me)
+   /Title (A Sample Document)
+   /CreationDate (D:20040501215500)
+   /ModDate (D:\pdfdate)
+}
+
+ +

+There are two commands that print the name of the current + month: + + \monthname prints the current month name in full, +e.g. August, and + + \shortmonthname prints the abbreviated month name, +e.g. Aug. Both \monthname and +\shortmonthname take an optional argument (a number from +1 to 12) if the name of a specific month is required. For +example, \monthname[6] will produced the output: June. + +

+The day of the week is computed using the algorithm documented at + http://userpages.wittenburg.edu/bshelburne/Comp150/DayOfWeek.htm. + This algorithm works for any date between 1st +Jan, 1901 and 31st Dec, 2099. + The following macros display the day of week for a given date: + +

+ +\dayofweekname{day}{month}{year} prints the + day of week for the specified date. For example, +\dayofweekname{31}{10}{2002} + will produce the output: Thursday. +
+\shortdayofweeknameday{month}{year} prints the +abbreviated name for the + day of week for the specified date. For example +
\shortdayofweekname{31}{10}{2002} +
+will produce the output: Thu. + +

+The TeX conditional \ifshowdow can be used to determine + whether or not the option dayofweek has been passed to +the package. + For example: +

+\ifshowdow\dayofweekname{31}{10}{2002} \fi
+
+ will only display the day of week if the dayofweek +option was passed to datetime. + Alternatively, you can use David Carlisle's ifthen +package: +
+\ifthenelse{\boolean{showdow}}{\dayofweekname{31}{10}{2002} }{}
+
+ +

+The command \ordinaldate{number} +displays number as a date-type ordinal. If the +current language is English, this will simply pass +the argument to \ordinalnum (defined in the +fmtcount package), +if the current language is Breton, Welsh or French, a superscript +will only be added if number is 1, otherwise only +number will be displayed. + +

+The macro +\formatdate{day}{month}{year}4 formats the specified date according to +the current format of \today5. +(Arguments must all be integers.) For example, in combination with +\longdate, the command +

+\formatdate{27}{9}{2004}
+
+will produce the output: Monday 27th September, +2004. + +

+You can ensure that a number is displayed with at least two +digits by using the command +\twodigit{num}. + This is of use if you want to define your own date or time +formats. + +

+ +

+
+Defining New Date Formats +

+ +

+New date formats can be defined using the command: +
+
\newdateformat{name}{format} +
+
+where name is the name of the new format, and + format is how to format the date. Within the + argument format you can use the commands \THEDAY, +\THEMONTH + and \THEYEAR to represent the relevant day, month and +year, or you can use the counters + DAY, MONTH and YEAR if you want to +use \ordinal etc. Once you have defined the + new date format, you can then switch to it using the declaration +\name + (i.e. the name you specified preceded by a backslash), and + subsequent calls to \today and \formatdate will +use your new format. + +

+For example, suppose you want to define a new date format called, + say, mydate, that will typeset the date in the form: +8-3-2002, + then you can do: +

+\newdateformat{mydate}{\THEDAY-\THEMONTH-\THEYEAR}
+
+\newdateformat will then define the declaration +\mydate which can be used to + switch to your new format. In the following example, + two new date formats are defined, and they are then + selected to produce two different formats for the current date: +
+\newdateformat{dashdate}{%
+\twodigit{\THEDAY}-\twodigit{\THEMONTH}-\THEYEAR}
+
+\newdateformat{usvardate}{%
+\monthname[\THEMONTH] \ordinal{DAY}, \THEYEAR}
+
+Dash: \dashdate\today.
+US: \usvardate\today.
+
+If the current date is, say, 8th March, 2002, the above code will + produce the following: +Dash: 08-03-2002. +US: March 8th, 2002. + +

+Note that \THEDAY etc and DAY etc have no real +meaning outside \newdateformat (this is why they +are in uppercase). Incidentally, the dashdate format +is not really necessary, as you can achieve this format +using: +

+\renewcommand{\dateseparator}{-}
+\ddmmyyyydate
+
+ +

+Another note: in the above code, \ordinal was +used to illustrate the use of the DAY counter. It +is better to use \ordinaldate instead: +

+\newdateformat{usvardate}{%
+\monthname[\THEMONTH] \ordinaldate{\THEDAY}, \THEYEAR}
+
+ +

+ +

+Saving Dates +

+ +

+It is possible to save a date for later use using the command: +6 +

+ +\newdate{name}{day}{month}{year} + +

+This date can later be displayed using the same format as that +used by \formatdate using the command: +

+ +\displaydate{name} + +

+Individual elements of the date can be extracted using the +commands: +

+ +\getdateday{name} +

+ +\getdatemonth{name} +

+ +\getdateyear{name} + +

+ +

+Predefined Names +

+ +

+The following commands are defined by the datetime +package: + +

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Command Name Default Value
\dateseparator/
\timeseparator:
\amnameam
\pmnamepm
\amorpmname\amname if morning, otherwise \pmname
\amstringin the morning
\pmstringin the afternoon
\amorpmstring\amstring if morning, otherwise +\pmstring
\halfpastHalf past
\quarterpastQuarter past
\quartertoQuarter to
\noonNoon
\midnightMidnight
\oclockstringO'Clock
+ +

+ +

+Package Options +

+ +

+The following options may be passed to this package: +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
long make \today produce long date
short make \today produce short date
ddmmyyyy make \today produce DD/MM/YYYY date
dmyyyy make \today produce D/M/YYYY date
ddmmyy make \today produce DD/MM/YY date
dmyy make \today produce D/M/YY date
text make \today produce text date
us make \today produce US style date
mmddyyyy make \today produce MM/DD/YYYY date
mdyyyy make \today produce M/D/YYYY date
mmddyy make \today produce MM/DD/YY date
mdyy make \today produce M/D/YY date
raise make ordinal st,nd,rd,th appear as superscript
level make ordinal st,nd,rd,th appear level with rest of +text
dayofweek make the day of week appear for \longdate, +\shortdate
or \textdate
nodayofweek don't display the day of week.
24hr make \currenttime produce xxivtime +format
12hr make \currenttime produce ampmtime +format
oclock make \currenttime produce oclock +format
nodate Don't redefine \today or define the month or +day of week commands
(useful if you only want the time commands or +\pdfdate)
+ +

+The default options are: long, raise, +dayofweek and 24hr. + +

+ +

+Multilingual Support +

+ +

+If you want to use the babel package, you must load +it before you load the datetime package. This +is because the babel \datelang commands +redefine \today, whereas the datetime package +redefines \today to use \formatdate, and the +date formatting commands (such as \longdate) redefine +\formatdate rather than \today. This ensures +consistent formatting of the dates whether you use \today or +\formatdate. Therefore, the datetime package +has to redefine all the \datelang commands accordingly. +Thus the multilingual date support is mostly limited to that provided +by babel. Additional support, such as the day of +week names and abbreviations, are only supplied for those +languages that I know, or that other people have been able to supply +for me. + +

+The commands \monthname and \shortmonthname, +will produce the month name in the current language. +If you want the month name in a specific language, you +can use the command \monthnamelang. +For example, \monthnamefrench[6] will produce the output: +juin. Note that \textdate is formatted for English dates, +and won't look right if used with another language setting. If you +want a textual date, the fmtcount package (which is +loaded by datetime) defines some commands which display +a number or ordinal as a word, but it only has very limited +multilingual support. See the fmtcount documentation +for further details. + +

+There is currently only limited multilingual support for +\dayofweekname and \shortdayofweekname (just +English, French, Portuguese, Spanish and German7). You can add support +for other languages by defining the commands +\dayofweeknameidlang and +\shortdayofweeknameidlang. Note that these +commands only take one argument which should be +a number from 1 to 7 indicating the day of the week. + +

+You can use the following as templates. Replace +english with the name of your language (as given +by \languagename) and replace Sunday +etc as appropriate: +

+\providecommand*{\dayofweeknameidenglish}[1]{%
+\ifcase#1\relax
+\or Sunday%
+\or Monday%
+\or Tuesday%
+\or Wednesday%
+\or Thursday%
+\or Friday%
+\or Saturday%
+\fi}
+                                                          
+\providecommand*{\shortdayofweeknameidenglish}[1]{%
+\ifcase#1\relax
+\or Sun%
+\or Mon%
+\or Tue%
+\or Wed%
+\or Thu%
+\or Fri%
+\or Sat%
+\fi}
+
+If you want them added to future versions of +datetime, please email me the code. + +

+ +

+Configuration File +

+ +

+As from Version 2.4, the datetime package will read in settings +from the configuration file datetime.cfg, if it exists, +which will override the default package options. For example, +suppose you prefer a short date without the day of week by default, +you will need to create a file called datetime.cfg that +contains the line: +

+\shortdate\showdowfalse
+
+The file datetime.cfg should then go somewhere on the +TeX path. Now all you need to do is: +
+\usepackage{datetime}
+
+without having to specify the short and +nodayofweek options. + +

+You can also use this file to define and set your own date +styles. For example, you could create +a configuration file that has the following lines: +

+\newdateformat{dashdate}{\twodigit{\THEDAY}-\twodigit{\THEMONTH}-\THEYEAR}
+\dashdate
+
+Whenever you use the datetime package, it will now +use this format by default. + +

+ +

+LaTeX2HTML styles +

+ +

+Version 2.43 and above of the datetime bundle +supplies the LaTeX2HTML style file datetime.perl. +This file should be placed in a +directory searched by LaTeX2HTML. The following limitations +apply to the LaTeX2HTML styles: + +

+ +

+ +

+ +

+Troubleshooting +

+ +

+There is a datetime FAQ available at: +http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/ +

+


Footnotes

+
+
... +selected1
+
in fact, you may get an error from the +fmtcount package if you are using a language that it +doesn't support. + +
+
... +format2
+
Note that the commands \xxivtime, \ampmtime +and \oclock are still available, \settimeformat redefines +\currenttime to the command given by placing a backslash in front +of style. So \settimeformat{xxivtime} sets +\currenttime to \xxivtime and so on. + +
+
... \pdfdate3
+
thanks to Ulrich Dirr for +asking about this + +
+
...year4
+
Note the +name change since version 1.1. The command name was changed from +\thedate to \formatdate to avoid a name clash when using the +seminar class file. + +
+
...today5
+
To be more precise, +\today is defined to be +\formatdate{\day}{\month}{\year} where +\longdate etc change the definition of \formatdate + +
+
... command:6
+
Thanks to Denis Bitouzé for asking about this + +
+
... German7
+
thanks +to Uwe Bieling for supplying the German names + +
+
+

+
+Nicola L. C. Talbot. +School of Computing Sciences. +University of East Anglia. +Last Modified: 2007-08-20 +
+ + diff --git a/Master/texmf-dist/doc/latex/datetime/datetime.pdf b/Master/texmf-dist/doc/latex/datetime/datetime.pdf index 6a0adda2c59..f0c60ad6b65 100644 Binary files a/Master/texmf-dist/doc/latex/datetime/datetime.pdf and b/Master/texmf-dist/doc/latex/datetime/datetime.pdf differ diff --git a/Master/texmf-dist/doc/latex/datetime/datetime.perl b/Master/texmf-dist/doc/latex/datetime/datetime.perl index 012f42b6c73..fe56b9f6597 100644 --- a/Master/texmf-dist/doc/latex/datetime/datetime.perl +++ b/Master/texmf-dist/doc/latex/datetime/datetime.perl @@ -2,7 +2,21 @@ # Author : Nicola Talbot # Date : 21 Apr 2007 # Version : 1.03 -# Description : LaTeX2HTML implementation of datetime package. +# +# This is a LaTeX2HTML style implementing the datetime package, and +# is distributed as part of that package. +# Copyright 2007 Nicola L.C. Talbot +# 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. +# 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 `maintained'. +# +# The Current Maintainer of this work is Nicola Talbot. # set up default values for internal counters. @@ -198,7 +212,7 @@ sub do_datetime_breton{ $tmp .= 'local($_) = @_;'; $tmp .= 'local($num) = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($num=$2));'; $tmp .= 'local($before) = $num;'; - + $tmp .= 'if ($num == 1)'; $tmp .= '{ $before .= \'a\~n\'; }'; @@ -392,7 +406,7 @@ sub do_datetime_french{ $tmp .= 'local($_) = @_;'; $tmp .= 'local($num) = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($num=$2));'; $tmp .= 'local($before) = $num;'; - + $tmp .= 'if ($num == 1)'; $tmp .= '{ $before .= \'\ier\'; }'; @@ -907,7 +921,7 @@ sub do_datetime_welsh{ $tmp .= 'local($_) = @_;'; $tmp .= 'local($num) = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($num=$2));'; $tmp .= 'local($before) = $num;'; - + $tmp .= 'if ($num == 1)'; $tmp .= '{ $before .= \'a\~n\'; }'; @@ -1042,12 +1056,12 @@ sub get_day_of_week{ sub get_day_of_weekname_english{ local($dow) = @_; - local(@DayOfWeek) = ('Sunday', - 'Monday', - 'Tuesday', - 'Wednesday', - 'Thursday', - 'Friday', + local(@DayOfWeek) = ('Sunday', + 'Monday', + 'Tuesday', + 'Wednesday', + 'Thursday', + 'Friday', 'Saturday'); if ($dow <= 0 || $dow > 7) @@ -1064,11 +1078,11 @@ sub get_day_of_weekname_french{ local($dow) = @_; local(@DayOfWeek) = ('dimanche', - 'lundi', - 'mardi', - 'mercredi', - 'jeudi', - 'vendredi', + 'lundi', + 'mardi', + 'mercredi', + 'jeudi', + 'vendredi', 'samedi'); if ($dow <= 0 || $dow > 7) @@ -1085,11 +1099,11 @@ sub get_day_of_weekname_spanish{ local($dow) = @_; local(@DayOfWeek) = ('domingo', - 'lunes', - 'martes', - 'mi\\\'ercoles', - 'jueves', - 'viernes', + 'lunes', + 'martes', + 'mi\\\'ercoles', + 'jueves', + 'viernes', 's\\\'abado'); if ($dow <= 0 || $dow > 7) @@ -1106,11 +1120,11 @@ sub get_day_of_weekname_portuges{ local($dow) = @_; local(@DayOfWeek) = ('domingo', - 'segunda-feira', - 'ter\c{c}a-feira', - 'quarta-feira', + 'segunda-feira', + 'ter\c{c}a-feira', + 'quarta-feira', 'quinta-feira', - 'sexta-feira', + 'sexta-feira', 'sabado'); if ($dow <= 0 || $dow > 7) @@ -1127,11 +1141,11 @@ sub get_day_of_weekname_german{ local($dow) = @_; local(@DayOfWeek) = ('Sonntag', - 'Montag', - 'Dienstag', - 'Mittwoch', - 'Donnerstag', - 'Freitag', + 'Montag', + 'Dienstag', + 'Mittwoch', + 'Donnerstag', + 'Freitag', 'Samstag'); if ($dow <= 0 || $dow > 7) @@ -1148,11 +1162,11 @@ sub get_day_of_weekname_ngerman{ local($dow) = @_; local(@DayOfWeek) = ('Sonntag', - 'Montag', - 'Dienstag', - 'Mittwoch', - 'Donnerstag', - 'Freitag', + 'Montag', + 'Dienstag', + 'Mittwoch', + 'Donnerstag', + 'Freitag', 'Samstag'); if ($dow <= 0 || $dow > 7) @@ -1184,12 +1198,12 @@ sub get_day_of_weekname{ sub get_short_day_of_weekname_english{ local($dow) = @_; - local(@DayOfWeek) = ('Sun', - 'Mon', - 'Tue', - 'Wed', - 'Thu', - 'Fri', + local(@DayOfWeek) = ('Sun', + 'Mon', + 'Tue', + 'Wed', + 'Thu', + 'Fri', 'Sat'); if ($dow <= 0 || $dow > 7) @@ -1205,12 +1219,12 @@ sub get_short_day_of_weekname_english{ sub get_short_day_of_weekname_german{ local($dow) = @_; - local(@DayOfWeek) = ('So', - 'Mo', - 'Di', - 'Mi', - 'Do', - 'Fr', + local(@DayOfWeek) = ('So', + 'Mo', + 'Di', + 'Mi', + 'Do', + 'Fr', 'Sa'); if ($dow <= 0 || $dow > 7) @@ -1226,12 +1240,12 @@ sub get_short_day_of_weekname_german{ sub get_short_day_of_weekname_ngerman{ local($dow) = @_; - local(@DayOfWeek) = ('So', - 'Mo', - 'Di', - 'Mi', - 'Do', - 'Fr', + local(@DayOfWeek) = ('So', + 'Mo', + 'Di', + 'Mi', + 'Do', + 'Fr', 'Sa'); if ($dow <= 0 || $dow > 7) @@ -1561,7 +1575,7 @@ sub do_cmd_newdateformat{ sub do_cmd_pdfdate{ local($_) = @_; - local($timestring) = sprintf "%d%02d%02d%02d%02d%02d", + local($timestring) = sprintf "%d%02d%02d%02d%02d%02d", $global{YEAR}, $global{MONTH}, $global{DAY}, $global{HOUR}, $global{MINUTE}, $global{SECONDS}; join('', $timestring, $_[0]); @@ -1581,6 +1595,7 @@ sub do_cmd_newdate{ $year = &missing_braces unless ($_[0]=~(s/$next_pair_pr_rx//o)&&($year =$2)); + $userdates{$datename}{day} = $day; $userdates{$datename}{month} = $mon; $userdates{$datename}{year} = $year; diff --git a/Master/texmf-dist/doc/latex/datetime/dt-lang.tex b/Master/texmf-dist/doc/latex/datetime/dt-lang.tex new file mode 100644 index 00000000000..b495ed47cb8 --- /dev/null +++ b/Master/texmf-dist/doc/latex/datetime/dt-lang.tex @@ -0,0 +1,20 @@ +\documentclass{article} + +\usepackage[french,spanish,english]{babel} +\usepackage{datetime} + +\begin{document} +English: \today + +\selectlanguage{french} +French: \today + +\selectlanguage{spanish} +Spanish: \today + +\begin{otherlanguage}{french} +French: \today +\end{otherlanguage} + +\today +\end{document} diff --git a/Master/texmf-dist/doc/latex/datetime/dt-sampl.tex b/Master/texmf-dist/doc/latex/datetime/dt-sampl.tex index f1a16d56259..ed39ed2f7ce 100644 --- a/Master/texmf-dist/doc/latex/datetime/dt-sampl.tex +++ b/Master/texmf-dist/doc/latex/datetime/dt-sampl.tex @@ -1,31 +1,3 @@ -%% -%% This is file `dt-sampl.tex', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% datetime.dtx (with options: `dt-sampl.tex,package') -%% Copyright (C) 2007 Nicola Talbot, all rights reserved. -%% If you modify this file, you must change its name first. -%% You are NOT ALLOWED to distribute this file alone. You are NOT -%% ALLOWED to take money for the distribution or use of either this -%% file or a changed version, except for a nominal charge for copying -%% etc. -%% \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 \~} \documentclass[a4paper]{article} \usepackage{ifpdf} @@ -86,17 +58,17 @@ oclock & \settimeformat{oclock}\currenttime \begin{tabular}{ll} \verb|\longdate| & \longdate\formatdate{1}{3}{2000}\\ -\verb|\shortdate| & \shortdate\formatdate{8}{3}{2000}\\ -\verb|\ddmmyyyydate| & \ddmmyyyydate\formatdate{8}{3}{2000}\\ -\verb|\dmyyyydate| & \dmyyyydate\formatdate{8}{3}{2000}\\ -\verb|\ddmmyydate| & \ddmmyydate\formatdate{8}{3}{2000}\\ -\verb|\dmyydate| & \dmyydate\formatdate{8}{3}{2000}\\ -\verb|\textdate| & \textdate\formatdate{8}{3}{2000}\\ -\verb|\usdate| & \usdate\formatdate{8}{3}{2000}\\ -\verb|\mmddyyyydate| & \mmddyyyydate\formatdate{8}{3}{2000}\\ -\verb|\mdyyyydate| & \mdyyyydate\formatdate{8}{3}{2000}\\ -\verb|\mmddyydate| & \mmddyydate\formatdate{8}{3}{2000}\\ -\verb|\mdyydate| & \mdyydate\formatdate{8}{3}{2000} +\verb|\shortdate| & \shortdate\formatdate{1}{3}{2000}\\ +\verb|\ddmmyyyydate| & \ddmmyyyydate\formatdate{1}{3}{2000}\\ +\verb|\dmyyyydate| & \dmyyyydate\formatdate{1}{3}{2000}\\ +\verb|\ddmmyydate| & \ddmmyydate\formatdate{1}{3}{2000}\\ +\verb|\dmyydate| & \dmyydate\formatdate{1}{3}{2000}\\ +\verb|\textdate| & \textdate\formatdate{1}{3}{2000}\\ +\verb|\usdate| & \usdate\formatdate{1}{3}{2000}\\ +\verb|\mmddyyyydate| & \mmddyyyydate\formatdate{1}{3}{2000}\\ +\verb|\mdyyyydate| & \mdyyyydate\formatdate{1}{3}{2000}\\ +\verb|\mmddyydate| & \mmddyydate\formatdate{1}{3}{2000}\\ +\verb|\mdyydate| & \mdyydate\formatdate{1}{3}{2000} \end{tabular} \section{Defining New Dates} @@ -123,6 +95,3 @@ hhmm & \settimeformat{hhmm}\currenttime \end{tabular} \end{document} -\endinput -%% -%% End of file `dt-sampl.tex'. diff --git a/Master/texmf-dist/doc/latex/datetime/manual.html b/Master/texmf-dist/doc/latex/datetime/manual.html deleted file mode 100644 index eb0dd84c4eb..00000000000 --- a/Master/texmf-dist/doc/latex/datetime/manual.html +++ /dev/null @@ -1,870 +0,0 @@ - - - - - -datetime.sty v2.52: Formatting Current Date and Time - - - - - - - - - - - - - -Dr Nicola Talbot -| -School of Computing Sciences -| -University of East Anglia - -

- -

- -

datetime.sty v2.52: Formatting Current Date and -Time

-

Nicola L.C. Talbot

-

21 April 2007

-
- -

-Contents -

- - - - -

-Introduction -

- -The datetime package is a LaTeX2e package that -provides various different formats for \today, -and provides commands for displaying the current time. -If you only want the -time commands but not the date changing commands, you can pass -the option nodate to the package. - -

-Since version 2.4, the datetime package has been -separated into two packages: datetime and -fmtcount. When I originally created this package, -I defined the commands, \ordinal etc which could be used -in the definition of \today. Since then, I have extended -the number of commands available that can be used to display the -value of a LaTeX counter, however it seems more appropriate to -define all these counter-related commands in a separate package. -The fmtcount package is now distributed separately -from the datetime package, and will also need to -be installed. - -

-As from version 2.42, the datetime package is now -compatible with babel, however you must load the -datetime package after the babel package. For example: -

-\usepackage[francais]{babel}
-\usepackage{datetime}
-
- -

- -

-Date Declarations -

- There are various declarations that change the effect of -\today. The change can be localised by placing the -declaration within a group. - -

- - Day Month Year formats: -
-The declaration \longdate will redefine -\today to produce the current date displayed in the form -Wednesday 8th March, 2000 - if the package option dayofweek is used, or -8th March, 2000 if the package option - nodayofweek is used. -
-The declaration \shortdate will redefine -\today to produce the current date displayed in the form -Wed 8th Mar, 2000 if the package option -dayofweek is used, or 8th Mar, 2000 -if the package option nodayofweek is used. -
-The declaration \ddmmyyyydate will redefine -\today to produce - the current date displayed in the form 08/03/2000 -
-The declaration \dmyyyydate will redefine -\today to produce - the current date displayed in the form 8/3/2000 -
-The declaration \ddmmyydate will redefine -\today to produce - the current date displayed in the form 08/03/00 -
-The declaration \dmyydate will redefine -\today to produce - the current date displayed in the form 8/3/00 -
-The declaration \textdate will redefine -\today to produce the current date displayed in the form: -Wednesday the Eighth of March, Two Thousand if the package option -dayofweek is used, or Eighth of March, Two Thousand if -the package option nodayofweek is used. - -

- - Month Day Year formats: -
-The declaration \usdate will redefine -\today to produce the current date displayed in the form -March 8, 2000. (As TeX and LaTeX do by default.) -
-The declaration \mmddyyyydate will redefine -\today to produce the current date displayed in the form -03/08/2000 -
-The declaration \mdyyyydate will redefine -\today to produce the current date displayed in the form -3/8/2000 -
-The declaration \mmddyydate will redefine -\today to produce the current date displayed in the form -03/08/00 -
-The declaration \mdyydate will redefine -\today to produce the current date displayed in the form -3/8/00 - -

-In addition, the declarations \datelang are -available for all languages defined either by -calling babel prior to datetime or by -passing the language name as an option to datetime. -See later -if you want to define your own customised date format. - -

-As from version 2.43, the numerical date formats (such as -\ddmmyyyydate) use the command -\dateseparator to separate the numbers. So, for example, -if you want to hyphens instead of slashes, you can do: -

-\renewcommand{\dateseparator}{-}
-
- -

- -

-Time Commands -

- - The current time is displayed using the command -\currenttime. - - The format can be changed using the declaration -\settimeformat{style}, - where style is the name of the format1. Available -formats are: -
-
xxivtime
-
Twenty-four hour time in the form 22:28 (Default) -
-
ampmtime
-
Twelve hour time in the form 10:28pm -
-
oclock
-
Displays the current time as a string, e.g. -Twenty-Eight minutes past Ten in the afternoon.2 -
-
- -

-New time formats can be defined using the command: -
-
\newtimeformat{name}{format} -
-
-where name is the name of the new format (used in -\settimeformat), and format is how to format the -time. Within format you can use the counters -HOUR (number of hours after midnight), MINUTE -(number of minutes past the hour), HOURXII (number of -hours after midnight/midday), TOHOUR (the next hour) - and TOMINUTE (number of minutes to the next hour), and -the corresponding commands: - \THEHOUR, -\THEMINUTE, -\THEHOURXII, -\THETOHOUR and -\THETOMINUTE. - -

-For example, to define a new time format that uses a dot instead of a colon: -

-\newtimeformat{dottime}{\twodigit{\THEHOUR}.\twodigit{\THEMINUTE}}
-
-You then need to switch to this new format before you can use it: -
-\settimeformat{dottime}
-\currenttime
-
- -

-As from version 2.43, if you only want to change the separator, -you can simply redefine \timeseparator -instead of defining a new time format. For example: -

-\renewcommand{\timeseparator}{.}
-
-The xxivtime format will now work like the dottime format defined above. - -

- -

-Formating Dates -

- - The command \pdfdate3 prints the date in the format required for - PDF files, e.g. if the date is 1 May 2004 and time is - 22:02, \pdfdate will print 20040501220200. The reason -this date format is separate from all the others is because the -other form doesn't get properly expanded by PDFTeX. (This -command is defined regardless of whether the package option -nodate is called.) -Example: -
-\pdfinfo{
-   /Author (Me)
-   /Title (A Sample Document)
-   /CreationDate (D:20040501215500)
-   /ModificationDate (D:\pdfdate)
-}
-
- -

-There are two commands that print the name of the current - month: - - \monthname prints the current month name in full, -e.g. August, and - - \shortmonthname prints the abbreviated month name, -e.g. Aug. Both \monthname and -\shortmonthname take an optional argument (a number from -1 to 12) if the name of a specific month is required. For -example, \monthname[6] will produced the output: June. - -

-The day of the week is computed using the algorithm documented at - http://userpages.wittenburg.edu/bshelburne/Comp150/DayOfWeek.htm. - This algorithm works for any date between 1st -Jan, 1901 and 31st Dec, 2099. - The following macros display the day of week for a given date: - -

- - \dayofweekname{day}{month}{year} prints the - day of week for the specified date. For example, -\dayofweekname{31}{10}{2002} - will produce the output: Thursday. -
- \shortdayofweekname{day}{month}{year} prints the abbreviated name for the - day of week for the specified date. For example -
\shortdayofweekname{31}{10}{2002} -
-will produce the output: Thu. - -

-The TeX conditional \ifshowdow can be used to determine - whether or not the option dayofweek has been passed to -the package. - For example: -

-\ifshowdow\dayofweekname{31}{10}{2002} \fi
-
- will only display the day of week if the dayofweek -option was passed to datetime. - Alternatively, you can use David Carlisle's ifthen -package: -
-\ifthenelse{\boolean{showdow}}{\dayofweekname{31}{10}{2002} }{}
-
- -

-The command \ordinaldate{number} -displays number as a date-type ordinal. If the -current language is English, this will simply pass -the argument to \ordinalnum (defined in the -fmtcount package), -if the current language is Breton, Welsh or French, a superscript -will only be added if number is 1, otherwise only -number will be displayed. - -

-The macro \formatdate{day}{month}{year}4 formats - the specified date according to the current format of -\today5. (Arguments - must all be integers.) For example, in combination with -\longdate, the command -
\formatdate{27}{9}{2004} -
-will produce the output: Monday 27th -September, 2004. - -

-You can ensure that a number is displayed with at least two -digits by using the command -\twodigit{num}6. - This is of use if you want to define your own date or time -formats. - -

- -

-
-Defining New Date Formats -

- -

-New date formats can be defined using the command: -
-
\newdateformat{name}{format} -
-
-where name is the name of the new format, and - format is how to format the date. Within the - argument format you can use the commands \THEDAY, -\THEMONTH - and \THEYEAR to represent the relevant day, month and -year, or you can use the counters - DAY, MONTH and YEAR if you want to -use \ordinal etc. Once you have defined the - new date format, you can then switch to it using the declaration \name - (i.e. the name you specified preceded by a backslash), and - subsequent calls to \today and \formatdate will -use your new format. - -

-For example, suppose you want to define a new date format called, - say, mydate, that will typeset the date in the form: -8-3-2002, - then you can do: -

-\newdateformat{mydate}{\THEDAY-\THEMONTH-\THEYEAR}
-
- \newdateformat will then define the declaration -\mydate which can be used to - switch to your new format. In the following example, - two new date formats are defined, and they are then - selected to produce two different formats for the current date: -
-\newdateformat{dashdate}{%
-\twodigit{\THEDAY}-\twodigit{\THEMONTH}-\THEYEAR}
-
-\newdateformat{usvardate}{%
-\monthname[\THEMONTH] \ordinal{DAY}, \THEYEAR}
-
-Dash: \dashdate\today.
-US: \usvardate\today.
-
-If the current date is, say, 8th March, 2002, the above code will - produce the following: -Dash: 08-03-2002. -US: March 8th, 2002. - -

-Note that \THEDAY etc and DAY etc have no real -meaning outside \newdateformat (this is why they -are in uppercase). Incidentally, the dashdate format -is not really necessary, as you can achieve this format -using: -

-\renewcommand{\dateseparator}{-}
-\ddmmyyyydate
-
- -

-Another note: in the above code, \ordinal was -used to illustrate the use of the DAY counter. It -is better to use \ordinaldate instead: -

-\newdateformat{usvardate}{%
-\monthname[\THEMONTH] \ordinaldate{\THEDAY}, \THEYEAR}
-
- -

- -

-Saving Dates -

- -

-It is possible to save a date for later use using the command: -7 -

- -\newdate{name}{day}{month}{year} - -

-This date can later be displayed using the same format as that -used by \formatdate using the command: -

- -\displaydate{name} - -

-Individual elements of the date can be extracted using the -commands: -

- -\getdateday{name} -

- -\getdatemonth{name} -

- -\getdateyear{name} - -

- -

-Predefined Names -

- -

-The following commands are defined by the datetime -package: - -

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Command Name Default Value
\dateseparator/
\timeseparator:
\amnameam
\pmnamepm
\amorpmname\amname if morning, otherwise -\pmname
\amstringin the morning
\pmstringin the afternoon
\amorpmstring\amstring if morning, otherwise -\pmstring
\halfpastHalf past
\quarterpastQuarter past
\quartertoQuarter to
\noonNoon
\midnightMidnight
\oclockstringO'Clock
- -

- -

-Package Options -

- -

-The following options may be passed to this package: -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
long make \today produce long date
short make \today produce short date
ddmmyyyy make \today produce DD/MM/YYYY date
dmyyyy make \today produce D/M/YYYY date
ddmmyy make \today produce DD/MM/YY date
dmyy make \today produce D/M/YY date
text make \today produce text date
us make \today produce US style date
mmddyyyy make \today produce MM/DD/YYYY date
mdyyyy make \today produce M/D/YYYY date
mmddyy make \today produce MM/DD/YY date
mdyy make \today produce M/D/YY date
raise make ordinal st,nd,rd,th appear as superscript
level make ordinal st,nd,rd,th appear level with rest of -text
dayofweek make the day of week appear for \longdate, -\shortdate
or \textdate
nodayofweek don't display the day of week.
24hr make \currenttime produce xxivtime -format
12hr make \currenttime produce ampmtime -format
oclock make \currenttime produce oclock -format
nodate Don't redefine \today or define the month or -day of week commands
(useful if you only want the time commands or -\pdfdate)
- -

-The default options are: long, raise, -dayofweek and 24hr. - -

- -

-Multilingual Support -

- -

-If the babel package is called prior to -datetime, \datelang -will be the default date format, -where lang is the current language. - -

-The commands \monthname and \shortmonthname, -will produce the month name in the current language. -If you want the month name in a specific language, you -can use the command \monthnamelang. -For example, \monthnamefrench[6] will produce the output: -juin. - -

-There is currently only limited multilingual support for -\dayofweekname and \shortdayofweekname (just -English, French, Portuguese, Spanish and German8). You can add support for -other languages by defining the commands -\dayofweeknameidlang and -\shortdayofweeknameidlang. Note that these -commands only take one argument which should be -a number from 1 to 7 indicating the day of the week. - -

-You can use the following as templates. Replace -english with the name of your language (as given -by \languagename) and replace Sunday -etc as appropriate: -

-\providecommand{\dayofweeknameidenglish}[1]{%
-\ifcase#1\relax
-\or Sunday%
-\or Monday%
-\or Tuesday%
-\or Wednesday%
-\or Thursday%
-\or Friday%
-\or Saturday%
-\fi}
-                                                          
-\providecommand{\shortdayofweeknameidenglish}[1]{%
-\ifcase#1\relax
-\or Sun%
-\or Mon%
-\or Tue%
-\or Wed%
-\or Thu%
-\or Fri%
-\or Sat%
-\fi}
-
-If you want them added to future versions of -datetime, please e-mail me the code. - -

- -

-Configuration File -

- -

-As from Version 2.4, the datetime package will read in -settings from the configuration - file datetime.cfg, if it exists, which will override -the default package options. - For example, suppose you prefer a short date without the day of -week by default, you will need to create - a file called datetime.cfg that contains the line: -

-\shortdate\showdowfalse
-
-The file datetime.cfg should then go somewhere on the -TeX path. Now all you need to do is: -
-\usepackage{datetime}
-
-without having to specify the short and -nodayofweek options. - -

-You can also use this file to define and set your own date -styles. For example, you could create -a configuration file that has the following lines: -

-\newdateformat{dashdate}{\twodigit{\THEDAY}-\twodigit{\THEMONTH}-\THEYEAR}
-\dashdate
-
-Whenever you use the datetime package, it will now -use this format by default. - -

- -

-LaTeX2HTML styles -

- -

-Version 2.43 and above of the datetime bundle -supplies the LaTeX2HTML style file datetime.perl. -This file should be placed in a -directory searched by LaTeX2HTML. The following limitations -apply to the LaTeX2HTML styles: - -

- -

- -

- -

-Troubleshooting -

- -

-There is a datetime FAQ available at: -http://theoval.cmp.uea.ac.uk/~nlct/latex/packages/faq/ -

- -

-Contact Details -

- Dr Nicola Talbot -
-School of Computing Sciences -
-University of East Anglia -
-Norwich. NR4 7TJ. -
-United Kingdom. -
http://theoval.cmp.uea.ac.uk/~nlct/ -

Footnotes

-
-
... format1
-
Note that the commands \xxivtime, -\ampmtime and - \oclock are still available, -\settimeformat - redefines \currenttime to the command -given by placing a backslash in front of style. So - \settimeformat{xxivtime} sets -\currenttime - to \xxivtime and so on. - -
-
... afternoon.2
-
Version -2.43 fixed bug which caused an infinite loop on the hour. - -
-
... \pdfdate3
-
thanks to Ulrich Dirr for -asking about this - -
-
...year}4
-
Note the - name change since version 1.1. The command name was changed -from \thedate - to \formatdate - to avoid a name clash when using the seminar class -file. - -
-
... -\today5
-
To be more precise, \ -today is defined to be \ -formatdate{\day}{\month}{\year} - where \longdate etc change the definition -of \formatdate - -
-
...num}6
-
New to version 2.2 - -
-
... command:7
-
Thanks to Denis Bitouzé for asking about this - -
-
... German8
-
thanks -to Uwe Bieling for supplying the German names - -
-
-

-
-Nicola L. C. Talbot. -School of Computing Sciences. -University of East Anglia. -Last Modified: 2007-04-21 -
- - -- cgit v1.2.3