TCT-Law/craftconstitution.cls

214 lines
5.1 KiB
TeX

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{proposal}[CraftLaw for the CraftFuze Legal Project, Council Proposal]
\LoadClass[a4paper,8pt,oneside]{article}
\RequirePackage[left=2cm, right=2cm, top=2cm]{geometry}
\RequirePackage[utf8]{inputenc}
\RequirePackage[english]{babel}
\RequirePackage{blindtext}
\RequirePackage{titling}
\RequirePackage{fancyhdr}
\RequirePackage{tikz}
\RequirePackage[shortlabels]{enumitem}
\RequirePackage{needspace}
\RequirePackage[document]{ragged2e}
\RequirePackage{scrextend}
% AlphAlph
\usepackage{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}
\setlist[enumerate,1]{leftmargin=1.5em,topsep=-1ex,itemsep=-1ex,partopsep=1ex,parsep=1ex,style=sameline}
\setlist[enumerate,2]{leftmargin=1.5em,topsep=-1ex,itemsep=-1ex,partopsep=1ex,parsep=1ex,style=sameline}
\setenumerate[0]{label=\textbf{\arabic*.}}
% Header and footer
\pagestyle{fancy}
\fancyhf{}
\fancyfoot[LE,RO]{\thepage}
% New title layout
\newcommand{\settitle}[1]{\def\@lawtitle{#1}}
\newcommand{\setdate}[1]{\def\@date{#1}}
\newcommand{\generateHeader}{
% Header
\fancyhead[LE,LO]{\@date}
\fancyhead[CE,CO]{Official Journal of the Crafty Table}
\fancyhead[RE,RO]{\@lawtitle}
% Title
\noindent%
\begin{figure}
\centering
\includegraphics[width=30mm]{councilseal}
\end{figure}
\centering%
\textbf{\large\fontfamily{phv}\fontseries{b}%
\selectfont \@lawtitle}%
\medskip%
}
% Introduction
\newcommand{\introduction}[1]{%
\bigskip%
\vbox{%
PREAMBLE\medskip%
\begin{flushleft}
\noindent{#1}%
\end{flushleft}
}%
}
% 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}
\newcounter{ArticleSubCounter}[ArticleCounter]
\renewcommand{\title}[1]{%
\begin{addmargin}[0em]{0em}
\stepcounter{TitleCounter}%
\needspace{25\baselineskip}%
\begin{flushleft}
\textbf{Title \Roman{TitleCounter}}%
: \textbf{#1}
\end{flushleft}
\end{addmargin}
\bigskip%
}
\newcommand{\subtitle}[1]{%
\begin{addmargin}[0em]{0em}
\stepcounter{TitleSubCounter}%
\needspace{25\baselineskip}%
\begin{flushleft}
\textbf{Title \Roman{TitleCounter} \AlphAlph{\value{TitleSubCounter}}}%
: \textbf{#1}
\end{flushleft}
\end{addmargin}
\bigskip%
}
\newcommand{\chapter}[1]{
\begin{addmargin}[0em]{0em}
\stepcounter{ChapterCounter}%
\needspace{20\baselineskip}%
\begin{flushleft}
\textbf{Chapter \Roman{ChapterCounter}}%
: \textbf{#1}%
\end{flushleft}
\end{addmargin}
\bigskip%
}
\newcommand{\subchapter}[1]{
\begin{addmargin}[0em]{0em}
\stepcounter{ChapterSubCounter}%
\needspace{20\baselineskip}%
\begin{flushleft}
\textbf{Chapter \Roman{ChapterCounter} \AlphAlph{\value{ChapterSubCounter}}}%
: \textbf{#1}%
\end{flushleft}
\end{addmargin}
\bigskip%
}
\renewcommand{\section}[1]{%
\begin{addmargin}[0em]{0em}
\stepcounter{SectionCounter}%
\needspace{15\baselineskip}%
\begin{flushleft}
\textbf{Section \Roman{SectionCounter}}%
: \textbf{#1}%
\end{flushleft}
\end{addmargin}
\bigskip%
}
\renewcommand{\subsection}[1]{%
\begin{addmargin}[0em]{0em}
\stepcounter{SectionSubCounter}%
\needspace{15\baselineskip}%
\begin{flushleft}
\textbf{Section \Roman{SectionCounter} \AlphAlph{\value{SectionSubCounter}}}%
: \textbf{#1}%
\end{flushleft}
\end{addmargin}
\bigskip%
}
\renewcommand{\paragraph}[1]{%
\begin{addmargin}[0em]{0em}
\stepcounter{ParagraphCounter}%
\needspace{10\baselineskip}%
\begin{flushleft}
\textbf{Paragraph §\arabic{ParagraphCounter}.\arabic{SubParagraphCounter}}%
: \textbf{#1}%
\end{flushleft}
\end{addmargin}
\bigskip%
}
\renewcommand{\subparagraph}[1]{%
\begin{addmargin}[0em]{0em}
\stepcounter{SubParagraphCounter}%
\needspace{10\baselineskip}%
\begin{flushleft}
\textbf{Paragraph §\arabic{ParagraphCounter}.\arabic{SubParagraphCounter}}%
: \textbf{#1}%
\end{flushleft}
\end{addmargin}
\bigskip%
}
\newcommand{\article}[2]{%
\begin{addmargin}[0em]{0em}
\stepcounter{ArticleCounter}%
\needspace{5\baselineskip}%
\begin{flushleft}
\textbf{Article \arabic{ArticleCounter}}%
\def\param{#1}%
\ifx\param\empty
%
\else
: \textbf{#1}%
\fi
\par{#2}
\end{flushleft}
\end{addmargin}
\bigskip%
}
\newcommand{\subarticle}[2]{%
\begin{addmargin}[0em]{0em}
\stepcounter{ArticleSubCounter}%
\needspace{5\baselineskip}%
\begin{flushleft}
\textbf{Article \arabic{ArticleCounter}\alphalph{\value{ArticleSubCounter}}}%
\def\param{#1}%
\ifx\param\empty
%
\else
: \textbf{#1}%
\fi
\par{#2}
\end{flushleft}
\end{addmargin}
\bigskip%
}