% deckblatt-en.tex
% English documentation of the deckblatt package.
% Copyright (C) 2026 Daniel Tibi, LPPL 1.3c or later.
%
% Compile with LuaLaTeX after the examples (deckblatt-example-*.tex):
%   lualatex deckblatt-en.tex   (twice)
\documentclass[paper=a4, fontsize=11pt, parskip=half]{scrartcl}
\usepackage[british]{babel}
\usepackage{libertine}
\setmonofont{LinLibertine_M.otf}[Scale=MatchLowercase]
\usepackage{graphicx, booktabs, tabularx, xltabular, array, xcolor, listings, enumitem}
\setlist[description]{style=nextline, leftmargin=1.5em, font=\normalfont}
\usepackage[autostyle]{csquotes}
\usepackage[hidelinks]{hyperref}

\lstset{
  basicstyle  = \ttfamily\small,
  columns     = fullflexible,
  keepspaces  = true,
  frame       = l,
  framerule   = 1.5pt,
  rulecolor   = \color{black!30},
  xleftmargin = 1em,
  framexleftmargin = 0.6em,
  aboveskip   = 0.5\baselineskip,
  belowskip   = 0.5\baselineskip,
  literate    = {ä}{{\"a}}1 {ö}{{\"o}}1 {ü}{{\"u}}1 {ß}{{\ss}}1
}
\newcommand\cs[1]{\texttt{\textbackslash #1}}
\newcommand\key[1]{\texttt{#1}}
\newcommand\pkg[1]{\textsf{#1}}
\newcommand\meta[1]{{\normalfont\ensuremath{\langle}\textit{#1}\ensuremath{\rangle}}}
\setlength\emergencystretch{3em}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
\newcommand\fig[2]{%
  \begin{minipage}[t]{0.46\linewidth}\centering
    \fbox{\includegraphics[width=0.88\linewidth]{#1}}\par\smallskip
    {\small #2}
  \end{minipage}}

\title{The \pkg{deckblatt} package}
\subtitle{Cover pages for self-archived publications from BibTeX data}
\author{Daniel Tibi\\\small\href{mailto:daniel.tibi@plus.ac.at}{daniel.tibi@plus.ac.at}}
\date{Version 1.0, 23~November 2026}

\begin{document}
\maketitle

\begin{abstract}
\noindent \pkg{deckblatt} (German for \enquote{cover page}) creates a cover page for a
self-archived publication that gives the bibliographic details of the original
publication. The data are taken from an entry of a BibTeX or biblatex file. The cover
page shows the authors, the title and the source, a suggested citation, optionally a
QR code for the DOI, the BibTeX code of the entry and a note on self-archiving. There
are two designs to choose from. Colours, fonts and texts can be adjusted. The PDF file
of the publication can be appended directly. The package requires LuaLaTeX.
\end{abstract}

\tableofcontents

\section{Introduction}

Authors who make their articles available in a repository or on their own website
usually add a cover page that identifies the original publication. \pkg{deckblatt}
sets this cover page from the data that are already present in one's own
bibliography. The package reads the BibTeX file itself. BibTeX, Biber or biblatex are
not needed for this.

Figure~\ref{fig:variants} shows the two variants. \key{banner} sets the authors and
the title on a band across the full width of the page. \key{sidebar} puts a stripe at
the left or right edge of the page and lists the details of the original publication
in a table. Both variants default to black, white and shades of grey and use the
fonts of the document.

\begin{figure}[p]
  \centering
  \fig{deckblatt-example-banner.pdf}{\key{banner} with default colours\\(\texttt{deckblatt-example-banner.tex})}\hfill
  \fig{deckblatt-example-sidebar.pdf}{\key{sidebar} with default colours\\(\texttt{deckblatt-example-sidebar.tex})}\par\bigskip
  \fig{deckblatt-example-english.pdf}{\key{banner}, English, accent colour\\(\texttt{deckblatt-example-english.tex})}\hfill
  \fig{deckblatt-example-colors.pdf}{\key{sidebar} on the right, English, own colours\\(\texttt{deckblatt-example-colors.tex})}
  \caption{The two variants in the example files}
  \label{fig:variants}
\end{figure}

\subsection*{Requirements}

\pkg{deckblatt} works with LuaLaTeX only and requires a LaTeX kernel dated 1~June 2022
or later. The package consists of the files \texttt{deckblatt.sty} and
\texttt{deckblatt.lua}. It loads \pkg{xcolor}, \pkg{graphicx}, \pkg{qrcode} and
\pkg{pdfpages}. At the end of the preamble it also loads \pkg{csquotes} (with the
option \key{autostyle}) and \pkg{hyperref}, unless the document has already loaded
these packages itself. Options of one's own for \pkg{csquotes} and \pkg{hyperref} can
therefore be given as usual, even after \pkg{deckblatt}. Options for \pkg{xcolor}
should be set before \pkg{deckblatt}, as with every package that loads \pkg{xcolor}.

\subsection*{Legal note}

Whether and in which version an article may be self-archived follows from the
publishing contract, from the publisher's policy or from statute law. The statutory
right of secondary publication under §\,38(4) of the German and §\,37a of the
Austrian Copyright Act, for example, covers only the accepted manuscript, not the
publisher's version. \pkg{deckblatt} does not check any such requirements.

\section{Quick start}

\begin{lstlisting}
\documentclass[a4paper]{article}
\usepackage[british]{babel}
\usepackage{deckblatt}
\deckblattsetup{
  bibfile = publications.bib,
  key     = Muster2024,
  note,
}
\begin{document}
\deckblatt[file=Muster2024.pdf]
\end{document}
\end{lstlisting}

Compile the document twice with \texttt{lualatex}. It then contains the cover page
followed by all pages of the file \texttt{Muster2024.pdf}. Without the option
\key{file} only the cover page is produced.

\section{Choosing the entry}

\begin{description}
\item[\key{bibfile=}\meta{files}] One or more bibliography files, separated by commas.
  The files are found via the \TeX\ search path. They must be encoded in UTF-8.
\item[\key{key=}\meta{key}] The key of the entry. Upper and lower case do not matter
  if there is no exactly matching key.
\item[\key{jobname=true|false}] If the job name is a key of the bibliography, this
  entry is chosen, even if \key{key} says otherwise (default: \key{true}). This way one
  and the same template can be used for every publication:
\begin{lstlisting}
lualatex -jobname=Muster2024 cover-template.tex
\end{lstlisting}
  The output file is then called \texttt{Muster2024.pdf}.
\end{description}

\section{Setting the cover page}

\begin{description}
\item[\cs{deckblatt}\texttt{[}\meta{options}\texttt{]}] sets the cover page on a page
  of its own. The options act like \cs{deckblattsetup} and also apply to later calls.
  Only \key{file} applies to the current call alone.
\item[\cs{deckblattsetup}\texttt{\{}\meta{options}\texttt{\}}] sets options in the
  preamble or in the document. Almost all options can also be given when loading the
  package. Options whose value contains commands (fonts, texts of one's own) belong in
  \cs{deckblattsetup}.
\item[\key{file=}\meta{PDF file}] appends the file after the cover page using
  \cs{includepdf}.
\item[\key{file-options=}\meta{options}] options for \cs{includepdf} (default:
  \key{pages=-}).
\end{description}

The cover page is set with margins of its own and placed as a whole on an empty page
with the page style \key{empty}. Text area, headers and margins of the document stay
untouched. The dimensions follow the paper size of the document. A document can
contain several cover pages, for instance a course reader:

\begin{lstlisting}
\deckblatt[key=Muster2024, file=muster.pdf]
\deckblatt[key=Beispiel2023, file=beispiel.pdf]
\end{lstlisting}

\section{Variants}

\begin{description}
\item[\key{variant=banner|sidebar}] chooses the design (default: \key{banner}).
\item[\key{sidebar=left|right}] puts the stripe of the variant \key{sidebar} at the
  left or right edge (default: \key{left}).
\item[\key{sidebar-text=}\meta{text}] text in the stripe. Default: \enquote{Self-archived
  version}, German \enquote{Zweitveröffentlichung}.
\end{description}

\section{Elements of the cover page}

\begin{description}
\item[\key{qrcode=true|false}] QR code with the link to the DOI (default: \key{true}).
  It only appears if the entry has a DOI.
\item[\key{qrcode-size=}\meta{length}] height of the QR code (default: \key{30mm}).
\item[\key{citation=true|false}] suggested citation (default: \key{true}).
\item[\key{citation-text=}\meta{text}] replaces the generated suggested citation by a
  text of one's own.
\item[\key{bibtex=true|false}] BibTeX code of the entry (default: \key{true}). The
  fields appear in the order of the bibliography file. If a word is too long for the
  line, the font of the block is reduced.
\item[\key{note=true|false}] note on self-archiving at the foot of the page (default:
  \key{false}).
\item[\key{note-text=}\meta{text}] text of one's own for the note. The option also
  switches the note on. The default text reads: \enquote{This is a self-archived
  version. Please cite the original publication given above.} German: \enquote{Dies ist
  eine Zweitveröffentlichung (Self-Archiving). Bitte zitieren Sie nach der oben
  genannten Erstveröffentlichung.}
\item[\key{title-split=true|false}] splits the title into main title and subtitle
  (default: \key{true}, see section~\ref{sec:fields}).
\end{description}

Publishers often require a particular statement, for instance on the version and with
a link to the version of record. This is what \key{note-text} is for:

\begin{lstlisting}
\deckblattsetup{
  note-text = {This is the accepted manuscript. The version of
    record is available at \dbdoiurl.},
}
\end{lstlisting}

\section{Language}

The texts on the cover page and the building blocks of the suggested citation exist in
German and English. With \key{language=auto} (default) the package follows the
current language of \pkg{babel} or \pkg{polyglossia}. All varieties of German give
German texts, all other languages English texts. \key{language=german} or
\key{language=english} fixes the language. The quotation marks of the suggested
citation come from \pkg{csquotes} and follow the language of the document.

\begingroup
\begin{xltabular}{\linewidth}{@{}lLL@{}}
  \toprule
  Option & English & German \\
  \midrule
  \endhead
  \key{published-in-label} & Published in & Erschienen in \\
  \key{published-label}    & Published (monographs, \key{banner}) & Erschienen \\
  \key{citation-label}     & Suggested citation & Zitiervorschlag \\
  \key{bibtex-label}       & BibTeX & BibTeX \\
  \key{doi-label}          & DOI & DOI \\
  \key{volume-label}       & Volume & Jahrgang \\
  \key{issue-label}        & Issue & Heft \\
  \key{publisher-label}    & Publisher & Verlag \\
  \key{date-label}         & Date & Datum \\
  \key{year-label}         & Year & Jahr \\
  \key{pages-label}        & Pages & Seiten \\
  \key{isbn-label}         & ISBN & ISBN \\
  \bottomrule
\end{xltabular}
\endgroup

A text set with these options applies to both languages. The package adds the colon
after the labels. In English the suggested citation uses \enquote{ed.}/\enquote{eds.},
\enquote{no.}, \enquote{p.}/\enquote{pp.}, \enquote{et al.} and \enquote{trans. by},
in German \enquote{Hrsg.}, \enquote{H.}, \enquote{S.}, \enquote{u.\,a.} and
\enquote{übers. von}. German citations separate several authors by slashes, English citations by commas
and \enquote{and}.

\section{Colours}

Each colour is set with \key{\meta{role}-color=}\meta{colour}. Any colour expression
of \pkg{xcolor} is allowed, for instance \key{red!75!black}. A value that has been set
applies to both variants. The package provides the colours under the names
\texttt{deckblatt-}\meta{role}. In the table, \key{accent} is short for
\texttt{deckblatt-accent} and so on.

\begingroup
\small
\begin{xltabular}{\linewidth}{@{}l>{\raggedright\arraybackslash}p{0.25\linewidth}>{\raggedright\arraybackslash}p{0.12\linewidth}L@{}}
  \toprule
  Role & \key{banner} & \key{sidebar} & Used for \\
  \midrule
  \endhead
  \key{main}              & \key{black} & \key{black} & band or stripe \\
  \key{main-text}         & \key{white} & \key{white} & text on band and stripe \\
  \key{accent}            & \key{black} & \key{black} & highlight colour that other roles refer to \\
  \key{label}             & \key{accent} & \key{black!65} & labels \\
  \key{title}             & \key{main-text} & \key{black!88} & main title \\
  \key{subtitle}          & \key{main-text!85!main} & \key{black!65} & subtitle \\
  \key{author}            & \key{main-text} & \key{accent} & authors or editors \\
  \key{note}              & \key{black!65} & \key{black!65} & note on self-archiving \\
  \key{bibtex}            & \key{black!75} & \key{black} & base colour of the BibTeX code \\
  \key{bibtex-background} & \key{none} & \key{black!7} & background of the BibTeX box (\key{none}: no background) \\
  \key{bibtex-rule}       & \key{accent} & \key{accent} & rule at the left of the BibTeX box \\
  \key{bibtex-type}       & \key{bibtex} & \key{accent} & entry type \\
  \key{bibtex-key}        & \key{bibtex} & \key{black} & key \\
  \key{bibtex-field}      & \key{bibtex} & \key{accent} & field names \\
  \key{bibtex-value}      & \key{bibtex} & \key{black!85} & field values \\
  \bottomrule
\end{xltabular}
\endgroup

The width of the rule at the BibTeX box is set by \key{bibtex-rule-width} (default:
\key{1.5pt} for \key{banner}, \key{0pt} for \key{sidebar}). A cover page in a single
colour usually needs no more than \key{main-color} and \key{accent-color}:

\begin{lstlisting}
\definecolor{navy}{HTML}{23395B}
\deckblattsetup{
  variant                 = sidebar,
  main-color              = navy,
  accent-color            = navy,
  bibtex-background-color = navy!6,
}
\end{lstlisting}

\section{Fonts}

The package uses the fonts of the document. The option
\key{\meta{role}-font=}\meta{commands} sets the font of a role. The value replaces
the default completely,
including the size. The sizes are fixed so that the cover page looks the same
regardless of the base font size of the document.

\begingroup
\small
\begin{xltabular}{\linewidth}{@{}l>{\raggedright\arraybackslash}p{0.3\linewidth}L@{}}
  \toprule
  Role & Default \key{banner} & Default \key{sidebar} \\
  \midrule
  \endhead
  \key{text}      & \cs{fontsize\{10\}\{12.5\}} & as \key{banner} \\
  \key{author}    & \cs{sffamily}, 12/14.5\,pt & \cs{bfseries}, 12/14.5\,pt \\
  \key{title}     & 27/32\,pt & \cs{bfseries}, 26/30\,pt \\
  \key{subtitle}  & \cs{itshape}, 14/18\,pt & 15/19\,pt \\
  \key{label}     & \cs{sffamily}\cs{bfseries}, 7.5/9\,pt & \cs{bfseries}, 7.5/9\,pt \\
  \key{source}    & 12/14.5\,pt (source) & not used \\
  \key{bibtex}    & \cs{ttfamily}, 8/10.6\,pt & as \key{banner} \\
  \key{note}      & 8/10\,pt & as \key{banner} \\
  \key{sidebar}   & not used & \cs{bfseries}, 8.5/10\,pt (stripe) \\
  \key{smallcaps} & empty & empty \\
  \key{doi}       & empty & empty \\
  \bottomrule
\end{xltabular}
\endgroup

Labels and the text in the stripe are set in capitals and letterspaced:
\key{label-letterspace} (default: \key{10} for \key{banner}, \key{9} for
\key{sidebar}) and \key{sidebar-letterspace} (default: \key{22}). The values follow the
option \key{LetterSpace} of \pkg{fontspec} and only take effect with \pkg{fontspec}
fonts. Example with a light weight for the subtitle:

\begin{lstlisting}
\newfontfamily\light{LibreFranklin}[Extension=.otf,
  UprightFont=*-Light, ItalicFont=*-LightItalic]
\deckblattsetup{
  subtitle-font = \light\fontsize{15}{19}\selectfont,
}
\end{lstlisting}

\subsection*{Small capitals}

Last names are set in small capitals. \cs{dbsc}\texttt{\{}\meta{text}\texttt{\}} uses
real small capitals if the current font has them (for \pkg{fontspec} fonts the
OpenType feature \texttt{smcp}). Otherwise the command sets the lowercase letters as
reduced capitals. This replacement is controlled by \key{smallcaps-font} (font of the
replacement letters, for instance a heavier weight), \key{smallcaps-scale} (size
relative to the font, default: \key{0.78}) and \key{smallcaps-letterspace}
(letterspacing, default: \key{4}).

\section{PDF metadata}

With \key{pdfmeta=true} (default) the package writes the title, the authors and the
suggested citation without the DOI into the PDF metadata as title, author and subject.
Several authors are passed as a list so that they appear separately in the XMP
metadata. It also sets \key{pdfcreator} and \key{pdfdisplaydoctitle}. The first entry
chosen is decisive. For documents with several cover pages or metadata of their own,
this can be switched off with \key{pdfmeta=false}.

\section{Supported entries and fields}
\label{sec:fields}

The package distinguishes three kinds of entries:
\begin{itemize}
\item \emph{journal articles}: entries of type \texttt{article} or
  \texttt{periodical} and entries with a field \texttt{journaltitle} or
  \texttt{journal}, but without \texttt{booktitle},
\item \emph{contributions to collections}: entries with a field \texttt{booktitle},
\item \emph{monographs}: all other entries.
\end{itemize}

The fields \texttt{author}, \texttt{editor}, \texttt{translator}, \texttt{title},
\texttt{subtitle}, \texttt{journaltitle} or \texttt{journal}, \texttt{booktitle},
\texttt{series}, \texttt{volume}, \texttt{number} or \texttt{issue}, \texttt{pages},
\texttt{date} or \texttt{year}, \texttt{edition}, \texttt{location} or
\texttt{address}, \texttt{publisher}, \texttt{isbn} and \texttt{doi} are evaluated.
Field values are \TeX\ code and are set as they stand in the file. Abbreviations
defined with \verb|@string| are not expanded.

Names can be given as \enquote{First Last} or \enquote{Last, First}, separated by
\texttt{and}. \texttt{and others} gives \enquote{et al.} or \enquote{u.\,a.} A date in
the format \texttt{YYYY-MM-DD} is written out in full, \texttt{YYYY-MM} as month and
year.

If an entry has no field \texttt{subtitle}, the package splits the title at the first
\enquote{.\,}, \enquote{?\,} or \enquote{!\,} outside curly braces, failing that at
the first \enquote{:\,}. A full stop after a digit, a single letter or a known
abbreviation (such as \enquote{Art.}, \enquote{Hrsg.}, \enquote{Vol.}) does not split.
Titles of the form \enquote{Review of: \dots} or \enquote{Rezension zu: \dots} get
\enquote{Review} or \enquote{Rezension} as main title. \key{title-split=false} switches
the splitting off.

\section{Designs of one's own}

The following commands print the data of the chosen entry. They can be used to design
cover pages or labels of one's own. The commands with \texttt{if} take two further
arguments for the cases \enquote{yes} and \enquote{no}.

\begingroup
\small
\begin{xltabular}{\linewidth}{@{}lL@{}}
  \toprule
  Command & Output \\
  \midrule
  \endhead
  \cs{dbfield}\texttt{\{}\meta{field}\texttt{\}} & field value as \TeX\ code \\
  \cs{dbrawfield}\texttt{\{}\meta{field}\texttt{\}} & field value as plain text \\
  \cs{dbkey}, \cs{dbtype} & key, entry type \\
  \cs{dbauthors} & authors (or editors with \enquote{(ed.)}) \\
  \cs{dbauthorssc} & the same, last names in small capitals \\
  \cs{dbauthorscite} & the same in the form of the suggested citation \\
  \cs{dbtitle}, \cs{dbsubtitle} & main title, subtitle \\
  \cs{dbyear}, \cs{dbdate} & year, date written out \\
  \cs{dbjournal} & journal or title of the collection \\
  \cs{dbcollection} & editors, title and series of the collection \\
  \cs{dbpublisher} & place and publisher \\
  \cs{dbsource} & source \\
  \cs{dbcitation} & suggested citation \\
  \cs{dbdoi}, \cs{dbdoiurl} & DOI as a link, shown as DOI or as URL \\
  \cs{dbdoiqr}\texttt{[}\meta{options}\texttt{]} & QR code for the DOI (options of \cs{qrcode}) \\
  \cs{dbbibtex} & BibTeX code of the entry \\
  \cs{dbtext}\texttt{\{}\meta{name}\texttt{\}} & text in the current language, e.\,g. \texttt{\{citation\}} \\
  \cs{dbsc}\texttt{\{}\meta{text}\texttt{\}} & small capitals with replacement \\
  \cs{dbiffield}\texttt{\{}\meta{field}\texttt{\}} & is the field present and not empty? \\
  \cs{dbiftype}\texttt{\{}\meta{types}\texttt{\}} & is the type one of those given? \\
  \cs{dbifarticle}, \cs{dbifsubtitle} & journal article? subtitle? \\
  \cs{dbifdoi}, \cs{dbifpublisher} & DOI? place or publisher? \\
  \cs{dbiffulldate} & date with month? \\
  \bottomrule
\end{xltabular}
\endgroup

\begin{lstlisting}
\dbifdoi{Online: \dbdoiurl}{No DOI available.}
\end{lstlisting}

\section{Example files}

\begin{description}
\item[\texttt{deckblatt-example.bib}] invented entries for the examples,
\item[\texttt{deckblatt-example-banner.tex}] \key{banner} with default colours and
  note, font Libertine,
\item[\texttt{deckblatt-example-sidebar.tex}] \key{sidebar} with default colours and
  note, font Libre Franklin with a light subtitle and replacement small capitals,
\item[\texttt{deckblatt-example-english.tex}] \key{banner} in English with an accent
  colour and a note text of one's own,
\item[\texttt{deckblatt-example-colors.tex}] \key{sidebar} on the right, in English,
  with colours and a stripe text of one's own.
\end{description}

\section{Version history}

\begin{description}
\item[1.0 (2026-11-23)] First release on CTAN.
\end{description}

\section{Licence}

Copyright \textcopyright\ 2026 Daniel Tibi. This package 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
(\url{https://www.latex-project.org/lppl.txt}). This work has the LPPL maintenance
status \enquote{maintained}. The Current Maintainer of this work is Daniel Tibi.

\end{document}
