diff options
Diffstat (limited to 'macros/latex/contrib/ukbill/ukbill-documentation.tex')
-rw-r--r-- | macros/latex/contrib/ukbill/ukbill-documentation.tex | 59 |
1 files changed, 52 insertions, 7 deletions
diff --git a/macros/latex/contrib/ukbill/ukbill-documentation.tex b/macros/latex/contrib/ukbill/ukbill-documentation.tex index a4577f8c76..f8f1de1635 100644 --- a/macros/latex/contrib/ukbill/ukbill-documentation.tex +++ b/macros/latex/contrib/ukbill/ukbill-documentation.tex @@ -25,7 +25,7 @@ ItalicFont={Palatine Parliamentary Italic}]{Palatine Parliamentary Regular} \newcommand{\thebox}{{\boxy ▯}} %\usepackage[firstnumber=last]{fancyvrb} \usepackage{minted} -\date{\today\\\smallskip\ttfamily Version 1.0.2} +\date{\today\\\smallskip\ttfamily Version 1.2.0} \author{Elijah Z Granet\thanks{e-mail: \href{mailto:ezg21@cantab.ac.uk}{\ttfamily ezg21@cantab.ac.uk}}} \title{\texttt{ukbill}:\\A package for typesetting UK legislation} @@ -168,8 +168,8 @@ firstnumber=last ] {latex} \NeedsTeXFormat{LaTeX2e} -\def\ukbillversionnumber{1.0.3} -\ProvidesClass{ukbill}[2022-12-01 A Class for Legal Notes] +\def\ukbillversionnumber{1.2.0} +\ProvidesClass{ukbill}[2024-01-06 A Class for UK legislation] % !TeX program = lualatex % !TeX encoding = utf8 % This work may be distributed and/or modified under the @@ -200,6 +200,41 @@ firstnumber=last \end{center} \addcontentsline{toc}{chapter}{\rule{.45\textwidth}{1pt}} } +%\RequirePackage{datetime2} +%\DTMlangsetup[en-GB]{ord=omit} +\ExplSyntaxOn + +\NewExpandableDocumentCommand{\addordinal}{m} + {% #1 should be something that TeX interprets as an integer + \int_to_arabic:n { #1 } + \exp_args:Ne \ORDINAL { \deman_compute_suffix:n { #1 } } + } + +\NewDocumentCommand{\ORDINAL}{m}{\textsuperscript{\itshape #1}}% how ugly is it? + +\cs_new:Nn \deman_compute_suffix:n + { + \int_case:nnF { #1 } + {% special cases + {11}{th} + {12}{th} + {13}{th} + } + { \__deman_compute_suffix_normal:n { #1 } } + } + +\cs_new:Nn \__deman_compute_suffix_normal:n + { + \int_case:nnF { \int_mod:nn { #1 } { 10 } } + { + {1}{st} + {2}{nd} + {3}{rd} + } + {th} + } +\ExplSyntaxOff + %%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -219,11 +254,23 @@ firstnumber=last \newcommand{\whereas}[1]{\def\@whereas{#1}} \newcommand{\printwhereas}{\@whereas} +%\newcommand{\billto}[1]{\def\@billto{#1}} + + \newcommand{\publishedby}[1]{\def\@publishedby{#1}} \newcommand{\printpublishedby}{\@publishedby} \def\@publishedby{\@latex@warning@no@line{No \noexpand\publishedby given}} \newcommand{\billtitle}[1]{\def\@billtitle{#1}} \newcommand{\printbilltitle}{\@billtitle} +\newcommand{\billday}[1]{\def\@billday{#1}} +\newcommand{\printbillday}{\@billday} +\def\@billday{\@latex@warning@no@line{No \noexpand\billday given}} +\newcommand{\billmonth}[1]{\def\@billmonth{#1}} +\newcommand{\printbillmonth}{\@billmonth} +\def\@billmonth{\@latex@warning@no@line{No \noexpand\billmonth given}} +\newcommand{\billyear}[1]{\def\@billyear{#1}} +\newcommand{\printbillyear}{\@billyear} +\def\@billyear{\@latex@warning@no@line{No \noexpand\billyear given}} \def\@billtitle{\@latex@warning@no@line{No \noexpand\billtitle given}} \newcommand{\humanrights}[1]{\def\@humanrights{#1}} \newcommand{\printhumanrights}{\@humanrights} @@ -496,7 +543,6 @@ BoldFont={PalatineP-Bold}, ItalicFont={PalatineP-Italic}, BoldItalicFont={PalatineP-BoldItalic}]{PalatineP-Regular} \newfontface{\extfont}[SmallCapsFont={Times New Roman}]{Times New Roman}}{\ClassWarning{Please install the Palatine Parliamentary Font}} - \RequirePackage[english]{babel} %\RequirePackage{csquotes} %\MakeOuterQuote{"} @@ -746,8 +792,7 @@ the authority of the same, as follows:― \vskip 3ex \end{center} -\normalsize To make provision in connection with the citizens of certain Commonwealth Realms - +\normalsize \printbillto \vskip 3ex \begin{center} @@ -759,7 +804,7 @@ the authority of the same, as follows:― \vspace{1ex} \begin{minipage}{.4\textwidth}\centering -\itshape Ordered, by\normalfont\ \printdrafter\itshape\ to be Printed, \normalfont 19\itshape th March \normalfont 2020\itshape. +\itshape Ordered, by\normalfont\ \printdrafter\itshape\ to be Printed, {\normalfont\addordinal{\printbillday}} \textit{\printbillmonth} \printbillyear. \end{minipage} \vspace{1ex} |