This repository has been archived by the owner on Apr 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathstratum0doc.sty
153 lines (138 loc) · 3.96 KB
/
stratum0doc.sty
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
%% stratum0doc.sty
%%
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
\ProvidesPackage{stratum0doc}
\RequirePackage{tocloft}
\RequirePackage{enumitem}
\RequirePackage{hyperref}
%% Package options
\makeatletter
\DeclareOption{transcript}{%
\def\@sndsectionmark{TOP\ }%
\def\@sndoutermargin{3.1cm}
% enlarge page margin, for following \vote etc. commands
\addtolength{\textwidth}{-14pt}
\addtolength{\marginparwidth}{13pt}
}
\DeclareOption{legal}{
\def\@sndsectionmark{§\ }
\def\@sndoutermargin{2cm}
}
\ExecuteOptions{transcript}
\ProcessOptions\relax
\RequirePackage[margin=2.5cm,outer=\@sndoutermargin]{geometry}
\makeatother
%% fancyhdr setup
\newcommand{\myfancysetup}[2]{%
\pagestyle{fancy}
\fancyhf{}
\fancyhead[L]{\textsc{#1}}%
\fancyhead[R]{\textsc{#2}}%
\fancyfoot[C]{Seite \thepage\ von \pageref{LastPage}}
\fancypagestyle{plain}{% for first page
\renewcommand{\headrulewidth}{0pt}%
\fancyhf{}%
\fancyfoot[C]{Seite \thepage\ von \pageref{LastPage}}%
}
}
%% default monospace font
\RequirePackage[defaultmono,scale=0.8]{droidmono}
\urlstyle{tt}
%% list bullets, section prefix
\makeatletter
\renewcommand{\labelenumi}{(\arabic{enumi})}
\renewcommand{\labelitemi}{--}
% set table of contents number field to max width of section numbers
\settowidth{\cftsecnumwidth}{\@sndsectionmark 10 }
\settowidth{\cftsubsecnumwidth}{\@sndsectionmark 1.10 }
\let\theoldsection\thesection
\renewcommand*{\thesection}{%
\@sndsectionmark\theoldsection
}
\setcounter{section}{-1} % Hacker fangen ab 0 an zu zählen.
\makeatother
% optimize vertical spacing
\setlist{nosep}
\RedeclareSectionCommand[beforeskip=1em]{section}
\RedeclareSectionCommand[beforeskip=0.3em]{subsection}
\RedeclareSectionCommand[beforeskip=0.3em]{subsubsection}
\RedeclareSectionCommand[beforeskip=.5\baselineskip, afterskip=-1em]{paragraph}
\setlength{\parskip}{0.5em plus 0.1em minus 0.3em}
\setlength{\parindent}{0em}
\setlength{\cftbeforesecskip}{0.3\baselineskip}
\setlength{\parsep}{0pt}
\setlength{\headsep}{24pt}
\setlength{\topskip}{0pt}
\setlength{\topsep}{0pt}
\setlength{\partopsep}{0pt}
\setlength{\footskip}{32pt}
%% votes
%% Parameters: text, pros, contras, abstentions
\newcommand{\vote}[4]{%
\marginpar{\footnotesize \textbf{Abstimmung:} #1:\\#2~pro, #3~contra, #4~neutral}%
}
%% consensus without explicit vote
%% Parameters: text
\newcommand{\consensus}[1]{%
\marginpar{\footnotesize \textbf{Beschluss:} #1}%
}
%% no vote at all, disagreement
%% Parameters: text
\newcommand{\novote}{%
\marginpar{\footnotesize \textbf{Kein Beschluss}}%
}
%% postponed agenda items
%% Parameters: text
\newcommand{\postponed}{%
\marginpar{\footnotesize \textbf{vertagt}}%
}
%% withdrawn agenda items
%% Parameters: text
\newcommand{\withdrawn}{%
\marginpar{\footnotesize \textbf{TOP zurückgezogen}}%
}
%% elected persons
%% Parameters: appointment, name, votes, max. possible votes
\newcommand{\elected}[4]{%
\marginpar{\footnotesize \textbf{#1}: #2 (#3/#4)}
}
%% questions and answers
\newcommand{\question}[1]{\textbf{Frage:} #1 \\}
\newcommand{\answer}[1]{\textbf{Antwort:} #1}
% inclusion of single PDF pages
% usage: \includepdfpage{pdf file}{page number}
% set length \includepdfpagewidth to control width of pages
\newlength{\includepdfpagewidth}
\setlength{\includepdfpagewidth}{0.75\textwidth}
\newcommand{\includepdfpage}[2]{%
\begin{center}
\fbox{
\includegraphics[%
width=\includepdfpagewidth,%
page=#2,%
bb=29pt 28pt 764pt 591pt,%
clip=true%
]{#1}%
}%
\end{center}%
}
% notes for included pdf pages. uses \includepdfpagewidth.
\newcommand{\pdfpagenote}[1]{%
\begin{center}
\begin{minipage}{\includepdfpagewidth}
\vspace{-.5\baselineskip}
\footnotesize{#1}
\end{minipage}
\end{center}%
}
\RequirePackage{fancyhdr}
\RequirePackage{lastpage}
%% bootstrapping
\makeatletter
\AtBeginDocument{%
\let\mytitle\@title%
\let\mydate\@date%
\myfancysetup{\mytitle}{\mydate}%
}
\makeatother
% vim: set tw=80 et sw=2 ts=2: