texlive[72721] Master/texmf-dist: rub-kunstgeschichte (31oct24)
commits+karl at tug.org
commits+karl at tug.org
Thu Oct 31 21:33:39 CET 2024
Revision: 72721
https://tug.org/svn/texlive?view=revision&revision=72721
Author: karl
Date: 2024-10-31 21:33:39 +0100 (Thu, 31 Oct 2024)
Log Message:
-----------
rub-kunstgeschichte (31oct24)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/rub-kunstgeschichte/rub-kunstgeschichte-example.pdf
trunk/Master/texmf-dist/doc/latex/rub-kunstgeschichte/rub-kunstgeschichte-example.tex
trunk/Master/texmf-dist/doc/latex/rub-kunstgeschichte/rub-kunstgeschichte.pdf
trunk/Master/texmf-dist/source/latex/rub-kunstgeschichte/rub-kunstgeschichte.dtx
trunk/Master/texmf-dist/tex/latex/rub-kunstgeschichte/rub-kunstgeschichte.cls
Modified: trunk/Master/texmf-dist/doc/latex/rub-kunstgeschichte/rub-kunstgeschichte-example.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/rub-kunstgeschichte/rub-kunstgeschichte-example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/rub-kunstgeschichte/rub-kunstgeschichte-example.tex 2024-10-31 20:33:29 UTC (rev 72720)
+++ trunk/Master/texmf-dist/doc/latex/rub-kunstgeschichte/rub-kunstgeschichte-example.tex 2024-10-31 20:33:39 UTC (rev 72721)
@@ -33,6 +33,9 @@
\title{Example usage of the \textsf{rub-kunstgeschichte} class}
\author{Joran Schneyer}
+\configureTitlepage{
+ email = {joran.schneyer at ruhr-uni-bochum.de}
+}
%% bibliography file (usually you would put this in a seperate .bib file)
\begin{filecontents}{rub-kunstgeschichte-example.bib}
@@ -44,9 +47,19 @@
}
@book{exampleBook,
author = {John Smith},
- title = {A long example book},
- year = {2024}
+ title = {A long example book marked as primary literature},
+ year = {2024},
+ keywords = {source}
}
+ at inbook{bible,
+ author = {{The Bible}},
+ title = {The Holy Bible: King James Version},
+ booktitle = {The New Testament},
+ publisher = {Oxford University Press},
+ year = {1769},
+ location = {Oxford},
+ keywords = {source}
+}
@online{exampleWebsite,
author = {{Example consortium}},
title = {The truth about example documents},
@@ -73,6 +86,10 @@
\end{filecontents}
\addbibresource{rub-kunstgeschichte-example.bib}
+
+%% Load additional packages
+\usepackage[ngerman]{babel} % Sets the language of the document
+
\begin{document}
\maketitle
\tableofcontents
@@ -98,6 +115,10 @@
is automatically loaded to enable clickable
links and references.
+ Notably, the first page is a custom title page that aims to recreate the titlepage template of the guidelines in \LaTeX. Note, how the fields have descriptive default values in CAPS, so that you can easily see which information is still missing for the title page. As the documentation of this class states, you can either pass the corresponding key-value options into an optional argument of \verb|\maketitle|, or use the \verb|\configureTitlepage| macro in the preamble.\footnote{For a full list of titlepage options refer to the \texttt{rub-kunstgeschichte} class documentation.}
+
+ We use the \texttt{babel} package to set the language to german (even though this example document is actually written in english) to showcase how headings are automatically translated.
+
\section{How to cite sources}
This class automatically loads the \texttt{biblatex} package
for sophisticated bibliography and citations.
@@ -124,9 +145,10 @@
\autocite{biblatexCheatsheet}.
At the end of the document we can include a bibliography
- containing all cited sources with \verb|\printbibliography|.
+ containing all cited sources, divided into primary and secondary literature, with \verb|\printbibliographies|. Primary literature (also called a \textit{source}) is something like the bible\autocite{bible}, letters, treatises etc. We put the bibliography on a new page by using \verb|\clearpage| before printing it. Note, that since we used \verb|\usepackage[ngerman]{babel}| in the preamble, the headings of the bibliography are typed in german.
- \printbibliography
+ \clearpage
+ \printbibliographies
\end{document}
\endinput
Modified: trunk/Master/texmf-dist/doc/latex/rub-kunstgeschichte/rub-kunstgeschichte.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/source/latex/rub-kunstgeschichte/rub-kunstgeschichte.dtx
===================================================================
--- trunk/Master/texmf-dist/source/latex/rub-kunstgeschichte/rub-kunstgeschichte.dtx 2024-10-31 20:33:29 UTC (rev 72720)
+++ trunk/Master/texmf-dist/source/latex/rub-kunstgeschichte/rub-kunstgeschichte.dtx 2024-10-31 20:33:39 UTC (rev 72721)
@@ -29,7 +29,7 @@
%<class>\NeedsTeXFormat{LaTeX2e}[2022-06-01]
%<class>\ProvidesClass{rub-kunstgeschichte}
%<*class>
- [2024-09-06 v0.2.0 RUB Kunstgeschichte class]
+ [2024-10-30 v0.3.0 RUB Kunstgeschichte class]
%</class>
%<*driver>
\documentclass{ltxdoc}
@@ -60,6 +60,12 @@
% \DoNotIndex{\section,\subsection,\subsubsection}
% \DoNotIndex{\title,\author,\tableofcontents}
% \DoNotIndex{\LaTeX,\verb}
+% \DoNotIndex{\texorpdfstring}
+% \DoNotIndex{\@rubkgi at bibheading,\@rubkgi at bibheading@primary,\@rubkgi at bibheading@secondary}
+% \DoNotIndex{\@rubkgi at maketitle}
+% \DoNotIndex{\@rubkgi at titlepage@gradebox at width}
+% \DoNotIndex{\@author,\@date,\@title}
+% \DoNotIndex{\@rubkgi at titlepage@author at email,\@rubkgi at titlepage@author at matricnum,\@rubkgi at titlepage@author at semester,\@rubkgi at titlepage@seminar at semester,\@rubkgi at titlepage@seminar at lecturer,\@rubkgi at titlepage@seminar at name,\@rubkgi at titlepage@seminar at degree,\@rubkgi at titlepage@seminar at module,\@rubkgi at titlepage@seminar at creditpoints}
%
%^^A define helper commands for consistent typesetting in the documentation
% \DeclareDocumentCommand\email{m}{\href{mailto:#1}{\nolinkurl{#1}}}
@@ -148,6 +154,63 @@
%
% If neither \optn{parksip} nor \optn{noparskip} are given, the \pkg{parskip} package is automatically loaded by default.
%
+% \subsection{Macros}\label{sec:usage:macros}
+%
+% \DescribeMacro{\printbibliographies} \oarg{options}
+%
+% Prints the bibliography, divided into two subbibliographies.
+% One for primary sources and one for secondary literature, as suggested in section 3.7.1 of the guidelines on page 14.
+% It uses the keyword mechanism to distinguish primary sources i.e. in order for a bib entry to be sorted into the primary sources section, it needs the \texttt{source} keyword.
+% E.g. the bible would be considered a primary source:
+% \begin{sourceverb}
+% @inbook{bible,
+% author = {{The Bible}},
+% title = {The Holy Bible: King James Version},
+% |ldots
+% keywords = {source}
+% }
+% \end{sourceverb}
+% All other entries which don't have the \texttt{source} keyword will be sorted into the secondary literature section of the bibliography.
+%
+% You can customize the behavior of the macro using key-value \meta{options}. The option keys that are currently available are \optn{heading}, \optn{heading-primary} and \optn{heading-secondary} to overwrite the headings of the bibliography and the two subbibliographies respectively.
+%
+% \DescribeMacro{\maketitle} \oarg{titlepage-info}
+%
+% The native command \cs{maketitle} is redefined to create the title page according to the template in the guidelines.
+% The new title page needs more information than the standard one.
+% Besides the name of the author and title it needs more details about the author such as the matriculation number as well as information about the seminar the work is associated with.
+% The extra info can be passed as key-value pairs to the optional \meta{titlepage-info} argument of the redefined \cs{maketitle} macro
+% \DescribeMacro{\configureTitlepage}
+% or to the \cs{configureTitlepage} macro implemented for just this task.
+% The following custom keys are implemented:
+% \begin{description}
+% \ItemDescribeOption[titlepage]{email} The email of the author.
+% \ItemDescribeOption[titlepage]{matricnum} The matriculation number of the author.
+% \ItemDescribeOption[titlepage]{author-semester} The number of semesters the author has studied the subject.
+% \ItemDescribeOption[titlepage]{seminar-semester} The semester in which the seminar takes place in. E.g. \optn{Sommersemester 2024} or \optn{Wintersemester 2023/24}.
+% \ItemDescribeOption[titlepage]{seminar-lecturer} The name of the lecturer of the seminar.
+% \ItemDescribeOption[titlepage]{seminar-name} The name of the seminar itself.
+% \ItemDescribeOption[titlepage]{seminar-degree} The degree in which the author has taken the seminar in.
+% \ItemDescribeOption[titlepage]{seminar-module} The module in which the author has taken the seminar in.
+% \ItemDescribeOption[titlepage]{seminar-cp} The credit points the author will be rewarded with when completing the seminar.
+% \end{description}
+% Additionally you should set the normal \cs{author}, \cs{date} and \cs{title} info in the preamble.
+%
+% Note, that in contrast to e.g. the headers of the bibliography, the title page is not translated into the document language.
+% The guidleines specify that exactly this template should be used and to our understanding this means that it should always be written in german, regardless of the document language.
+%
+% \subsection{Translations}\label{sec:usage:translations}
+%
+% The class uses the \pkg{translations} package to allow multi-lingual strings. The default language is english. To tell it which language it should use, you can load a package like \pkg{babel} with the corresponding language as the package option in the preamble. E.g. for german using the new spelling rules
+% \begin{sourceverb}
+% \usepackage[ngerman]{babel}
+% \end{sourceverb}
+%
+% All pre-defined strings this class prints on the page of the document (such as the headings of the bibliographies when using \cs{printbibliographies}) are available in multiple languages.
+% So far this package only defines its strings for english and german, but you can define them for other languages too.\footnote{E.g. using the \cs{declaretranslation} command. For more info, refer to the documentation of the \pkg{translations} package: \url{https://ctan.org/pkg/translations}}
+%
+% The translation string definitions can be found in \autoref{sec:implementation:translations}.
+%
% \StopEventually{}
%
% \clearpage
@@ -240,6 +303,7 @@
%
% \DescribePackage{biblatex}
% \changes{v0.2.0}{2024-09-06}{Use biblatex with authortitle-dw style from biblatex-dw package.}^^A
+% \changes{v0.3.0}{2024-10-30}{Use arthistory-bonn biblatex style instead of authortitle-dw.}^^A
% To support bibliography facilities out of the box, the \pkg{biblatex} package is loaded. To customize the behavior, a few options are passed to the package.
% \iffalse
%% biblatex options
@@ -267,17 +331,17 @@
% \end{macrocode}
%
% \DescribeOption[biblatex]{autopunct}
-% Controls whether the citation commands scan ahead for punctuation marks.
+% Controls whether the citation commands scan ahead for punctuation marks and move the citation after the punctuation.
% \begin{macrocode}
- autopunct=false
+ autopunct=true
}{biblatex}
% \end{macrocode}
%
-% \DescribePackage{biblatex-dw}
+% \DescribePackage{biblatex-arthistory-bonn}
% \iffalse
-%% biblatex-dw package
+%% biblatex-arthistory-bonn package
% \fi
-% Further approximation of the suggested bibliography and citation styles in the guidelines is achieved by using the \pkg{biblatex-dw} package.
+% Further approximation of the suggested bibliography and citation styles in the guidelines is achieved by using the \pkg{biblatex-arthistory-bonn} package.
% To use it, a few more options are passed to \pkg{biblatex}:
% \begin{macrocode}
\PassOptionsToPackage{
@@ -284,23 +348,31 @@
% \end{macrocode}
%
% \DescribeOption[biblatex]{style}
-% The \optn{authortitle-dw} provided by the \pkg{biblatex-dw} package is probably the closest style to the one suggested in the guidelines.
+% The \optn{arthistory-bonn} style provided by the \pkg{biblatex-arthistory-bonn} package is suited to approximate the citation style suggested in the guidelines.
% \begin{macrocode}
- style=authortitle-dw,
+ style=arthistory-bonn,
% \end{macrocode}
%
-% The following options are provided by the \pkg{biblatex-dw} package:
+% The following options of the \optn{arthistory-bonn} biblatex style are set to further implement the guidelines:
%
-% \DescribeOption[biblatex]{firstfull}
+% \DescribeOption[biblatex]{firstcitefull}
% Delivers a full citation for the first occurence of an entry.
% \begin{macrocode}
- firstfull=true,
+ firstcitefull=true,
% \end{macrocode}
%
-% \DescribeOption[biblatex]{addyear}
-% Adds the year of the publication after the title.
+% \DescribeOption[biblatex]{enddot}
+% Every bibliography entry will end with a dot.
% \begin{macrocode}
- addyear=true
+ enddot=true,
+% \end{macrocode}
+%
+% The next \optn{arthistory-bonn} option is not implementing any part of the guidelines but is still useful:
+%
+% \DescribeOption[biblatex]{namelinked}
+% Both name and year in a short citation will link to the respective bibliography entry.
+% \begin{macrocode}
+ namelinked=true
}{biblatex}
% \end{macrocode}
%
@@ -371,9 +443,251 @@
% \end{macrocode}
% By default, we configure it to not highlight clickable elements.
% \begin{macrocode}
-\hypersetup{hidelinks=true}
+\hypersetup{hidelinks}
% \end{macrocode}
+%
+% \DescribePackage{translations}
+% Used internally by the class to create multilingual strings that react to the document language set e.g. by \pkg{babel}.
% \iffalse
+%% Translations
+% \fi
+% \begin{macrocode}
+\RequirePackage{translations}
+% \end{macrocode}
+%
+% \iffalse
+%% Other
+% \fi
+%
+% \DescribePackage{tabularx}
+% To make fancy tables. Is used e.g. in the title page.
+% \begin{macrocode}
+\RequirePackage{tabularx} % For fancy tables. Is used in title page.
+% \end{macrocode}
+%
+% \DescribePackage{boxedminipage}
+% Used by title page.
+% \begin{macrocode}
+\RequirePackage{boxedminipage} % Used in title page.
+% \end{macrocode}
+%
+% \subsection{Macros}\label{sec:implementation:macros}
+% \iffalse
+%% Macros
+% \fi
+%
+% \begin{macro}{\printbibliographies}
+% \changes{v0.3.0}{2024-10-30}{was added}^^A
+% Prints the bibliography using the native \cs{printbibliography} macro, but divides it into sections for primary sources and secondary literature. The keyword \texttt{source} is used to sort entries into the primary sources section.
+%
+% We start by defining the macro with an optional argument that is passed to \cs{SetKeys} to allow customization using key-value pairs.
+% \begin{macrocode}
+\newcommand{\printbibliographies}[1][]{%
+ \SetKeys[rubkgi at printbibliographies]{#1}%
+% \end{macrocode}
+% We add an entry to the table of contents and insert the main bibliography heading.
+% \begin{macrocode}
+ \addcontentsline{toc}{section}{%
+ \texorpdfstring{\@rubkgi at bibheading}{bibliography}%
+ }%
+ \printbibheading[%
+ heading = bibliography,%
+ title = {\@rubkgi at bibheading}%
+ ]
+% \end{macrocode}
+% Then we print the subbibliographies.
+% \begin{macrocode}
+ \printbibliography[%
+ keyword = source,%
+ heading = subbibliography,%
+ title = {\@rubkgi at bibheading@primary}%
+ ]
+ \printbibliography[%
+ notkeyword = source,%
+ heading = subbibliography,%
+ title = {\@rubkgi at bibheading@secondary}%
+ ]
+}
+% \end{macrocode}
+% For greater flexibility we define the heading strings as internal macros that can be redefined by the user with key-value options and use the \pkg{translations} package for the default strings. See \autoref{sec:implementation:translations} for the implementation of the translations. We don't want heading strings to include paragraphs, this is why we use the starred variant of \cs{newcommand}.
+% \begin{macrocode}
+\newcommand*{\@rubkgi at bibheading}{
+ \GetTranslationWarn{Bibliography}
+}
+\newcommand*{\@rubkgi at bibheading@primary}{
+ \GetTranslationWarn{Primary Bibliography}
+}
+\newcommand*{\@rubkgi at bibheading@secondary}{
+ \GetTranslationWarn{Secondary Bibliography}
+}
+% \end{macrocode}
+% Finally, we declare the keys that the user can use to redefine the headings.
+% \begin{macrocode}
+\DeclareKeys[rubkgi at printbibliographies]
+{
+ heading .store = \@rubkgi at bibheading,
+ heading-primary .store = \@rubkgi at bibheading@primary,
+ heading-secondary .store = \@rubkgi at bibheading@secondary
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\maketitle}
+% \changes{v0.3.0}{2024-10-30}{Redefined for custom title page according to template in guidelines.}^^A
+% We redefine the \cs{maketitle} macro to print a custom title page.
+% We also add the ability to customize it using key-value pairs in the optional argument.
+% \begin{macrocode}
+\renewcommand{\maketitle}[1][]{%
+ \SetKeys[rubkgi at titlepage]{#1}%
+ \@rubkgi at maketitle%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@rubkgi at maketitle}
+% The custom title page is defined as a dedicated internal command.
+% \begin{macrocode}
+\newcommand{\@rubkgi at maketitle}{
+% \end{macrocode}
+% It uses the \env{titlepage} environment to dedicate a full page to the titel.
+% Inside, it uses groups, minipages and tabularx tables to arrange the fields to resemble the template of the guidelines.
+% \begin{macrocode}
+ \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 at titlepage@gradebox at 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 at titlepage@gradebox at 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 at titlepage@seminar at semester%
+ }\\%
+ Dozent:in: & \@rubkgi at titlepage@seminar at lecturer\\%
+ Seminartitel: & \@rubkgi at titlepage@seminar at name\\%
+ Studiengang: & \@rubkgi at titlepage@seminar at degree\\%
+ Modul: & \@rubkgi at titlepage@seminar at module\\%
+ Kreditpunkte: & \@rubkgi at titlepage@seminar at 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 at titlepage@gradebox at 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 at titlepage@author at matricnum\\%
+ % Add email as a clickable link
+ Email: & \href{mailto:\@rubkgi at titlepage@author at email}%
+ {\@rubkgi at titlepage@author at email}\\%
+ Fachsemester: & \@rubkgi at titlepage@author at semester\\%
+ Abgabetermin: & \@date\\%
+ \end{tabular}
+ }%
+ \end{titlepage}%
+% \end{macrocode}
+% The guidelines specify that the titlepage counts towards the page numbers but should not display one. Therefore we set the page number counter to two after the title page.
+% \begin{macrocode}
+ \setcounter{page}{2}%
+% \end{macrocode}
+% We also reset the geometry to the one defined before the title page and then end the custom titlepage macro.
+% \begin{macrocode}
+ \restoregeometry%
+}
+% \end{macrocode}
+% The custom title page needs extra information which we want the user to be able to set via key-value pairs. We first define the key-value pairs and then set the defaults.
+% \begin{macrocode}
+\DeclareKeys[rubkgi at titlepage]
+{
+ email .store = \@rubkgi at titlepage@author at email,
+ matricnum .store = \@rubkgi at titlepage@author at matricnum,
+ author-semester .store = \@rubkgi at titlepage@author at semester,
+ seminar-semester .store = \@rubkgi at titlepage@seminar at semester,
+ seminar-lecturer .store = \@rubkgi at titlepage@seminar at lecturer,
+ seminar-name .store = \@rubkgi at titlepage@seminar at name,
+ seminar-degree .store = \@rubkgi at titlepage@seminar at degree,
+ seminar-module .store = \@rubkgi at titlepage@seminar at module,
+ seminar-cp .store = \@rubkgi at titlepage@seminar at creditpoints
+}
+\SetKeys[rubkgi at 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}
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\configureTitlepage}
+% Lastly, we create a macro that can be used in the preamble to set the titlepage info keys.
+% \begin{macrocode}
+\newcommand{\configureTitlepage}[1]{%
+ \SetKeys[rubkgi at titlepage]{#1}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Translations}\label{sec:implementation:translations}
+% \changes{v0.3.0}{2024-10-30}{Use translations package for multi-lingual support.}^^A
+%
+% The \pkg{translations} package offers an easy interface to create multilingual strings. We can define them all at once here, at the end of the class, since they are only used when the user commands are expanded in the document.
+%
+% \subsubsection*{Bibliography headings}
+%
+% The \pkg{translations} package already comes with translations for the main heading of the bibliography. Additionally, we provide the headings for the subbibliographies in english and german.
+% \begin{macrocode}
+\DeclareTranslation{english}{Primary Bibliography}{Primary sources}
+\DeclareTranslation{german}{Primary Bibliography}{Primärliteratur}
+\DeclareTranslation{english}{Secondary Bibliography}{Secondary literature}
+\DeclareTranslation{german}{Secondary Bibliography}{Sekundärliteratur}
+% \end{macrocode}
+%
+% \iffalse
%</class>
%<*example>
@@ -398,11 +712,18 @@
% \fi
%
-% followed by the information that is needed to typeset a title:
+% followed by the information that is needed to typeset a normal title:
% \begin{macrocode}
\title{Example usage of the \textsf{rub-kunstgeschichte} class}
\author{Joran Schneyer}
% \end{macrocode}
+% For the custom title we need to set additional information, such as
+% \begin{macrocode}
+\configureTitlepage{
+ email = {joran.schneyer at ruhr-uni-bochum.de}
+}
+% \end{macrocode}
+% We leave the rest to their default values for now.
%
% For citations, the bibtex entries are usually written to a seperate \filenm{.bib} file.
% For the sake of this example we keep everything in one \filenm{.tex} file and use the \env{filecontents} environment instead.
@@ -420,9 +741,19 @@
}
@book{exampleBook,
author = {John Smith},
- title = {A long example book},
- year = {2024}
+ title = {A long example book marked as primary literature},
+ year = {2024},
+ keywords = {source}
}
+ at inbook{bible,
+ author = {{The Bible}},
+ title = {The Holy Bible: King James Version},
+ booktitle = {The New Testament},
+ publisher = {Oxford University Press},
+ year = {1769},
+ location = {Oxford},
+ keywords = {source}
+}
@online{exampleWebsite,
author = {{Example consortium}},
title = {The truth about example documents},
@@ -455,7 +786,18 @@
% \begin{macrocode}
\addbibresource{rub-kunstgeschichte-example.bib}
% \end{macrocode}
+% \iffalse
+
+%% Load additional packages
+% \fi
+% To set our language to german (using the new spelling rules) we load \pkg{babel}.
%
+% \begin{macrocode}
+\usepackage[ngerman]{babel} % Sets the language of the document
+% \end{macrocode}
+% \iffalse
+
+% \fi
% Having finished the preamble, we begin the document, typeset the title and include a table of contents.
% \begin{macrocode}
\begin{document}
@@ -489,6 +831,10 @@
is automatically loaded to enable clickable
links and references.
+ Notably, the first page is a custom title page that aims to recreate the titlepage template of the guidelines in \LaTeX. Note, how the fields have descriptive default values in CAPS, so that you can easily see which information is still missing for the title page. As the documentation of this class states, you can either pass the corresponding key-value options into an optional argument of \verb|\maketitle|, or use the \verb|\configureTitlepage| macro in the preamble.\footnote{For a full list of titlepage options refer to the \texttt{rub-kunstgeschichte} class documentation.}
+
+ We use the \texttt{babel} package to set the language to german (even though this example document is actually written in english) to showcase how headings are automatically translated.
+
\section{How to cite sources}
This class automatically loads the \texttt{biblatex} package
for sophisticated bibliography and citations.
@@ -515,15 +861,10 @@
\autocite{biblatexCheatsheet}.
At the end of the document we can include a bibliography
- containing all cited sources with \verb|\printbibliography|.
-% \end{macrocode}
-% \iffalse
+ containing all cited sources, divided into primary and secondary literature, with \verb|\printbibliographies|. Primary literature (also called a \textit{source}) is something like the bible\autocite{bible}, letters, treatises etc. We put the bibliography on a new page by using \verb|\clearpage| before printing it. Note, that since we used \verb|\usepackage[ngerman]{babel}| in the preamble, the headings of the bibliography are typed in german.
-% \fi
-%
-% As suggested in the example document itself, we include the bibliography.
-% \begin{macrocode}
- \printbibliography
+ \clearpage
+ \printbibliographies
% \end{macrocode}
%
% Finally we end the document environment
Modified: trunk/Master/texmf-dist/tex/latex/rub-kunstgeschichte/rub-kunstgeschichte.cls
===================================================================
--- trunk/Master/texmf-dist/tex/latex/rub-kunstgeschichte/rub-kunstgeschichte.cls 2024-10-31 20:33:29 UTC (rev 72720)
+++ trunk/Master/texmf-dist/tex/latex/rub-kunstgeschichte/rub-kunstgeschichte.cls 2024-10-31 20:33:39 UTC (rev 72721)
@@ -30,7 +30,7 @@
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
\ProvidesClass{rub-kunstgeschichte}
- [2024-09-06 v0.2.0 RUB Kunstgeschichte class]
+ [2024-10-30 v0.3.0 RUB Kunstgeschichte class]
%% Class options
\DeclareKeys[rubkgi]{
biblatex.store = \@rubkgi at biblatexOptions,
@@ -57,13 +57,14 @@
backend=biber,
singletitle=true,
autocite=footnote,
- autopunct=false
+ autopunct=true
}{biblatex}
-%% biblatex-dw package
+%% biblatex-arthistory-bonn package
\PassOptionsToPackage{
- style=authortitle-dw,
- firstfull=true,
- addyear=true
+ style=arthistory-bonn,
+ firstcitefull=true,
+ enddot=true,
+ namelinked=true
}{biblatex}
%% pass biblatex class options along
\PassOptionsToPackage{\@rubkgi at biblatexOptions}{biblatex}
@@ -82,7 +83,161 @@
\fi
%% Hyperref
\RequirePackage{hyperref}
-\hypersetup{hidelinks=true}
+\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 at printbibliographies]{#1}%
+ \addcontentsline{toc}{section}{%
+ \texorpdfstring{\@rubkgi at bibheading}{bibliography}%
+ }%
+ \printbibheading[%
+ heading = bibliography,%
+ title = {\@rubkgi at bibheading}%
+ ]
+ \printbibliography[%
+ keyword = source,%
+ heading = subbibliography,%
+ title = {\@rubkgi at bibheading@primary}%
+ ]
+ \printbibliography[%
+ notkeyword = source,%
+ heading = subbibliography,%
+ title = {\@rubkgi at bibheading@secondary}%
+ ]
+}
+\newcommand*{\@rubkgi at bibheading}{
+ \GetTranslationWarn{Bibliography}
+}
+\newcommand*{\@rubkgi at bibheading@primary}{
+ \GetTranslationWarn{Primary Bibliography}
+}
+\newcommand*{\@rubkgi at bibheading@secondary}{
+ \GetTranslationWarn{Secondary Bibliography}
+}
+\DeclareKeys[rubkgi at printbibliographies]
+{
+ heading .store = \@rubkgi at bibheading,
+ heading-primary .store = \@rubkgi at bibheading@primary,
+ heading-secondary .store = \@rubkgi at bibheading@secondary
+}
+\renewcommand{\maketitle}[1][]{%
+ \SetKeys[rubkgi at titlepage]{#1}%
+ \@rubkgi at maketitle%
+}
+\newcommand{\@rubkgi at 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 at titlepage@gradebox at 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 at titlepage@gradebox at 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 at titlepage@seminar at semester%
+ }\\%
+ Dozent:in: & \@rubkgi at titlepage@seminar at lecturer\\%
+ Seminartitel: & \@rubkgi at titlepage@seminar at name\\%
+ Studiengang: & \@rubkgi at titlepage@seminar at degree\\%
+ Modul: & \@rubkgi at titlepage@seminar at module\\%
+ Kreditpunkte: & \@rubkgi at titlepage@seminar at 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 at titlepage@gradebox at 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 at titlepage@author at matricnum\\%
+ % Add email as a clickable link
+ Email: & \href{mailto:\@rubkgi at titlepage@author at email}%
+ {\@rubkgi at titlepage@author at email}\\%
+ Fachsemester: & \@rubkgi at titlepage@author at semester\\%
+ Abgabetermin: & \@date\\%
+ \end{tabular}
+ }%
+ \end{titlepage}%
+ \setcounter{page}{2}%
+ \restoregeometry%
+}
+\DeclareKeys[rubkgi at titlepage]
+{
+ email .store = \@rubkgi at titlepage@author at email,
+ matricnum .store = \@rubkgi at titlepage@author at matricnum,
+ author-semester .store = \@rubkgi at titlepage@author at semester,
+ seminar-semester .store = \@rubkgi at titlepage@seminar at semester,
+ seminar-lecturer .store = \@rubkgi at titlepage@seminar at lecturer,
+ seminar-name .store = \@rubkgi at titlepage@seminar at name,
+ seminar-degree .store = \@rubkgi at titlepage@seminar at degree,
+ seminar-module .store = \@rubkgi at titlepage@seminar at module,
+ seminar-cp .store = \@rubkgi at titlepage@seminar at creditpoints
+}
+\SetKeys[rubkgi at 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 at titlepage]{#1}%
+}
+\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
%%
More information about the tex-live-commits
mailing list.