\documentclass[a4paper,11pt]{article}

\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[margin=25mm]{geometry}
\usepackage{array}
\usepackage{booktabs}
\usepackage{hyperref}
\usepackage{longtable}
\usepackage{upquote}
\usepackage{xcolor}
\usepackage{fancyvrb}

\hypersetup{
  colorlinks=true,
  linkcolor=blue!50!black,
  urlcolor=blue!50!black
}

\title{onlinebrief24}
\author{Francesco Luciano}
\date{2026-03-22}

\begin{document}
\maketitle

\begin{abstract}
\texttt{onlinebrief24} is a LaTeX class for DIN 5008 type-B
business letters calibrated for use with \href{https://onlinebrief24.de}
{onlinebrief24.de}. It provides a plain letter layout, a modern variant with
header and footer, an optional DIN-style information block, and a technical
guides mode for layout inspection.
\href{https://onlinebrief24.de}{onlinebrief24.de} is a hybrid mail service for
business customers: documents are submitted digitally, and the service handles
printing, enveloping, franking, and postal delivery.
\end{abstract}

\section{Status}

The class is verified with pdfLaTeX, XeLaTeX, and LuaLaTeX. The supported and
hardened use case is one letter per document. The package is aimed at German
business letters and loads \texttt{babel} with \texttt{german} by default
(configurable via the \texttt{lang=} class option).

\section{Installation}

Install via your TeX distribution's package manager:

\begin{Verbatim}[fontsize=\small]
tlmgr install onlinebrief24
\end{Verbatim}

Then load the class in your document:

\begin{Verbatim}[fontsize=\small]
\documentclass{onlinebrief24}
\end{Verbatim}

\section{Engine Support}

\begin{itemize}
\item pdfLaTeX: verified
\item XeLaTeX: verified
\item LuaLaTeX: verified
\end{itemize}

With pdfLaTeX the class uses \texttt{fontenc} and \texttt{tgheros} (TeX Gyre
Heros). With XeLaTeX and LuaLaTeX it uses \texttt{fontspec}; Arial is preferred
if installed, otherwise it falls back to TeX Gyre Heros.

The \texttt{modern} style additionally loads \texttt{sourcesanspro} and
\texttt{fontawesome5} (for footer icons). Both packages are part of
\texttt{texlive-fonts-extra}.

\section{Minimal Example}

\begin{Verbatim}[fontsize=\small]
\documentclass[basic,lang=english]{onlinebrief24}

\setreturnaddress{Jane Smith, 12 Oak Street, Bristol BS1 4DJ}
\setrecipient{
  Example Services Ltd. \\
  Mr. John Smith \\
  24 Market Road \\
  London SW1A 1AA
}
\setsubject{Subject}
\setplace{Bristol}
\setdate{\today}

\begin{document}
\begin{letter}{}
\opening{Dear Mr. Smith,}

This is a sample letter.

\closing{Kind regards}
\end{letter}
\end{document}
\end{Verbatim}

\section{Options}

\begin{longtable}{@{}p{35mm}p{105mm}@{}}
\toprule
Option & Meaning \\
\midrule
\endhead
\texttt{basic} & Plain layout without header and footer. \\
\texttt{modern} & Modern layout with header, footer, and accent color. \\
\texttt{infoblock} & Show a DIN-style information block in the upper-right
header area. Only fields that are set are rendered. \\
\texttt{guides} & Technical overlay mode for checking the calibrated layout
zones, fold marks, and text start area. This mode is for inspection, not final
production output. \\
\texttt{footercenter} & Center the footer in modern mode. \\
\texttt{blue}, \texttt{orange}, \texttt{green}, \texttt{red},
\texttt{purple}, \texttt{grey}, \texttt{burgundy}, \texttt{black} &
Accent-color schemes for modern mode. \\
\texttt{lang=\textit{name}} & Document language passed to \texttt{babel}
(default: \texttt{german}). Any valid babel language name is accepted. The
\texttt{infoblock} labels are localized for \texttt{german},
\texttt{ngerman}, \texttt{english}, \texttt{french}, \texttt{spanish},
\texttt{italian}, \texttt{dutch}, and \texttt{polish}. \\
\bottomrule
\end{longtable}

\section{Main Commands}

\begin{longtable}{@{}p{50mm}p{90mm}@{}}
\toprule
Command & Purpose \\
\midrule
\endhead
\texttt{\string\setreturnaddress\{...\}} & Mandatory one-line sender line for
the address window. \\
\texttt{\string\setrecipient\{...\}} & Recipient block for the address window.
Mandatory unless it is passed via \texttt{\string\begin\{letter\}\{...\}}. \\
\texttt{\string\setsubject\{...\}} & Subject line above the opening. \\
\texttt{\string\setdate\{...\}} & Date, defaulting to \texttt{\string\today}. \\
\texttt{\string\setplace\{...\}} & Place printed before the date. \\
\texttt{\string\encl\{...\}} & Enclosures listed below the closing; standard
KOMA-Script command. \\
\texttt{\string\setyourref\{...\}} & Information-block field for the recipient's
reference. \\
\texttt{\string\setyourmessage\{...\}} & Information-block field for the
recipient's dated message. \\
\texttt{\string\setourref\{...\}} & Information-block field for your own
reference. \\
\texttt{\string\setourmessage\{...\}} & Information-block field for your own
dated message. \\
\texttt{\string\setcontactname\{...\}} & Information-block contact name. \\
\texttt{\string\setcontactphone\{...\}} & Information-block contact phone
number. \\
\texttt{\string\setcontactfax\{...\}} & Information-block contact fax number.
\\
\texttt{\string\setcontactemail\{...\}} & Information-block contact email
address. \\
\texttt{\string\setfromfirstname\{...\}} & Modern-mode first name for the
header. \\
\texttt{\string\setfromlastname\{...\}} & Modern-mode last name for the header.
\\
\texttt{\string\setfromaddress\{...\}} & Modern-mode address line in the header.
\\
\texttt{\string\setfromlandline\{...\}} & Optional modern-mode footer field. \\
\texttt{\string\setfromphone\{...\}} & Optional modern-mode footer field. \\
\texttt{\string\setfromemail\{...\}} & Optional modern-mode footer field. \\
\texttt{\string\setfromweb\{...\}} & Optional modern-mode footer field. \\
\texttt{\string\setfromlinkedin\{...\}} & Optional modern-mode footer field. \\
\texttt{\string\setfromname\{...\}} & Legacy fallback if first and last name are
not split. \\
\bottomrule
\end{longtable}

\section{Validation and Layout Guarantees}

The class validates the mandatory address-window fields when a letter starts.
Compilation stops with a clear error if the return address is missing, the
recipient is missing, or the return address is too long for the single-line
sender zone.

If the \texttt{infoblock} option is enabled, the information block is rendered
independently from the body text flow. This keeps the text start stable while
showing only the fields that are actually set.

For multipage letters, the address-window overlay, fold marks, and optional
modern header and footer are restricted to page 1. Continuation pages start
near the normal top margin instead of inheriting the first-page window offset.

\section{Calibration}

The layout is calibrated against the practical preview behavior of
\href{https://onlinebrief24.de}{onlinebrief24.de}, not only against the
nominal measurement graphic. In practice, the class uses effective window zones
of 50--52\,mm, 52--72\,mm, and 72--92\,mm to match the real preview more
closely.

\section{Examples}

The package ships with two focused example documents covering:

\begin{itemize}
\item the basic layout with the DIN-style information block
\item the modern layout with the DIN-style information block
\end{itemize}

Both bundled example documents use English sample data so the generated PDFs
double as immediately readable CTAN previews.

\section{License and Project Status}

This package is distributed under the LaTeX Project Public License (LPPL) 1.3c.
It is a community project and has no official affiliation with letterei.de
Postdienste GmbH. The trademark holders have formally authorized the maintainer
to use the onlinebrief24.de mark in connection with this LaTeX class.

\end{document}
