TCT-Law/kluwer.cls

262 lines
6.7 KiB
TeX

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{kluwer}[CraftLaw for the CraftFuze Legal Project, Kluwer Layout]
\LoadClass[a5paper,twoside]{article}
\RequirePackage[marginparwidth=18mm,inner=10mm,textwidth=110mm,height=165mm]{geometry}
\RequirePackage{marginnote}
\RequirePackage[utf8]{inputenc}
\RequirePackage[english]{babel}
\RequirePackage{titling}
\RequirePackage{fancyhdr}
\RequirePackage{tikz}
\RequirePackage{needspace}
\RequirePackage{ragged2e}
\RequirePackage{charter}
\RequirePackage[11pt]{moresize}
\newcommand{\alignedmarginpar}[1]{%
\marginpar[\raggedleft\ssmall\smallskip\textbf{#1}]{\raggedright\ssmall\smallskip\textbf{#1}}%
}
% AlphAlph
\RequirePackage{enumitem,alphalph}
\makeatletter
\newcommand{\AlphAlphFmt}[1]{\@alphfmt{#1}} % Define the \alphalph wrapper for enumitem
\newcommand{\@alphfmt}[1]{\alphalph{\value{#1}}} % Internal representation
\AddEnumerateCounter{\alphalphFmt}{\@alphfmt}{aaa} % Register this new format
% Indent
\setlength{\parindent}{0pt}
\setlength{\parskip}{0pt}
% Footnote size
\renewcommand{\footnotesize}{\ssmall\selectfont}
% Enumerates
\newlist{leden}{enumerate}{1}
\newlist{onderdelen}{enumerate}{2}
\setlist[leden]{label=- \arabic*.,align=left,leftmargin=0cm,labelwidth=2em,labelsep=0.5em,topsep=-1ex,itemsep=-1ex,partopsep=1ex,parsep=1ex,style=standard}
% leftmargin=0cm,itemindent=.5cm,labelwidth=\itemindent,labelsep=0cm,align=left
\setlist[onderdelen]{label=\textit{\alph*}.,leftmargin=2.5em,align=left,labelwidth=2em,labelsep=0.5em,topsep=-1ex,itemsep=-1ex,parsep=1ex,style=standard}
\setenumerate[0]{label=- \arabic*.}
% New title layout
\newcommand{\settitle}[1]{\def\@lawtitle{#1}}
\newcommand{\setdate}[1]{\def\@date{#1}}
% Introduction
\newcommand{\introduction}[1]{%
\bigskip%
\vbox{%
\noindent{#1}
}%
}
% About proposal content
\newcounter{TopArticle}
\newcommand{\toparticle}[2]{%
\stepcounter{TopArticle}%
\needspace{5\baselineskip}%
\bigskip%
\hbox{%
\textbf{ARTICLE \Roman{TopArticle} #1}\newline%
}%
\begin{addmargin}[1em]{2em}
\par{#2}
\end{addmargin}
}
% Signatures
\newcommand{\signature}[3]{}
\newcommand{\oldsignature}[1]{}
% About legal content
\newcounter{TitleCounter}
\newcounter{TitleSubCounter}[TitleCounter]
\newcounter{ChapterCounter}[TitleCounter]
\newcounter{ChapterSubCounter}[ChapterCounter]
\newcounter{SectionCounter}[ChapterCounter]
\newcounter{SectionSubCounter}[SectionCounter]
\newcounter{ParagraphCounter}[SectionCounter]
\newcounter{SubParagraphCounter}[ParagraphCounter]
\newcounter{ArticleCounter}[TitleSubCounter]
\newcounter{ArticleSubCounter}[ArticleCounter]
\renewcommand{\title}[1]{%
\ssmall
\needspace{35\baselineskip}%
\medskip%
\titlecounter%
\vbox{%
\noindent{TITLE \Roman{TitleCounter}\newline\textbf{#1}}
}%
}
\newcommand{\subtitle}[1]{%
\ssmall
\needspace{35\baselineskip}%
\medskip%
\subtitlecounter%
\vbox{%
\noindent{TITLE \Roman{TitleCounter} \AlphAlph{\value{TitleSubCounter}}\newline\textbf{#1}}
}%
}
\newcommand{\chapter}[1]{
\ssmall
\needspace{10\baselineskip}%
\medskip%
\stepcounter{ChapterCounter}%
\vbox{%
\noindent{CHAPTER \Roman{ChapterCounter}\newline\textbf{#1}}
}%
}
\newcommand{\subchapter}[1]{
\ssmall
\needspace{10\baselineskip}%
\medskip%
\stepcounter{ChapterSubCounter}%
\vbox{%
\noindent{CHAPTER \Roman{ChapterCounter} \AlphAlph{\value{ChapterSubCounter}}\newline\textbf{#1}}
}%
}
\renewcommand{\section}[1]{%
\ssmall
\needspace{5\baselineskip}%
\medskip%
\stepcounter{SectionCounter}%
\vbox{%
\noindent{SECTION \Roman{SectionCounter}\newline\textbf{#1}}
}%
}
\renewcommand{\subsection}[1]{%
\ssmall
\needspace{5\baselineskip}%
\medskip%
\stepcounter{SectionSubCounter}%
\vbox{%
\noindent{SECTION \Roman{SectionCounter} \AlphAlph{\value{SectionSubCounter}}\newline\textbf{#1}}
}%
}
\renewcommand{\paragraph}[1]{%
\ssmall
\needspace{5\baselineskip}%
\medskip%
\stepcounter{ParagraphCounter}%
\vbox{%
\noindent{§ \arabic{ParagraphCounter}.\arabic{SubParagraphCounter}\newline \textbf{#1}}
}%
}
\renewcommand{\subparagraph}[1]{%
\ssmall
\needspace{5\baselineskip}%
\medskip%
\stepcounter{SubParagraphCounter}%
\vbox{%
\noindent{§ \arabic{ParagraphCounter}.\arabic{SubParagraphCounter}\newline \textbf{#1}}
}%
}
\newcommand{\article}[2]{%
\ssmall
\needspace{5\baselineskip}%
\smallskip%
\articlecounter%
\hbox{%
\hspace{20pt}
\ifnum\value{TitleCounter}>0%
\ifnum\value{TitleSubCounter}>0%
\textbf{Art. \arabic{TitleCounter}\AlphAlph{\value{TitleSubCounter}}:\arabic{ArticleCounter}}\newline%
\else%
\textbf{Art. \arabic{TitleCounter}:\arabic{ArticleCounter}}\newline%
\fi%
\else%
\textbf{Art. \arabic{ArticleCounter}}\newline%
\fi%
}%
\alignedmarginpar{#1}
\justifying
\par{\noindent#2}%
}
\newcommand{\subarticle}[2]{%
\ssmall
\needspace{5\baselineskip}%
\smallskip%
\subarticlecounter%
\hbox{%
\hspace{20pt}
\ifnum\value{TitleCounter}>0%
\ifnum\value{TitleSubCounter}>0%
\textbf{Art. \arabic{TitleCounter}\AlphAlph{\value{TitleSubCounter}}:\arabic{ArticleCounter}\alphalph{\value{ArticleSubCounter}}}\newline%
\else%
\textbf{Art. \arabic{TitleCounter}:\arabic{ArticleCounter}\alphalph{\value{ArticleSubCounter}}}\newline%
\fi%
\else%
\textbf{Art. \arabic{ArticleCounter}\alphalph{\value{ArticleSubCounter}}}\newline%
\fi%
}%
\alignedmarginpar{#1}
\justifying
\par{\noindent#2}%
}
% Header tracker
\newmarks\articlemark
\newmarks\subarticlemark
\newmarks\titlemark
\newmarks\subtitlemark
\newcommand{\articlecounter}{%
\stepcounter{ArticleCounter}%
\marks\articlemark{\arabic{ArticleCounter}}%
\marks\subarticlemark{}%
\marks\titlemark{\arabic{TitleCounter}}%
\marks\subtitlemark{\Alph{TitleSubCounter}}%
}
\newcommand{\subarticlecounter}{%
\stepcounter{ArticleSubCounter}%
\marks\subarticlemark{\alph{ArticleSubCounter}}%
\marks\articlemark{\arabic{ArticleCounter}}
\marks\titlemark{\arabic{TitleCounter}}%
\marks\subtitlemark{\Alph{TitleSubCounter}}%
}%
\newcommand{\titlecounter}{%
\stepcounter{TitleCounter}%
\marks\titlemark{\arabic{TitleCounter}}%
\marks\subtitlemark{\Alph{TitleSubCounter}}%
}
\newcommand{\subtitlecounter}{%
\stepcounter{TitleSubCounter}%
\marks\subtitlemark{\Alph{TitleSubCounter}}%
}%
\newcommand{\articlehead}{
\begingroup
\edef\firstarticle{\firstmarks\articlemark}
\edef\firstsubarticle{\firstmarks\subarticlemark}
\edef\firsttitle{\firstmarks\titlemark}
\edef\firstsubtitle{\firstmarks\subtitlemark}
Art. \firsttitle\firstsubtitle:\firstarticle\firstsubarticle
\endgroup
}
% And generate the header using these markers
\newcommand{\generateHeader}{
% Header and footer
\pagestyle{fancy}
\fancyhf{}
\setlength{\headsep}{1em}
% Header
\fancyhead[LO,RE]{\ssmall\@lawtitle}
\fancyhead[RO,LE]{\ssmall\articlehead}
\fancyfoot[RO,LE]{\ssmall\thepage}
% Title
\noindent%
\large%
\textbf{\@lawtitle}%
\medskip%
}