summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/rub-kunstgeschichte/rub-kunstgeschichte.cls
blob: cb5ded4be7fe5b7c99a2e558e837ea470e0881c9 (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
%%
%% This is file `rub-kunstgeschichte.cls',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% rub-kunstgeschichte.dtx  (with options: `class')
%% 
%% This is a generated file.
%% 
%% Copyright (C) 2024 by Joran Schneyer <joran.schneyer@ruhr-uni-bochum.de>
%% 
%% 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
%%   https://www.latex-project.org/lppl.txt
%% and version 1.3c or later is part of all distributions of LaTeX
%% version 2008 or later.
%% 
%% This work has the LPPL maintenance status `maintained'.
%% 
%% The Current Maintainer of this work is Joran Schneyer <joran.schneyer@ruhr-uni-bochum.de>.
%% 
%% This work consists of the files rub-kunstgeschichte.dtx
%%                                 rub-kunstgeschichte.ins
%%           and the derived files rub-kunstgeschichte.cls
%%                                 rub-kunstgeschichte-example.tex
%% 

\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesClass{rub-kunstgeschichte}
    [2024-12-11 v0.4.0 RUB Kunstgeschichte class]
%% Class options
\DeclareKeys[rubkgi]{
    biblatex.store = \@rubkgi@biblatexOptions,
    biblatex.usage = load
}
\DeclareKeys[rubkgi]{
    hyperref.code  = \PassOptionsToPackage{#1}{hyperref},
    hyperref.usage = load
}
%% TeX switch to decide wether to load the parskip package
\newif\if@rubkgi@parskip
\@rubkgi@parskiptrue
\DeclareKeys[rubkgi]{
    parskip.if      = @rubkgi@parskip,
    parskip.usage   = load,
    noparskip.ifnot = @rubkgi@parskip,
    noparskip.usage = load
}
\ProcessKeyOptions[rubkgi]
%% Load base class with 12pt base font size
\LoadClass[12pt]{article}
%% biblatex options
\PassOptionsToPackage{
    backend=biber,
    singletitle=true,
    autocite=footnote,
    autopunct=true
}{biblatex}
%% biblatex-arthistory-bonn package
\PassOptionsToPackage{
    style=arthistory-bonn,
    firstcitefull=true,
    enddot=true,
    namelinked=true
}{biblatex}
%% pass biblatex class options along
\PassOptionsToPackage{\@rubkgi@biblatexOptions}{biblatex}
%% load biblatex
\RequirePackage{biblatex}
%% Set 1.5 times line spacing
\RequirePackage[onehalfspacing]{setspace}
%% Set a4 paper size and margins
\RequirePackage[
    a4paper,
    top=2cm,left=2cm,bottom=2cm,right=4cm
]{geometry}
%% Avoid paragraph indentation
\if@rubkgi@parskip
    \RequirePackage{parskip}
\fi
%% Hyperref
\RequirePackage{hyperref}
\hypersetup{hidelinks}
%% Translations
\RequirePackage{translations}
%% Other
\RequirePackage{tabularx} % For fancy tables. Is used in title page.
\RequirePackage{boxedminipage} % Used in title page.
%% Macros
\newcommand{\printbibliographies}[1][]{%
    \SetKeys[rubkgi@printbibliographies]{#1}%
    \addcontentsline{toc}{section}{%
        \texorpdfstring{\@rubkgi@bibheading}{bibliography}%
    }%
    \printbibheading[%
        heading = bibliography,%
        title = {\@rubkgi@bibheading}%
    ]
    \printbibliography[%
        keyword = source,%
        heading = subbibliography,%
        title = {\@rubkgi@bibheading@primary}%
    ]
    \printbibliography[%
        notkeyword = source,%
        heading = subbibliography,%
        title = {\@rubkgi@bibheading@secondary}%
    ]
}
\newcommand*{\@rubkgi@bibheading}{%
    \GetTranslationWarn{Bibliography}
}
\newcommand*{\@rubkgi@bibheading@primary}{%
    \GetTranslationWarn{Primary Bibliography}
}
\newcommand*{\@rubkgi@bibheading@secondary}{%
    \GetTranslationWarn{Secondary Bibliography}
}
\DeclareKeys[rubkgi@printbibliographies]
{
    heading           .store = \@rubkgi@bibheading,
    heading-primary   .store = \@rubkgi@bibheading@primary,
    heading-secondary .store = \@rubkgi@bibheading@secondary
}
\renewcommand{\maketitle}[1][]{%
    \SetKeys[rubkgi@titlepage]{#1}%
    \@rubkgi@maketitle%
}
\newcommand{\@rubkgi@maketitle}{
    \begin{titlepage}
        % set page margins for the title page
        \newgeometry{left=2.5cm,top=2.5cm,bottom=2cm,right=2.5cm}%
        % define the width of the grade box
        \def\@rubkgi@titlepage@gradebox@width{5.03cm}%
        %
        % create a group for the top part of the title page
        {\raggedright%
        % create a minipage for the top left part
        \begin{minipage}[t]%
        % calculate the width of the top left part
        % based on the grade box width
        {\dimexpr\textwidth%
        -\@rubkgi@titlepage@gradebox@width%
        -0.5cm\relax}%
        \vspace{0pt}% somehow helps aligning at the top
        \begin{tabularx}{\linewidth}{@{}lX}%
            \multicolumn{2}{@{}l}{%
                Ruhr-Universität Bochum%
            }\\%
            \multicolumn{2}{@{}l}{%
                Fakultät für Geschichtswissenschaft%
            }\\%
            \multicolumn{2}{@{}l}{%
                Kunstgeschichtliches Institut%
            }\\%
            \multicolumn{2}{@{}l}{%
                \@rubkgi@titlepage@seminar@semester%
            }\\%
            Dozent:in:    & \@rubkgi@titlepage@seminar@lecturer\\%
            Seminartitel: & \@rubkgi@titlepage@seminar@name\\%
            Studiengang:  & \@rubkgi@titlepage@seminar@degree\\%
            Modul:        & \@rubkgi@titlepage@seminar@module\\%
            Kreditpunkte: & \@rubkgi@titlepage@seminar@creditpoints\\%
        \end{tabularx}%
        \end{minipage}%
        % align grade box on the right side by filling in the gap
        \hfill%
        % define the grade box as a boxedminipage
        \begin{boxedminipage}[t][3.78cm][t]%
        {\@rubkgi@titlepage@gradebox@width}%
        % leave a little space and add the text inside
        \vspace{1em}%
        \hspace{1em}Note:%
        \end{boxedminipage}%
        }% top part ends here
        %
        \vfill% vertical space to fill
        %
        % create center part (title and author)
        \begin{center}%
        % add title relatively LARGE
        {\LARGE \@title \par}%
        \vskip 2em% add space between title and author
        % add author slightly larger than normal text
        {\large \@author \par}%
        % end the center environment
        % and switch back to normal paragraph text style
        \end{center}\par%
        %
        \vfill% fill gap to put next part at bottom
        %
        % create bottom part
        {\raggedright%
        \begin{tabular}{@{}ll}%
            Matrikelnr.: & \@rubkgi@titlepage@author@matricnum\\%
            % Add email as a clickable link
            Email: & \href{mailto:\@rubkgi@titlepage@author@email}%
                                 {\@rubkgi@titlepage@author@email}\\%
            Fachsemester: & \@rubkgi@titlepage@author@semester\\%
            Abgabetermin: & \@date\\%
        \end{tabular}
        }%
    \end{titlepage}%
    \setcounter{page}{2}%
    \restoregeometry%
}
\DeclareKeys[rubkgi@titlepage]
{
    email            .store = \@rubkgi@titlepage@author@email,
    matricnum        .store = \@rubkgi@titlepage@author@matricnum,
    author-semester  .store = \@rubkgi@titlepage@author@semester,
    seminar-semester .store = \@rubkgi@titlepage@seminar@semester,
    seminar-lecturer .store = \@rubkgi@titlepage@seminar@lecturer,
    seminar-name     .store = \@rubkgi@titlepage@seminar@name,
    seminar-degree   .store = \@rubkgi@titlepage@seminar@degree,
    seminar-module   .store = \@rubkgi@titlepage@seminar@module,
    seminar-cp       .store = \@rubkgi@titlepage@seminar@creditpoints
}
\SetKeys[rubkgi@titlepage]
{
    email            = {YOUR-EMAIL},
    matricnum        = {YOUR MATRICULATION NUMBER},
    author-semester  = {YOUR NUMBER OF SEMESTERS},
    seminar-semester = {THE SEMESTER IN WHCIH THE SEMINAR IS HELD},
    seminar-lecturer = {NAME OF SEMINAR LECTURER},
    seminar-name     = {NAME OF THE SEMINAR},
    seminar-degree   = {DEGREE SEMINAR IS TAKEN IN},
    seminar-module   = {MODULE SEMINAR IS TAKEN IN},
    seminar-cp       = {SEMINAR CP}
}
\newcommand{\configureTitlepage}[1]{%
    \SetKeys[rubkgi@titlepage]{#1}%
}
%% Extend \appendix to disable section numbering
\let\oldappendix\appendix%
\renewcommand{\appendix}{%
    \oldappendix%
    \setcounter{secnumdepth}{0}%
}
\DeclareTranslation{english}{Primary Bibliography}{Primary sources}
\DeclareTranslation{german}{Primary Bibliography}{Primärliteratur}
\DeclareTranslation{english}{Secondary Bibliography}{Secondary literature}
\DeclareTranslation{german}{Secondary Bibliography}{Sekundärliteratur}

\endinput
%%
%% End of file `rub-kunstgeschichte.cls'.