diff options
author | Karl Berry <karl@freefriends.org> | 2008-06-30 16:24:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-06-30 16:24:23 +0000 |
commit | 18bb1e2c2cf25f1d0e33edb438a899f6a80cae02 (patch) | |
tree | b33c37fe6b3c4d023321980aa68c4ac937f40827 /Master/texmf-dist/tex/latex/eukdate | |
parent | 8c35ac8f04be9e931fcae14c5f283e875ffaebda (diff) |
new latex package eukdate (30jun08)
git-svn-id: svn://tug.org/texlive/trunk@9114 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/eukdate')
-rw-r--r-- | Master/texmf-dist/tex/latex/eukdate/eukdate.sty | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/eukdate/eukdate.sty b/Master/texmf-dist/tex/latex/eukdate/eukdate.sty new file mode 100644 index 00000000000..c2bccba2567 --- /dev/null +++ b/Master/texmf-dist/tex/latex/eukdate/eukdate.sty @@ -0,0 +1,90 @@ +%% +%% This is file `eukdate.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% eukdate.dtx (with options: `package') +%% +%% This is a generated file. +%% +%% Copyright Andrew Gilbert Moschou 2008 +%% +%% This work may be distributed and/or modified under the +%% conditions of the LaTeX Project Public License, either version 1.3c +%% 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.3c or later is part of all distributions of LaTeX +%% version 2005/12/01 or later. +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{eukdate}[2008/06/28 v1.01 LaTeX Package UK format date with weekday] +\newif\if@euk@noweekday +\newif\if@euk@usdate +\newif\if@euk@julian +\DeclareOption{no-weekday}{\@euk@noweekdaytrue} +\DeclareOption{ukdate}{\@euk@usdatefalse} +\DeclareOption{usdate}{\@euk@usdatetrue} +\DeclareOption{gregorian}{\@euk@julianfalse} +\DeclareOption{julian}{\@euk@juliantrue} +\ExecuteOptions{ukdate,gregorian} +\ProcessOptions\relax +\newcounter{euk@date} +\newcounter{euk@month} +\newcounter{euk@century} +\newcounter{euk@year} +\setcounter{euk@date}{\number\day} +\setcounter{euk@month}{\number\month} +\setcounter{euk@century}{\number\year} +\divide\c@euk@century by 100 +\setcounter{euk@year}{\number\year} +\addtocounter{euk@year}{-\theeuk@century00} +\ifnum\number\theeuk@month<3 + \addtocounter{euk@month}{13} + \addtocounter{euk@year}{-1} +\else + \addtocounter{euk@month}{1} +\fi +\multiply\c@euk@month by 26 +\divide\c@euk@month by 10 +\addtocounter{euk@date}{\theeuk@month} +\addtocounter{euk@date}{\theeuk@year} +\divide\c@euk@year by 4 +\addtocounter{euk@date}{\theeuk@year} +\if@euk@julian + \addtocounter{euk@date}{6\theeuk@century} + \addtocounter{euk@date}{5} +\else + \addtocounter{euk@date}{5\theeuk@century} + \divide\c@euk@century by 4 + \addtocounter{euk@date}{\theeuk@century} +\fi +\loop\ifnum6<\theeuk@date + \addtocounter{euk@date}{-7} +\repeat +\newcommand\weekday{% + \ifcase\theeuk@date Saturday\or Sunday\or Monday\or% + Tuesday\or Wednesday\or Thursday\or Friday\fi} +\newcommand\monthname{% + \ifcase\number\month\or January\or February\or March\or% + April\or May\or June\or July\or August\or% + September\or October\or November\or December\fi} +\def\today{% + \if@euk@noweekday\else\weekday,\space\fi% + \if@euk@usdate + \monthname\space\number\day,% + \else + \number\day\space\monthname% + \fi + \space\number\year} +\edef\euk@ordinal{% + \ifcase\number\day\or st\or nd\or rd\or th\or th\or% + th\or th\or th\or th\or th\or th\or th\or th\or th\or% + th\or th\or th\or th\or th\or th\or st\or nd\or rd\or% + th\or th\or th\or th\or th\or th\or th\or st\fi} +\endinput +%% +%% End of file `eukdate.sty'. |