summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/ukbill/ukbill-documentation.tex
blob: f8f1de16359563cfa05f25ec05967be629632a19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
\documentclass{article}
\usepackage{verbatim}
\usepackage{xcolor}
\usepackage{luaquotes}
\usepackage{longtable}
\definecolor{darkspringgreen}{rgb}{0.09, 0.45, 0.27}
\definecolor{dsg}{rgb}{0.09, 0.45, 0.27}
\usepackage[hidelinks]{hyperref}
\usepackage{hologo}
\usepackage[british]{babel}
\usepackage[useregional]{datetime2}
\DTMlangsetup[en-GB]{ord=omit}
\definecolor{LightGray}{gray}{0.9}
%\usepackage{mathpazo}
\usepackage{fontspec}
\IfFontExistsTF{Palatine Parliamentary}{\setromanfont[RawFeature={+onum,+pnum},%
BoldFont={Palatine Parliamentary Bold},
ItalicFont={Palatine Parliamentary Italic}]{Palatine Parliamentary Regular}
}{\setromanfont[RawFeature={+onum,+pnum}]{TeX Gyre PagellaX}}
\setmonofont[Scale=.9]{Source Code Pro}
%\newfontface\primeback[Scale=1.01]{Libertinus Serif}
\newcommand{\primeback}{}

\newfontface\boxy{DejaVu Sans}
\newcommand{\thebox}{{\boxy ▯}}
%\usepackage[firstnumber=last]{fancyvrb}
\usepackage{minted}
\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}

\begin{document}
\maketitle
\tableofcontents
\clearpage
\section{Overview}
This is a class for typesetting bills in the standard used by the Parliament of the United Kingdom. It is meant to be of use to students of law and politics, to Parliamentary agents and lawyers drafting private bills, and to aid in the construct of proposals for law reform. The use of this package requires the libre font `Palatine Parliamentary', which imitates the official typeface of the UK Parliament.\footnote{The font is available at this link: \url{https://github.com/ezgranet/palatine-parliamentary}}
\section{Usage}
For an example of the usage of the package, please see the attached `\texttt{immigration-bill.tex}' example in the package archive.

\subsection{Calling the package}
Call the package with {\color{darkspringgreen}\ttfamily \verb|\documentclass{ukbill}|}
\subsection{Declaring variables}
In your preamble, declare  the following variables to populate your bill. 
\begin{center}
\begin{tabular}{lp{2.5in}}
\bfseries Variable name & \bfseries Explanation\\
\ttfamily \verb|\drafter{}| & The drafter of the bill\\
\ttfamily \verb|\billcopyright{}| & Copyright notice at the end of the bill \\
\ttfamily \verb|\publishedby{}| & The publisher of the bill for notice at the end of the bill \\
\ttfamily\verb|\billtitle{}| & The title of the bill\\
\ttfamily \verb|billto{}| & { The purpose or long title of the bill}\\
\ttfamily \verb|\humanrights{}| & The statutorily required statement under the Human Rights Act 1998\\
\ttfamily \verb|\exptitle{}| & The title of the explanatory section—if you have extra notes added separately, title it `Explanatory Notes'; otherwise use `Explanatory Memorandum'\\
\ttfamily \verb|\exptext{}| & The content of the explanatory memorandum (or notice about separate explanatory notes)\\
\ttfamily \verb|\billnum{}| & The number of the bill for the cover sheet and back page\\
\ttfamily \verb|\whereas{}| &
This variable is needed \textbf{only} in the \texttt{private} option of the class. It contains  the recitals, best formatted as a numbered list 
\end{tabular}

\end{center}


\subsection{Bill parts}
The command {\color{darkspringgreen}\ttfamily\verb|\chapter|} divides the  main content of the bill up into appropriate parts noted in the Table of Contents. For example, `Introductory Provisions'.  
\subsection{Sections}
The section is the main unit of legislation and is titled with {\color{darkspringgreen}\ttfamily\verb|\section|}.  Most sections will be numbered and numbered subsections use the {\color{darkspringgreen}\ttfamily\verb|numstat|} environment as follows:
\begin{minted}[
frame=lines,
framesep=2mm,
baselinestretch=1.2,
bgcolor=LightGray,
fontsize=\footnotesize,
breaklines,
firstnumber=last
]
{latex}
\begin{numstat}
	\item The first provision
	\item The second provision
\end{numstat}
\end{minted}

Often, these sections will be nested with alphabetical subsubsections, Roman paragraphs, and double alphabetical (\textit{ie}, `aa') subparagraphs. These are called with  {\color{darkspringgreen}\ttfamily\verb|alphstat|}, {\color{darkspringgreen}\ttfamily\verb|romstat|}, and {\color{darkspringgreen}\ttfamily\verb|twoalphstat|}, respectively.
\begin{minted}[
frame=lines,
framesep=2mm,
baselinestretch=1.2,
bgcolor=LightGray,
fontsize=\footnotesize,
breaklines,
firstnumber=last
]
{latex}
\begin{numstat}
	\item A subsection
	\begin{alphstat}
		\item Nesting
		\begin{romstat}
			\item Even more nesting
			\begin{twoalphstat}
				\item this is too much nesting now, lads	
			\end{twoalphstat}
  		\end{romstat}
	\end{alphstat}
	\item a subsection again
\end{numstat}
\end{minted}


Occasionally, a section will have only one provision, and therefore no numbering is needed. In this case, use the {\color{darkspringgreen}\ttfamily\verb|nostat|} environment.

\begin{minted}[
frame=lines,
framesep=2mm,
baselinestretch=1.2,
bgcolor=LightGray,
fontsize=\footnotesize,
breaklines,
firstnumber=last
]
{latex}
\begin{nostat}
	\item The first provision
	\item The second provision
\end{nostat}
\end{minted}

\subsection{Schedules}

Some legislation requires schedules appended to the body of main legislation. To begin typesetting schedules (as opposed to the preceding main content of the bill), use the command {\color{darkspringgreen}\ttfamily\verb|\startschedule|}

A schedule is then named by the command {\color{darkspringgreen}\ttfamily\verb|\schedule{Name}|}, while a Part (\textit{ie}, a subset of a schedule) is called using {\color{darkspringgreen}\ttfamily\verb|\schdpart{name}|}

\subsection{The `private' Option}

Private bills have a different enacting formula and also make use of recitals. Drafting private bills therefore requires you to call the class with the option {\color{darkspringgreen}\ttfamily\verb|\documentclass[private]{ukbill}|}
	
	\section{Future Development }
	The package's online repository is the best place to report bugs, feature requests, or other contributions, and is located at: \\\url{github.com/ezgranet/ukbill}.  
	
	\section{Licence}
	This project is licensed under the Latex Public Project Licence version 1.3\textit{c}. This documentation is copyright of the author but licensed under CC-BY-SA 4.0. 
	\section{Version History}
				\subsection{\normalfont\texttt{1.0.2}}
\ttfamily 13 December 2022: fixed an error with changes made in 1.0.2
\subsection{\normalfont\texttt{1.0.2}}
\ttfamily 13 December 2022: fixed an error with indent in the `nostat' environment
\subsection{\normalfont\texttt{1.0.1}}
\ttfamily 12 December 2022: Fixes to example documentation

\subsection{\normalfont\texttt{1.0.0}}
\ttfamily 1 December 2022: Class Creation


	\clearpage\section{Implementation}
	
\begin{minted}[
frame=lines,
framesep=2mm,
baselinestretch=1.2,
bgcolor=LightGray,
fontsize=\footnotesize,
linenos,
breaklines,
firstnumber=last
]
{latex}
\NeedsTeXFormat{LaTeX2e}
\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 
% 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.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Elijah Z Granet


\LoadClass[a4paper,12pt]{memoir}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% schedule divisions
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\schdpart}[1]{\subsubsection{#1}}
\newcommand{\startschedule}{\clearpage
\setcounter{schedon}{1}
%\setcounter{subsection}{}
\setcounter{part}{0}
\begin{center}
	\large\textsc{SCHEDULES}
\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

%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Variables
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeatletter
\newcommand{\drafter}[1]{\def\@drafter{#1}}
\newcommand{\printdrafter}{\@drafter}
\def\@drafter{\@latex@warning@no@line{No \noexpand\drafter given}}
\newcommand{\billcopyright}[1]{\def\@billcopyright{#1}}
\newcommand{\printbillcopyright}{\@billcopyright}
\def\@billcopyright{\@latex@warning@no@line{No \noexpand\billcopyright given}}
\newcommand{\billto}[1]{\def\@billto{#1}}
\newcommand{\printbillto}{\@billto}
\def\@billto{\@latex@warning@no@line{No \noexpand\billto given}}
\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}
\def\@humanrights{\@latex@warning@no@line{No \noexpand\humanrightsgiven}
}
\newcommand{\exptitle}[1]{\def\@exptitle{#1}}
\newcommand{\printexptitle}{\@exptitle}
\def\@exptitle{\@latex@warning@no@line{No \noexpand\exptitle given}}
\newcommand{\exptext}[1]{\def\@exptext{#1}}
\newcommand{\printexptext}{\@exptext}
\def\@exptext{\@latex@warning@no@line{No \noexpand\exptext given}}
\newcommand{\billnum}[1]{\def\@billnum{#1}}
\newcommand{\printbillnum}{\@billnum}
\def\@billnum{\@latex@warning@no@line{No \noexpand\billnum given}}


\makeatother
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% hyphenation
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage[none]{hyphenat}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% list organisation
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\RequirePackage{paralist}
  \let\itemize\compactitem
  \let\enditemize\endcompactitem
  \let\enumerate\compactenum
  \let\endenumerate\endcompactenum
  \let\description\compactdesc
  \let\enddescription\endcompactdesc
  \pltopsep=-12pt
  \plitemsep=0pt
  \plparsep=0pt
\newcounter{schedcount}
\counterwithout{section}{chapter}

\counterwithin{schedcount}{subsubsection}
\setsecnumdepth{subsubsection}
\def\tocmark{\markboth{\MakeTextUppercase{}}{}}
\RequirePackage[absolute]{textpos}
\setlength{\TPHorizModule}{10mm}
\setlength{\TPVertModule}{10mm}
\TPGrid[15mm,1mm]{8}{9}                        % Divide page in 9x9 grid 
\DeclareRobustCommand{\Leftblock}{{
\begin{textblock}{10}(0.5,1.8)\footnotesize\itshape 5\end{textblock}
\begin{textblock}{10}(0.5,2.7)\footnotesize\itshape 10\end{textblock}
\begin{textblock}{10}(0.5,3.6)\footnotesize\itshape 15\end{textblock}
\begin{textblock}{10}(0.5,4.5)\footnotesize\itshape 20\end{textblock}
\begin{textblock}{10}(0.5,5.4)\footnotesize\itshape 25\end{textblock}
\begin{textblock}{10}(0.5,6.3)\footnotesize\itshape 30\end{textblock}
\begin{textblock}{10}(0.5,7.2)\footnotesize\itshape 35\end{textblock}
}}
\DeclareRobustCommand{\Rightblock}{{
\begin{textblock}{10}(7.75,1.8)\footnotesize\itshape 5\end{textblock}
\begin{textblock}{10}(7.75,2.7)\footnotesize\itshape 10\end{textblock}
\begin{textblock}{10}(7.75,3.6)\footnotesize\itshape 15\end{textblock}
\begin{textblock}{10}(7.75,4.5)\footnotesize\itshape 20\end{textblock}
\begin{textblock}{10}(7.75,5.4)\footnotesize\itshape 25\end{textblock}
\begin{textblock}{10}(7.75,6.3)\footnotesize\itshape 30\end{textblock}
\begin{textblock}{10}(7.75,7.2)\footnotesize\itshape 35\end{textblock}
}}
\DeclareRobustCommand{\Firstblock}{{
%\begin{textblock}{10}(7.75,1.8)\footnotesize\itshape 5\end{textblock}
%\begin{textblock}{10}(7.75,2.7)\footnotesize\itshape 10\end{textblock}
%\begin{textblock}{10}(7.75,3.6)\footnotesize\itshape 15\end{textblock}
\begin{textblock}{10}(7.75,4.5)\footnotesize\itshape 5\end{textblock}
\begin{textblock}{5}(7.75,5.4)\footnotesize\itshape 10\end{textblock}
\begin{textblock}{10}(7.75,6.3)\footnotesize\itshape 15\end{textblock}
\begin{textblock}{10}(7.75,7.2)\footnotesize\itshape 20\end{textblock}
}}

\RequirePackage{ccicons}
 \makepagestyle{bill}
  \makepagestyle{billfirst}

 \makeatletter
 \makepsmarks {bill}{
\nouppercaseheads}
\makeatother
\makeatletter
 \renewcommand{\bookpagemark}[1]{\itshape\thetitle\\}
  \makepsmarks {billfirst}{
\nouppercaseheads}
\makeatother
 \renewcommand{\bookpagemark}[1]{\noindent\itshape\thetitle\\}

% \renewcommand{\partpagemark}[1]{\itshape\thetitle\\}
 \makepagestyle{front}

 \makepagestyle{sched}
 \makeatletter
 \makepsmarks {sched}{
\nouppercaseheads}
\makeatother
 \renewcommand{\bookpagemark}[1]{\itshape\thetitle\\}
% \renewcommand{\partpagemark}[1]{\itshape\thetitle\\}
\clearmark{chapter}
\clearmark{section}

\createmark{part}{both}{shownumber}{\partname\space}{.\space}

 
 \RequirePackage[margin=3.25cm,headheight=100pt]{geometry}
 \makeatletter
 \makeevenfoot{front}{}{}{\printbillnum}
  \makeoddfoot{front}{}{}{\printbillnum}
  \makeatother

\renewcommand{\bookname}{\printbilltitle}
\makeheadrule{bill}{\textwidth}{1pt}
 \makeevenhead{bill}{\Rightblock\normalsize\thepage\ifnum\value{part}>0\\\else\fi\ifnum\value{schedon}=1\\\else\fi\ifnum\value{subsubsection}>0\vskip 12pt\else\fi}{}{\footnotesize\itshape\bookname
   \ifnum\value{schedon}=1
\\ \itshape Schedule \arabic{subsection}\hspace{1ex}—\hspace{1ex}\currentsubsection \else\fi
  \ifnum\value{part}>0
\\Part \arabic{part}\hspace{1ex}—\hspace{1ex}\rightmark
 \else\fi\ifnum\value{subsubsection}>0\\Part \arabic{subsubsection}\hspace{1ex}—\hspace{1ex}\currentsubsubsection\else\fi}
  \makeoddhead{bill}{\Rightblock\footnotesize\itshape\bookname
   \ifnum\value{schedon}=1
\\ \itshape Schedule \arabic{subsection}\hspace{1ex}—\hspace{1ex}\currentsubsection \else\fi
  \ifnum\value{part}>0
\\Part \arabic{part}\hspace{1ex}—\hspace{1ex}\rightmark
 \else\fi\ifnum\value{subsubsection}>0\\Part \arabic{subsubsection}\hspace{1ex}—\hspace{1ex}\currentsubsubsection\else\fi}{}{\normalsize\thepage\ifnum\value{part}>0\\\else\fi\ifnum\value{schedon}=1\\\else\fi\ifnum\value{subsubsection}>0\vskip 12pt\else\fi}
 \makeoddfoot{bill}{}{}{}
%\renewcommand{\subsectionmark}[1]{#1}




%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% bill-first

%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\makeheadrule{billfirst}{\textwidth}{1pt}
 \makeevenhead{billfirst}{\Firstblock\normalsize\thepage\ifnum\value{part}>0\\\else\fi\ifnum\value{schedon}=1\\\else\fi\ifnum\value{subsubsection}>0\vskip 12pt\else\fi}{}{\footnotesize\itshape\bookname
   \ifnum\value{schedon}=1
\\ \itshape Schedule \arabic{subsection}\hspace{1ex}—\hspace{1ex}\currentsubsection \else\fi
  \ifnum\value{part}>0
\\Part \arabic{part}\hspace{1ex}—\hspace{1ex}\rightmark
 \else\fi\ifnum\value{subsubsection}>0\\Part \arabic{subsubsection}\hspace{1ex}—\hspace{1ex}\currentsubsubsection\else\fi}
  \makeoddhead{billfirst}{\Firstblock\footnotesize\itshape\bookname
   \ifnum\value{schedon}=1
\\ \itshape Schedule \arabic{subsection}\hspace{1ex}—\hspace{1ex}\currentsubsection \else\fi
  \ifnum\value{part}>0
\\Part \arabic{part}\hspace{1ex}—\hspace{1ex}\rightmark
 \else\fi\ifnum\value{subsubsection}>0\\Part \arabic{subsubsection}\hspace{1ex}—\hspace{1ex}\currentsubsubsection\else\fi}{}{\normalsize\thepage\ifnum\value{part}>0\\\else\fi\ifnum\value{schedon}=1\\\else\fi\ifnum\value{subsubsection}>0\vskip 12pt\else\fi}
 \makeoddfoot{billfirst}{}{}{}
%\renewcommand{\subsectionmark}[1]{#1}



\renewcommand{\chaptermark}[1]{#1}
\cftpagenumbersoff{part}
\cftpagenumbersoff{chapter}
\cftpagenumbersoff{subsection}
\cftpagenumbersoff{subsubsection}
\renewcommand{\cftsubsectionpresnum}{\flushleft Schedule\hspace{1ex}}% Prefix to number for \subsection in ToC

\renewcommand{\cftsubsubsectionpresnum}{Part\hspace{1ex}}% Prefix to number for \subsection in ToC

\renewcommand{\thesubsection}{\arabic{subsection}}
\renewcommand{\thesubsubsection}{\arabic{subsubsection}}
\renewcommand{\cftsubsectionaftersnum}{\hspace{1ex}—\hspace{1ex}}
\renewcommand{\cftsubsubsectionaftersnum}{\hspace{1ex}—\hspace{1ex}}

\settocdepth{subsubsection}
\cftpagenumbersoff{section}
\makeatletter
\let\stdl@chapter\l@chapter
\renewcommand*{\l@chapter}[2]{\stdl@chapter{\centerline{#1}}{#2}}
\makeatother
\cftsetindents{subsection}{1.75cm}{10em}
\cftsetindents{subsubsection}{1.75cm}{10em}

\renewcommand{\cftsubsectionpresnum}{Schedule\hfill}
\renewcommand{\cftsubsectionaftersnum}{\quad—\quad}
\renewcommand{\cftsubsubsectionpresnum}{\qquad Part\hfill}
\renewcommand{\cftsubsubsectionaftersnum}{\quad—\quad}

%\setlength\cftsubsectionnumwidth{7.3em}
%\setlength\cftsubsubsectionnumwidth{4em}

\renewcommand{\title}{\printbilltitle}
\RequirePackage{changepage}   % for the adjustwidth environment
\renewcommand{\part}[1]{\stepcounter{part}\markright{#1}
\begin{center}
\printpartname\hspace{1ex}\arabic{part}\\
\printparttitle{#1}\normalfont\normalsize\\\end{center}
\addcontentsline{toc}{part}{\normalsize\bfseries\printpartname\hspace{1ex}\arabic{part}\normalfont\\
\centerline{\normalsize\normalfont\scshape\printparttitle{#1}}}
}
  \renewcommand\contentsname{CONTENTS}%

\renewcommand{\chapter}[1]{\stepcounter{chapter}\markright{#1}
\begin{center}
\itshape\printchaptertitle{#1}\normalfont\normalsize\\\end{center}
\addcontentsline{toc}{chapter}{\normalsize\itshape
\centerline{\normalsize\normalfont\itshape\printchaptertitle{#1}}}
}

\renewcommand{\partnamefont}{\normalfont\centering\bfseries\scshape}
\renewcommand{\parttitlefont}{\normalfont\centering\scshape}
\makeatletter
\renewcommand{\partnumberline}[1]{\hfil\hspace\@tocrmarg #1~}
\makeatother

\renewcommand{\partnumfont}{\normalfont\bfseries\centering\normalsize\scshape}
\renewcommand{\partnamenum}{\normalfont\bfseries\centering\normalsize\scshape}
\RequirePackage{setspace}
\renewcommand{\chapterheadstart}{\vspace*{\beforechapskip}}
\renewcommand{\printchaptername}{\chapnamefont \@chapapp}
\renewcommand{\chapternamenum}{\space}
\renewcommand{\printchapternum}{\chapnumfont \thechapter}
\renewcommand{\afterchapternum}{\par\nobreak\vskip \midchapskip}
\renewcommand{\printchapternonum}{}
\renewcommand{\chapterheadstart}{}
\renewcommand{\printchaptername}{}
\renewcommand{\chapternamenum}{}
\renewcommand{\printchapternum}{}
\renewcommand{\afterchapternum}{}
\setlength{\parskip}{0pt}
\renewcommand{\printchaptertitle}[1]{\chaptitlefont #1}
\renewcommand{\afterchaptertitle}{\par\nobreak\vskip \afterchapskip}
\renewcommand{\printtoctitle}[1]{\large\scshape\centerline{\MakeUppercase{#1}}}
\renewcommand{\chapnamefont}{\normalfont\centering\itshape}
\renewcommand{\chapnumfont}{\normalfont\centering\itshape}
\renewcommand{\chaptitlefont}{\normalfont\centering\itshape}

\setlength{\beforechapskip}{12pt}
\setlength{\midchapskip}{0pt}
\setlength{\afterchapskip}{12pt}
\setbeforesecskip{-1em}
\setaftersecskip{-1em}
\setbeforesubsecskip{-1em}
\setaftersubsecskip{-1em}
\renewcommand*{\thesection}{\arabic{section}}
\setsecnumformat{\csname the#1\endcsname\hspace{5ex}}
%\setsubsecnumformat{\csname the#1\endcsname\hspace{5ex}}
%\setsubsecheadstyle{\bfseries}
%\setsubsecheadstyle{\scshape\centering}
%\setsubsectionnumformat{SCHEDULE\quad\csname the#1\endcsname\newline}
\RequirePackage[compact]{titlesec}
\titleformat{\subsection}[display]
  {\normalfont\centering\scshape}{SCHEDULE \hspace{2ex }\thesubsection}{5pt}{}
\titleformat{\subsubsection}[display]
  {\normalfont\centering\scshape}{Part \thesubsubsection}{5pt}{}

\setsecheadstyle{\centering\bfseries}
\renewcommand{\part}[1]{\stepcounter{part}\markright{#1}
\begin{center}
\normalfont\normalsize\itshape\printchaptertitle{#1}\normalfont\normalsidze\\\end{center}
\addcontentsline{toc}{chapter}{
\centerline{\normalsize\normalfont\itshape\printchaptertitle{#1}}}
}
\RequirePackage{fontspec}
\IfFontExistsTF{Palatine Parliamentary}{
\setmainfont[
Scale=.98, 
SmallCapsFeatures={LetterSpace=10,RawFeature={+smcp,},},
BoldFeatures = {SmallCapsFont= {PalatineP-Bold},SmallCapsFeatures={%
RawFeature={+smcp,}%
}},
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{"}
%%\DeclareQuoteStyle{english}%
%%    {{\extfont\textquotedblleft}}
%%    [\extfont\textquotedblleft]
%%    {{\extfont\textquotedblright}}
%%        [0.05em]
%%    {{\extfont\textquoteleft}}
%%    [{\extfont\textquoteleft}]
%%    {{\extfont\textquoteright}}
\RequirePackage{enumitem}
\newenvironment{statquote}%
{
\begin{list}{}%
{%
\setlength{\topsep}{0ex}%
\setlength{\partopsep}{0ex}%
\setlength{\parsep}{0.5ex}%
\setlength{\itemsep}{i}%
\addtolength{\leftmargin}{3em}%
\addtolength{\rightmargin}{3em}%
}%
\item[]}%
{\end{list}}
\newenvironment{nostat}{\begin{enumerate}[nosep,leftmargin=1.7cm,labelindent=0pt,itemindent=0pt,label=]}{\end{enumerate}}
\newenvironment{numstat}%
{%
%\vspace{-9ex}%
\begin{enumerate}[nosep,partopsep=0pt,
%parsep=0.5ex,
%itemsep=1ex,
labelsep=3ex,
leftmargin=4em,rightmargin=1.5em,label=(\arabic*)]%
\item[]}%
{\end{enumerate}%
\vspace{1ex}\normalfont}%
\newenvironment{schumstat}%
{%
%\vspace{-9ex}%
\begin{enumerate}[nosep,partopsep=0pt,
%parsep=0.5ex,
itemsep=0ex,
labelsep=0ex,
leftmargin=0em,rightmargin=0em,label=]%
\item[]}%
{\end{enumerate}%
\vspace{1ex}\normalfont}%

\newcounter{alphcount}

\newenvironment{instatquote}%
{%
\setcounter{alphcount}{0}
\vspace{-3ex}%
\begin{list}{}%
{%
\setlength{\topsep}{0ex}%
\setlength{\partopsep}{1ex}%
\setlength{\parsep}{0.5ex}%
\setlength{\itemsep}{0ex}%
}%
\item[]}%
{\end{list}%
}%
\newenvironment{alphstat}%
{%
\vspace{-3ex}%
\begin{enumerate}[leftmargin=7.5ex,topsep=0ex,partopsep=1ex,parsep=0.5ex,itemsep=0ex,labelsep=3ex,label=({\alph*})]%

\item[]}%
{\end{enumerate}%
}%
\newenvironment{romstat}%
{%
\vspace{-3ex}%
\begin{enumerate}[topsep=0ex,partopsep=1ex,parsep=0.5ex,itemsep=0ex,label=(\roman*)]%

\item[]}%
{\end{enumerate}%
}%
\newenvironment{twoalphstat}%
{%
\vspace{-3ex}%
\begin{enumerate}[leftmargin=7.5ex,topsep=0ex,partopsep=1ex,parsep=0.5ex,itemsep=0ex,labelsep=3ex,label=({\alph*}{\alph*})]%

\item[]}%
{\end{enumerate}%
}%

\newcommand*\statquotelabel[1]{}

\newcommand{\stat}[2]{
\item[(#1)]#2
}

\newcommand{\stathead}[2]{
\textbf{#1}\hspace{5ex}\textbf{#2}
}




\setlength{\parindent}{0pt}
\RequirePackage{lettrine}
\setcounter{DefaultLines}{2}
%\renewcommand{\DefaultLraise}{0.05}
%\renewcommand{\DefaultLoversize}{.07}
%\renewcommand{\LettrineFontHook}{\initials}
%\RequirePackage{initials}
%\RequirePackage{Romantik}%\romantik{} 
%\RequirePackage{Royal}%\royal

\newcommand{\intl}[2]{\lettrine{#1}{\hspace{1ex}\textsc{#2}}}
\renewcommand{\maketitle}{\thispagestyle{front}
  \begin{center}
  {\Huge\textbf{\title}}\\\rule{\textwidth}{1pt}\\\rule[16pt]{\textwidth}{2pt}
  \end{center}
  }
  \newcommand{\schedule}[1]{\subsection{#1}}
\newcounter{schedon}
\setcounter{schedon}{0}

\newcommand{\currentsubsection}{}
\let\oldsubsection\subsection
\renewcommand{\subsection}[1]{\oldsubsection{#1}\renewcommand{\currentsubsection}{#1}}

\newcommand{\currentsubsubsection}{}
\let\oldsubsubsection\subsubsection
\renewcommand{\subsubsection}[1]{\oldsubsubsection{#1}\renewcommand{\currentsubsubsection}{#1}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% enacting
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\newcommand{\enactingformula}{
\intl{B}{e it enacted} by the King's most Excellent Majesty, by and with the advice and consent of the Lords Spiritual and Temporal, and Commons, in this present Parliament assembled, and by the authority of the same, as follows:---}

%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%enacting option
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\DeclareOption{private}{
\makeatletter
\renewcommand{\enactingformula}{
\intl{W}{hereas}---

\hspace{2em}\begin{minipage}{.75\textwidth}

\printwhereas
\end{minipage}

\medskip

\intl{M}{ay} it therefore please Your Majesty that it may be enacted, and be it enacted, by
the King’s Most Excellent Majesty, by and with the advice and consent of the Lords
Spiritual and Temporal, and Commons, in this present Parliament assembled, and by
the authority of the same, as follows:―
}


\makeatother

}

\ProcessOptions\relax


%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
% begindoc
%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%
\AtBeginDocument{\emergencystretch 3em
\sloppy
\OnehalfSpacing
\pagestyle{front}
\pagenumbering{roman}
\maketitle
\medskip
\extfont
\begin{center}\scshape\MakeUppercase{\printexptitle}\end{center}

\printexptext
\medskip

\begin{center}\scshape EUROPEAN CONVENTION ON HUMAN RIGHTS\end{center}

\printhumanrights
\normalfont
\clearpage\maketitle
\begin{KeepFromToc}
\normalfont\normalsize
\tableofcontents
\end{KeepFromToc}

\vskip 3ex
\mainmatter
\pagenumbering{arabic}
\pagestyle{bill}\thispagestyle{billfirst}
\begin{center}
	\scshape a
	\medskip
	
	\normalfont\Huge\bfseries B\hspace{.5ex}I\hspace{.5ex}L\hspace{.5ex}L
	
	\medskip
	
	\normalfont\normalsize\scshape to\normalfont
	
\end{center}

	\medskip

\noindent\footnotesize\extfont\printbillto\normalsize \normalfont

\medskip 

\enactingformula

\medskip



}


\AtEndDocument{\cleardoublepage


    \setcounter{page}{0}
    \pagenumbering{arabic}
    \setcounter{page}{1}
\thispagestyle{front}

  \begin{center}
  {\Huge\textbf{\title}}\\\rule{\textwidth}{1pt}\\\rule[16pt]{\textwidth}{2pt}
  \end{center}

\begin{center}
	\normalfont\scshape a
	\medskip
	
	\normalfont\Huge\bfseries B\hspace{.5ex}I\hspace{.5ex}L\hspace{.5ex}L
	
	\vskip 3ex
	\end{center}
	
\normalsize \printbillto
	\vskip 3ex
	\begin{center}
	
\normalsize\normalfont\itshape	Presented by \printdrafter

\vskip 3ex

\rule{.45\textwidth}{1pt}
\vspace{1ex}

\begin{minipage}{.4\textwidth}\centering
\itshape Ordered, by\normalfont\ \printdrafter\itshape\ to be Printed, {\normalfont\addordinal{\printbillday}} \textit{\printbillmonth} \printbillyear.
\end{minipage}

\vspace{1ex} 

\rule{.45\textwidth}{1pt}

\vskip 5ex

\normalfont\footnotesize\printbillcopyright


\vskip 1ex 

\normalfont\scshape\MakeUppercase{Published By \printpublishedby}
\end{center}
}
\end{minted}


\end{document}