\section{\ldeen{Projekteinstellungen}{Project Configuration}}
\label{sec:project-configuration}

\ldeen{Die Konfiguration von \osglecture\ liegt absichtlich nicht in einer
einzigen Datei. Verschiedene Ebenen beantworten verschiedene Fragen: \OLLM\ 
entscheidet, \emph{was} gebaut werden darf und wo Ergebnisse liegen;
\LaTeX\ entscheidet, \emph{wie} eine ausgewählte Dokumentinstanz gesetzt wird.
Eine Einstellung gehört auf die niedrigste Ebene, auf der sie für alle
betroffenen Dokumente gilt.}{The configuration of \osglecture\ is deliberately
not kept in one file. Different layers answer different questions: \OLLM\ 
decides \emph{what} may be built and where results live; \LaTeX\ decides
\emph{how} a selected document instance is typeset. Put a setting at the
lowest layer at which it applies to all affected documents.}

\begin{description}
  \item[\ldeen{Nutzerkonfiguration}{User configuration}]
    \ldeen{wählt persönliche Defaults, derzeit insbesondere das bevorzugte
    Bundle-Preset}{selects personal defaults, currently in particular the
    preferred bundle preset}.
  \item[\File{ollmconfig.toml}]
    \ldeen{definiert Identität, Dokumentinstanzen, Sicherheit, Auflösung und
    Deployment des Projekts}{defines the project's identity, document instances,
    security, resolution, and deployment}.
  \item[\ldeen{Preset- und Targetdefinitionen}{Preset and target definitions}]
    \ldeen{geben den Namen eines Targets seine Bedeutung: Dokumenttyp,
    Profilklasse, Metadatenvertrag und zulässige Unit-Scopes}{give a target
    name its meaning: document type, profile class, metadata contract, and
    permitted unit scopes}.
  \item[\File{Include/projectconfig.tex}]
    \ldeen{enthält die gemeinsame semantische \LaTeX-Konfiguration, etwa
    Profile, Sprachen, Metadaten und Klassenoptionen}{contains the shared
    semantic \LaTeX\ configuration, such as profiles, languages, metadata,
    and class options}.
  \item[\File{Include/documentmetadata.tex}]
    \ldeen{enthält den frühen \cs{DocumentMetadata}-Aufruf für
    Targets, die Tagged PDF oder andere frühe PDF-Eigenschaften verlangen}
    {contains the early \cs{DocumentMetadata} call for targets
    requiring Tagged PDF or other early PDF properties}.
  \item[\ldeen{Lehreinheit}{Course unit}]
    \ldeen{kann projektweite Metadaten für ihren eigenen Inhalt
    konkretisieren; erzwungene Projektvorgaben bleiben verbindlich}{may refine
    project-wide metadata for its own content; enforced project settings
    remain binding}.
\end{description}

\subsection{\ldeen{Das Projektmanifest}{The Project Manifest}}

\ldeen{Die Datei \File{ollmconfig.toml} markiert die Projektwurzel. \OLLM\ 
sucht sie vom Arbeitsverzeichnis aus nach oben. Das Manifest beschreibt eine
zu erzeugenden Dokumentinstanzen und enthält keinen Lehrtext. Ein kompaktes Projekt mit zwei
Sprachen und drei Targets beginnt beispielsweise so}{The file
\File{ollmconfig.toml} marks the project root. \OLLM\  searches upwards for it
from the working directory. The manifest describes the document instances to be generated and contains
no teaching content. A compact project with two languages and three targets
might begin as follows}:

\begin{verbatim}
schema = 2
bundle_preset = "OSG lecture/1"

[project]
id = "operating-systems"

[targets.defaults]
languages = ["de", "en"]
default_language = "de"

[targets.slides]
[targets.handout]
[targets.script]
\end{verbatim}

\ldeen{\option{schema} bezeichnet das Dateischema, nicht die Version des
Bundles. \option{project.id} ist die dauerhafte technische Serien-ID und geht
in Jobnamen und Dokumentidentitäten ein. Ändern Sie sie nach dem ersten Build
nur bewusst.}{\option{schema} identifies the file schema, not the bundle
version. \option{project.id} is the persistent technical series ID and
contributes to job names and document identities. Change it after the first
build only deliberately.}

\ldeen{\code{[targets.defaults]} sammelt, was jedes Target erbt, solange es
nichts Eigenes setzt: \option{languages} listet in fester Reihenfolge alle
Projektsprachen und ist zugleich der Prüfanker (die \option{languages} eines
Targets müssen eine Teilmenge sein); \option{default\_language} wird gebaut,
wenn die CLI keine Sprache nennt. Ein leeres \code{[targets.slides]} erbt
alles; ein weggelassenes Target existiert schlicht nicht. Die Zuordnung von
\code{de} zu \code{ngerman} oder von \code{en} zu \code{british} ist dagegen
eine \LaTeX-Angelegenheit und gehört als \option{map} von \pkg{langselect} in
\File{projectconfig.tex} -- die Sprachliste selbst muss dort nicht wiederholt
werden.}{\code{[targets.defaults]} holds what every target inherits unless it
sets its own: \option{languages} lists all project languages in a fixed order
and is also the validation anchor (a target's \option{languages} must be a
subset); \option{default\_language} is built when the CLI names none. An empty
\code{[targets.slides]} inherits everything; an omitted target simply does not
exist. Mapping \code{de} to \code{ngerman} or \code{en} to \code{british},
however, is a \LaTeX\ concern and belongs in \File{projectconfig.tex} as the
\option{map} option of \pkg{langselect} -- the language list itself need not be
repeated there.}

\ldeen{Ein Target darf \option{languages}, \option{default\_language},
\option{profile} und \option{document\_metadata} überschreiben.
\option{profile} wählt das Dokumentprofil für genau dieses Target;
\code{[targets.defaults]} kann stattdessen \option{presentation\_profile} und
\option{longform\_profile} setzen, die je nach Profilklasse des Targets
greifen. Fehlt beides, gelten die Profil-Defaults des Bundle-Presets.
\option{document\_metadata} mit \code{enabled} oder \code{disabled} ist eine
bewusste Ausgabeentscheidung und wirkt nur dort, wo das aufgelöste Profil den
Metadatenvertrag offen lässt (\code{supported}); widerspricht sie einem Profil
mit erzwungenem Vertrag, weist \OLLM\ den Build vor dem Lauf ab.}{A target may
override \option{languages}, \option{default\_language}, \option{profile}, and
\option{document\_metadata}. \option{profile} selects the document profile for
that one target; \code{[targets.defaults]} may instead set
\option{presentation\_profile} and \option{longform\_profile}, which apply
according to the target's profile class. If neither is set, the bundle
preset's profile defaults apply. \option{document\_metadata} with
\code{enabled} or \code{disabled} is a deliberate output choice and takes
effect only where the resolved profile leaves the metadata contract open
(\code{supported}); if it contradicts a profile with a forced contract,
\OLLM\ rejects the build before the run.}

\ldeen{\code{[project]} kann zusätzlich \option{tex\_directory} und
\option{tex\_config} setzen (Standard \code{Include} bzw.
\code{projectconfig.tex}). Der Verzeichnisname bleibt projektwurzel-relativ,
\option{tex\_config} ist nur ein Dateiname}{\code{[project]} may additionally
set \option{tex\_directory} and \option{tex\_config} (default \code{Include}
and \code{projectconfig.tex}). The directory name stays project-root-relative,
\option{tex\_config} is a file name only}:

\begin{verbatim}
[project]
id = "operating-systems"
tex_directory = "Include"
tex_config = "projectconfig.tex"
\end{verbatim}

\ldeen{Weitere Manifestbereiche steuern \code{[security]}
(\option{shell\_escape}, \option{overwrite}), die maximale Rundenzahl von
\code{build --resolve} und das Deployment.}{Other manifest areas control
\code{[security]} (\option{shell\_escape}, \option{overwrite}), the maximum
number of \code{build --resolve} rounds, and deployment.}

\subsection{Bundle\ldeen{-}{ }Preset}

\ldeen{Das Bundle-Preset ist ein versionierter Vertrag zwischen dem Projekt
und den mit \OLLM\  installierten Definitionen.
\code{OSG lecture/1} wählt
das Vokabular und die Regeln dieser Bundle-Generation. Es ist nicht mit einem
Dokumentprofil zu verwechseln: Das Preset erklärt \OLLM\  die Buildwelt, während
ein Profil später die konkrete \LaTeX-Klasse und Darstellung festlegt.}{The
bundle preset is a versioned contract between the project and the definitions
installed with \OLLM. \code{OSG lecture/1} selects the vocabulary and
rules of this bundle generation. Do not confuse it with a document profile:
the preset explains the build world to OLLM, whereas a profile later selects
the concrete \LaTeX\ class and rendering.}

\ldeen{Die mitgelieferten Targetdefinitionen registrieren
\code{slides}, \code{handout}, \code{screen} und \code{script}. Eine Definition legt
\option{doctype}, \option{profile\_class} und \option{unit\_scopes} fest. Das
Preset bringt außerdem die Profil-Defaults \option{presentation\_profile} und
\option{longform\_profile} mit. Profilbeschreibungen (\option{document-metadata},
\option{doctypes} und mehr) liegen im mitgelieferten Verzeichnis
\code{definitions/profiles/}; projektlokale Definitionen können über
\File{.ollmconfig.local.toml} ergänzt werden und ersetzen gleichnamige
eingebaute nicht stillschweigend.}{The supplied target definitions register
\code{slides}, \code{handout}, \code{screen}, and \code{script}. A definition specifies
\option{doctype}, \option{profile\_class}, and \option{unit\_scopes}. The
preset also carries the profile defaults \option{presentation\_profile} and
\option{longform\_profile}. Profile descriptions (\option{document-metadata},
\option{doctypes}, and more) are supplied under
\code{definitions/profiles/}; project-local definitions can be added through
\File{.ollmconfig.local.toml} and do not silently replace built-in ones with
the same name.}

\ldeen{Ein eigenes Target ist beispielsweise sinnvoll, wenn Studierende neben
dem normalen Skript einen didaktisch anders aufgebauten Studienleitfaden
erhalten sollen. Dazu registriert Nora zunächst den Suchpfad in
\File{.ollmconfig.local.toml}}{A custom target is useful, for example, when
students should receive a study guide with a didactically different structure
in addition to the normal lecture notes. Nora first registers the search path
in \File{.ollmconfig.local.toml}}:

\begin{verbatim}
schema = 1

[definitions]
paths = ["Definitions"]
\end{verbatim}

\ldeen*{Dann legt sie @1 an}{She then creates @1}{\File{Definitions/targets/studyguide.toml}}:

\begin{verbatim}
schema = 1
kind = "target"
name = "studyguide"
version = "1.0"
doctype = "studyguide"
profile_class = "longform"
unit_scopes = ["a", "as"]
\end{verbatim}

\ldeen{Erst diese Definition gibt dem Namen \code{studyguide} eine Bedeutung:
Er ist eine Langform und gilt für die angegebenen Unit-Scopes. Danach kann das
Manifest \code{[targets.studyguide]} aufnehmen. Zusätzlich benötigt \LaTeX\ ein
Profil, das den neuen Dokumenttyp unterstützt; dessen Profilbeschreibung legt
Nora als \File{Definitions/profiles/\meta{name}.toml} neben die \code{.def}.
Ein neuer Name allein genügt also absichtlich nicht; Buildauswahl und Satz
müssen denselben Vertrag verstehen.}{Only this definition gives the name
\code{studyguide} a meaning: it is a long form and applies to the listed unit
scopes. The manifest may then add \code{[targets.studyguide]}. \LaTeX\ also
needs a profile supporting the new document type; Nora places its profile
description as \File{Definitions/profiles/\meta{name}.toml} next to the
\code{.def}. A new name alone is deliberately insufficient; build selection and
typesetting must understand the same contract.}

\subsection{\ldeen{Standardeinstellungen für Nutzer}{User Defaults}}

\ldeen{Wer mehrere Projekte mit demselben Bundle bearbeitet, kann sein
bevorzugtes Preset persönlich vorbelegen. Unter Unix liegt die Datei gewöhnlich
in \File{\$XDG\_CONFIG\_HOME/ollm/config.toml} oder
\File{\$HOME/.config/ollm/config.toml}, unter Windows in
\File{\%APPDATA\%/ollm/config.toml}. \code{OLLM\_USER\_CONFIG} kann einen
anderen Pfad wählen}{Users working on several projects with the same bundle can
set a personal preferred preset. On Unix the file is normally found in
\File{\$XDG\_CONFIG\_HOME/ollm/config.toml} or
\File{\$HOME/.config/ollm/config.toml}, and on Windows in
\File{\%APPDATA\%/ollm/config.toml}. \code{OLLM\_USER\_CONFIG} can select a
different path}:

\begin{verbatim}
schema = 1
bundle_preset = "OSG lecture/1"
\end{verbatim}

\ldeen{Ein explizites \option{bundle\_preset} im Projektmanifest hat Vorrang.
Die Nutzerdatei ist deshalb ein Komfortdefault und keine Möglichkeit, die
reproduzierbare Projektkonfiguration unbemerkt zu überschreiben.}{An explicit
\option{bundle\_preset} in the project manifest takes precedence. The user file
is therefore a convenience default, not a way to override reproducible project
configuration unnoticed.}

\subsection{\LaTeX\ldeen{-Konfiguration}{ Configuration}}

\ldeen{Die gemeinsame \LaTeX-Konfiguration liegt standardmäßig in
\File{Include/projectconfig.tex}. Sie beschreibt die fachliche und
gestalterische Semantik des Projekts -- Profilwahl und Sprachliste stehen
dagegen im Manifest. Ein typischer Kern ist}{The shared \LaTeX\ configuration
is stored in \File{Include/projectconfig.tex} by default. It describes the
project's subject-matter and design semantics -- profile selection and the
language list live in the manifest instead. A typical core is}:

\begin{verbatim}
\LectureProjectSetup{
  languages={
    map={de=ngerman,en=british},
    load babel
  }
}

\OsgLectureSetup{
  class/<slides>={aspectratio=169},
  class/scrbook={twoside,open=right},
  mode/longform={continuation={counters={page,chapter,section}}}
}

\title{\ldeen{Betriebssysteme}{Operating Systems}}
\author{Nora Example}
\end{verbatim}

\ldeen{Die auswählbaren Sprachen kommen für einen \OLLM-Build aus dem Manifest;
\code{languages} nennt hier nur noch das \pkg{langselect}-Mapping. \osglecture\
reicht die Sprachliste (in Manifestreihenfolge) aus der Buildauftragsdatei an
\pkg{langselect} weiter.}{For an \OLLM\ build the selectable languages come
from the manifest; \code{languages} here only carries the \pkg{langselect}
mapping. \osglecture\ hands the language list (in manifest order) from the
build file to \pkg{langselect}.}

\ldeen{\option{class/NAME} enthält unveränderte Optionen für die wirkliche
Basisklasse und wird vor deren Laden ausgewertet: \option{class/beamer}
adressiert die Basisklasse namentlich, \option{class/<slides>} den Modus (der
\emph{fertige} Modusgraph steht schon vor \cs{LoadClass} bereit, ein einzelner
Modusname wird gegen die aktiven Modi geprüft). \option{mode/NAME} enthält
dagegen Einstellungen für eine osglecture-eigene Ausgabeeigenschaft und wird
nach Finalisierung des Modusgraphen von allgemein nach spezifisch angewandt.}{
\option{class/NAME} contains unchanged options for the actual base class and is
evaluated before that class is loaded: \option{class/beamer} addresses the base
class by name, \option{class/<slides>} addresses the mode (the \emph{finalized}
mode graph is ready before \cs{LoadClass}; a single mode name is checked
against the active modes). \option{mode/NAME}, in contrast, contains settings
for an osglecture output property and is applied from general to specific after
the mode graph has been finalized.}

\ldeen{Frei programmierter Präambelcode gehört vorzugsweise in getrennte
Fragmente, die mit \cs{IncludeOsgLecturePreamble}\marg{name}
eingebunden werden. Sie dürfen Paketladungen und eigene Makros enthalten und
können durch einen Modusausdruck oder \keyis{class}{\meta{class}} eingeschränkt werden.
Damit bleibt \File{projectconfig.tex} eine lesbare Sammlung semantischer
Projektentscheidungen.}{Freely programmable preamble code should preferably
be placed in separate fragments included with
\cs{IncludeOsgLecturePreamble}\marg{name}. They may contain package
loads and custom commands and can be restricted by a mode expression or
\keyis{class}{\meta{class}}. This keeps \File{projectconfig.tex} a readable
collection of semantic project decisions.}

\paragraph{\ldeen{Metadaten}{Metadata}.}
\ldeen{Felder wie Titel und Autor können modusabhängige Werte besitzen. Eigene
Felder werden mit \cs{DeclareOsgLectureMetadataField} registriert.
Die normale Priorität lautet Fallback, Profil, Projekt und schließlich Unit.
\cs{EnforceLectureProjectConfiguration} macht eine Projektvorgabe
verbindlich, sodass eine Unit sie nicht überschreiben kann.}{Fields such as
title and author may have mode-dependent values. Custom fields are registered
with \cs{DeclareOsgLectureMetadataField}. Normal precedence is
fallback, profile, project, and finally unit.
\cs{EnforceLectureProjectConfiguration} makes a project setting
binding so that a unit cannot override it.}

\begin{verbatim}
\author<presentation>[N. Example]{Nora Example}
\author<longform>[Example]{Dr. Nora Example}
\DeclareOsgLectureMetadataField{supervisor}
\supervisor<longform>{Ada Professor}
\end{verbatim}

\ldeen{\File{documentmetadata.tex} hat eine andere Aufgabe: Sein
\cs{DocumentMetadata}-Aufruf muss vor der Dokumentklasse erfolgen
und steuert PDF-Eigenschaften, nicht die sichtbaren fachlichen Metadaten. \OLLM\
bindet die Datei ein, wenn die aus dem Profil abgeleitete Metadatenpolicy
\code{enabled} ergibt -- also bei einem \code{required}-Profil immer, bei einem
\code{supported}-Profil, wenn \keyis{document\_metadata}{enabled} im Manifest
steht. Dabei stehen Symbole wie \cs{OsgLectureRequestedLanguage} zur
Verfügung.}{\File{documentmetadata.tex} has a different role: its
\cs{DocumentMetadata} call must precede the document class and controls PDF
properties rather than visible subject metadata. \OLLM\  includes the file when
the metadata policy derived from the profile resolves to \code{enabled} --
always for a \code{required} profile, and for a \code{supported} profile when
the manifest sets \keyis{document\_metadata}{enabled}. Symbols such as
\cs{OsgLectureRequestedLanguage} are available there.}

\subsection{\ldeen{Dokumentenprofile}{Document Profiles}}

\ldeen{Ein Dokumentprofil verbindet einen fachlichen Dokumenttyp mit einer
technischen Satzumgebung. Es benennt Basisklasse, Klassenanbindung, unterstützte
Dokumenttypen, zusätzliche Modi, Klassenoptionen und den
\cs{DocumentMetadata}-Vertrag. Mitgeliefert werden}{A document profile
connects a conceptual document type to a technical typesetting environment. It
names the base class, class integration, supported document types, additional
modes, class options, and the \cs{DocumentMetadata} contract. The supplied
profiles are}:

\begin{description}
  \item[\cls{beamer}] \ldeen{für \code{slides}, \code{handout} und
    \code{screen}; Metadaten vor der Klasse sind verboten (Preset-Default für
    \option{presentation\_profile})}{for \code{slides}, \code{handout}, and
    \code{screen}; metadata before the class is forbidden (preset default for
    \option{presentation\_profile})}.
  \item[\cls{ltx-talk}] \ldeen{für \code{slides}, \code{handout} und
    \code{screen}; \cs{DocumentMetadata} ist erforderlich}{for \code{slides},
    \code{handout}, and \code{screen}; \cs{DocumentMetadata} is required}.
  \item[\cls{book}] \ldeen{für \code{script} und \code{article} auf
    Basis der Standardklasse \cls{book}}{for \code{script} and
    \code{article}, based on the standard \cls{book} class}.
  \item[\cls{scrbook}] \ldeen{für \code{script} und \code{article}
    auf Basis von KOMA-Script; \cs{DocumentMetadata} ist verboten, weil
    KOMA-Script es noch nicht unterstützt, es entsteht also kein Tagged PDF
    (Preset-Default für \option{longform\_profile})}{for \code{script} and
    \code{article}, based on KOMA-Script; \cs{DocumentMetadata} is forbidden
    because KOMA-Script does not support it yet, so no Tagged PDF is produced
    (preset default for \option{longform\_profile})}.
\end{description}

\ldeen{Das Profil wird im Manifest gewählt (\option{profile} am Target oder
\option{presentation\_profile}\slash \option{longform\_profile} in
\code{[targets.defaults]}), nicht in \File{projectconfig.tex} -- denn sein
\cs{DocumentMetadata}-Vertrag muss feststehen, bevor die Klasse überhaupt
läuft. Für ein Standalone-Dokument ohne Manifest wählt die Klassenoption
\keyis{profile}{\meta{name}}.}{The profile is chosen in the manifest
(\option{profile} on the target, or
\option{presentation\_profile}\slash\option{longform\_profile} in
\code{[targets.defaults]}), not in \File{projectconfig.tex} -- its
\cs{DocumentMetadata} contract has to be fixed before the class runs at all.
For a standalone document without a manifest the class option
\keyis{profile}{\meta{name}} selects it.}

\ldeen{Ein eigenes Profil liegt üblicherweise als
\File{osglecture-profile-NAME.def} im TeX-Suchpfad. Es kann ein vorhandenes
eine vorhandene Klassenanbindung wiederverwenden; eine neue Basisklasse benötigt
zusätzlich eine passende Anbindung. Die drei Pflichtangaben sind
\option{backend}, \option{class} und \option{doctypes}}{A custom profile is
normally provided as \File{osglecture-profile-NAME.def} on the TeX search
path. It may reuse an existing class integration; a new base class also
requires a suitable integration. The three required entries are \option{backend},
\option{class}, and \option{doctypes}}:

\begin{verbatim}
\ProvidesExplFile{osglecture-profile-mybook.def}{2026-08-28}{1.0}
  {Project book profile}
\DeclareOsgLectureProfile{mybook}{
  backend=scrbook,
  adapter=scrbook,
  class=scrbook,
  capabilities={longform,print},
  doctypes={script,article},
  class-options={11pt},
  document-metadata=supported,
  course-target=title,
  event-target=subtitle
}
\DeclareOsgLectureProfileClassOptions{mybook}{script}{open=right}
\end{verbatim}

\ldeen{Damit \OLLM\ den \cs{DocumentMetadata}-Vertrag schon vor dem Lauf kennt,
liegt neben der \code{.def} eine maschinenlesbare Profilbeschreibung
\File{osglecture-profile-mybook.toml} (bzw. unter
\code{Definitions/profiles/})}{So that \OLLM\ knows the \cs{DocumentMetadata}
contract before the run, a machine-readable profile description
\File{osglecture-profile-mybook.toml} sits next to the \code{.def} (or under
\code{Definitions/profiles/})}:

\begin{verbatim}
schema = 1
kind = "profile"
name = "mybook"
version = "1.0"
profile_class = "longform"
document_metadata = "supported"
doctypes = ["script", "article"]
\end{verbatim}

\ldeen{Nach Installation oder Aufnahme des gemeinsamen Verzeichnisses in den
TeX-Suchpfad genügt \keyis{longform\_profile}{mybook} in
\code{[targets.defaults]}. \osglecture\ lädt die \code{.def} bei der ersten
Auswahl automatisch und prüft, ob der angeforderte Dokumenttyp unterstützt
wird. \File{ollm/testfiles} bzw. \code{definitions/profiles.t} bewacht, dass
\code{.def} und \code{.toml} nicht auseinanderlaufen.}{After installation or
adding the shared directory to the TeX search path,
\keyis{longform\_profile}{mybook} in \code{[targets.defaults]} is sufficient.
\osglecture\ loads the \code{.def} automatically on first selection and checks
whether the requested document type is supported. \code{definitions/profiles.t}
guards that the \code{.def} and the \code{.toml} do not drift apart.}

\subsection{\ldeen{Den Modusgraphen erweitern}{Extending the Mode Graph}}
\label{sec:configuration-mode-extensions}

\ldeen{Ein eigener Modus ist angebracht, wenn eine neue Ausgabeeigenschaft
inhaltlich abgefragt werden soll. Ein neues Farbschema ist kein Modus; es
ändert nur die Darstellung. Ein Studienleitfaden, der zusätzliche
Selbstkontrollfragen enthält und zugleich eine druckbare Langform ist, benötigt
dagegen sinnvollerweise den Blattmodus \code{studyguide} mit den Eltern
\code{longform} und \code{print}.}{A custom mode is appropriate when a new
output property needs to be queried in the content. A new colour scheme is not
a mode; it only changes presentation. A study guide containing additional
self-assessment questions while also being a printable long form, by contrast,
reasonably needs the \code{studyguide} leaf mode with the parents
\code{longform} and \code{print}.}

\ldeen{Die Deklaration gehört in eine Modus-Setup-Datei, die ein Profil vor der
Finalisierung des Graphen lädt}{The declaration belongs in a mode setup file
loaded by a profile before the graph is finalized}:

\begin{verbatim}
% osglecture-mode-studyguide.tex
\DeclareLectureMode[parents={longform,print}]{studyguide}
\AssignLectureModeBehavior{studyguide}{longform}
\end{verbatim}

\ldeen{Die Eltern beschreiben fachliche Zugehörigkeit: Eine Abfrage nach
\code{studyguide}, \code{longform} oder \code{print} ist für diese Instanz
wahr. Die Verhaltensklasse beantwortet eine andere Frage: Welche konkrete
Implementierung sollen polymorphe Befehle für diesen Blattmodus verwenden?
Durch die Zuordnung zu \code{longform} kann der neue Typ die vorhandenen
Langformimplementierungen wiederverwenden. Nur wenn tatsächlich neues Verhalten
benötigt wird, sollte mit \cs{DeclareModeBehaviorClass} eine neue
Verhaltensklasse eingeführt werden; dann müssen alle dafür geltenden
Befehlsverträge vollständig implementiert sein.}{The parents describe semantic
membership: a query for \code{studyguide}, \code{longform}, or \code{print}
is true for this instance. The behaviour class answers a different question:
which concrete implementation should polymorphic commands use for this leaf
mode? Assigning \code{longform} lets the new type reuse existing long-form
implementations. Only genuinely new behaviour should introduce a new behaviour
class with \cs{DeclareModeBehaviorClass}; every command contract applying to
that class must then be implemented completely.}

\ldeen{Das zugehörige Profil verbindet den fachlichen Modus mit einer
Satzumgebung. Gegenüber dem vorigen Profilbeispiel kommen der neue Dokumenttyp
und die Setup-Datei hinzu}{The corresponding profile connects the semantic
mode to a typesetting environment. Compared with the previous profile example,
the new document type and setup file are added}:

\begin{verbatim}
\DeclareOsgLectureProfile{studyguide-scrbook}{
  backend=scrbook,
  adapter=scrbook,
  class=scrbook,
  doctypes={studyguide},
  mode-setup-file=osglecture-mode-studyguide.tex,
  document-metadata=supported
}
\end{verbatim}

\ldeen{Der Lebenszyklus ist absichtlich streng: Zuerst werden Modi,
Elternkanten und Aliase deklariert; danach aktiviert \osglecture\ die aus dem
Dokumenttyp und dem Profil stammenden Blattmodi; schließlich finalisiert es den
Graphen. Erst dann werden modusabhängige Konfiguration und Inhalte ausgewertet.
Nach der Finalisierung sind Deklarationen und Änderungen Fehler. Dadurch sehen
alle späteren Abfragen denselben geprüften, zyklenfreien Graphen.}{The lifecycle
is deliberately strict: modes, parent edges, and aliases are declared first;
then \osglecture\ activates the leaf modes supplied by the document type and
profile; finally it finalizes the graph. Only then are mode-dependent
configuration and content evaluated. Declarations and changes after
finalization are errors. This ensures that every subsequent query sees the
same validated, acyclic graph.}

\ldeen{Die \option{mode-setup-file} eines Profils wird nur für dessen
Dokumenttypen gelesen. Nennt gemeinsamer Quelltext einen projekteigenen Modus
-- etwa \code{\string\mode<solutions>} in einer Unit, die auch als
\code{script} gebaut wird --, muss der Modus in jedem Target bekannt sein, denn
ein unbekannter Modus ist ein Fehler. Dafür liest
\cs{LectureProjectSetup}\code{\{mode-setup-file=\meta{Datei}\}} in
\File{projectconfig.tex} eine Datei in jedem Target, vor der des Profils.
Aktiv wird der Modus weiterhin nur dort, wo Dokumenttyp oder Profil ihn
wählen. Das Beispiel \File{examples/series-modern} nutzt das für ein
Übungsblatt mit Lösungsfassung.}{A profile's \option{mode-setup-file} is
read only for its document types. If shared source names a project mode --
such as \code{\string\mode<solutions>} in a unit that is also built as
\code{script} -- the mode has to be known in every target, since an unknown
mode is an error. For that,
\cs{LectureProjectSetup}\code{\{mode-setup-file=\meta{file}\}} in
\File{projectconfig.tex} reads a file in every target, before the profile's.
The mode still becomes active only where the document type or profile selects
it. The example \File{examples/series-modern} uses this for an exercise sheet
with a solutions version.}

\ldeen{\cs{DeclareLectureModeParents}\marg{mode}\marg{parents} ergänzt oder
ersetzt die Elternangabe getrennt von der Deklaration;
\cs{DeclareLectureModeAlias}\marg{alias}\marg{mode} stellt einen alternativen
Namen bereit. \cs{SetLectureModes} und \cs{AddLectureModes} wählen Blattmodi,
\cs{FinalizeLectureModes} schließt den Graphen. In gewöhnlichen
\cls{osglecture}-Projekten werden die letzten drei Schritte von Klasse und
Profil ausgeführt; Projektquellen sollten sie nicht vorwegnehmen.}{
\cs{DeclareLectureModeParents}\marg{mode}\marg{parents} supplies or replaces
parents separately from declaration;
\cs{DeclareLectureModeAlias}\marg{alias}\marg{mode} provides an alternative
name. \cs{SetLectureModes} and \cs{AddLectureModes} select leaf modes, while
\cs{FinalizeLectureModes} closes the graph. In ordinary \cls{osglecture}
projects, the class and profile perform the last three steps; project sources
should not pre-empt them.}

\subsection{\ldeen{Konfigurationsreferenz}{Configuration Reference}}
\label{sec:configuration-reference}

\paragraph{\ldeen{Klassenoptionen}{Class options}.}
\begin{description}
  \item[\option{standalone}] \ldeen{manifestfreien Betrieb aktivieren}{enable
    manifest-free operation}.
  \item[\keyis{doctype}{name}] \ldeen{Dokumenttyp wählen; im Standalone-Betrieb
    standardmäßig \code{slides}}{select the document type; defaults to
    \code{slides} in standalone mode}.
  \item[\keyis{profile}{name}] \ldeen{Dokumentprofil ausdrücklich wählen
    (Standalone; für \OLLM-Builds kommt es aus dem Manifest)}{select a document
    profile explicitly (standalone; for \OLLM\ builds it comes from the
    manifest)}.
  \item[\keyis{lang}{tag}] \ldeen{Dokumentsprache wählen}{select the document
    language}.
  \item[\keyis{class-options}{list}] \ldeen{Optionen an die Basisklasse
    weiterreichen}{pass options to the base class}.
  \item[\keyis{patch-overlays}{true|false}] \ldeen{portable Modi in native
    Overlaybefehle integrieren}{integrate portable modes into native overlay
    commands}.
\end{description}

\paragraph{\cs{LectureProjectSetup}\marg{key-value list}.}
\begin{description}
  \item[\option{class-options}] \ldeen{gemeinsame Basisklassenoptionen}{shared
    base-class options}.
  \item[\keyis{mode-setup-file}{file}] \ldeen{Moduldeklarationen, die in
    jedem Target vor der Moduldatei des Profils gelesen werden}{mode
    declarations read in every target, before the profile's mode file}.
  \item[\option{presentation-profile}, \option{longform-profile},
    \option{identity-profile}] \ldeen{Profile für Standalone-Dokumente ohne
    Manifest; für \OLLM-Builds ist die Profilwahl abgekündigt und kommt aus dem
    Manifest}{profiles for standalone documents without a manifest; for \OLLM\
    builds profile selection here is deprecated and comes from the manifest}.
  \item[\option{theme}, \option{numbering}, \option{references}]
    \ldeen{projektweite semantische Policies}{project-wide semantic policies}.
  \item[\keyis{bibliography}{\{resources, style, options, series-target\}}]
    \ldeen{schaltet die Literaturverwaltung mit \pkg{biblatex} und
    \code{biber} ein (Vorgabestil \code{alphabetic})}{enables bibliography
    management with \pkg{biblatex} and \code{biber} (default style
    \code{alphabetic})}.
  \item[\option{languages}] \ldeen{eingebettete Konfiguration von
    \pkg{langselect}}{embedded \pkg{langselect} configuration}.
\end{description}
\ldeen{Unter \option{languages} sind die Schlüssel \option{targetlang},
\option{prefix}, \option{auto}, \option{trim}, \option{map},
\option{load babel}, \option{load polyglossia} und \option{unified shorthands}
zulässig. \option{selectable} kommt für einen \OLLM-Build aus dem Manifest
(ein Wert hier wird mit Warnung verworfen) und ist nur für Standalone
gedacht.}{Under \option{languages}, the permitted keys are \option{targetlang},
\option{prefix}, \option{auto}, \option{trim}, \option{map},
\option{load babel}, \option{load polyglossia}, and \option{unified
shorthands}. \option{selectable} comes from the manifest for an \OLLM\ build (a
value here is dropped with a warning) and is meant for standalone only.}
\ldeen{Wird \option{targetlang} ausgelassen, setzt \osglecture\ dafür
automatisch \cs{OsgLectureLanguage} ein. Ein expliziter Wert überschreibt
diese Konvention.}{If \option{targetlang} is omitted, \osglecture
automatically supplies \cs{OsgLectureLanguage}. An explicit value overrides
this convention.}

\paragraph{\ldeen{Weitere Projektbefehle}{Other project commands}.}
\begin{commands}
  \command{OsgLectureSetup}[\marg{areas}]
    \ldeen{weist Basisklassenoptionen zu,
    adressiert nach Klassenname (\code{class/NAME}) oder aktivem Modus
    (\code{class/<MODE>}), und mit \code{mode/NAME} osglecture-eigene
    modusabhängige Einstellungen}{assigns base-class options addressed by class
    name (\code{class/NAME}) or active mode (\code{class/<MODE>}), and
    osglecture mode-dependent settings with \code{mode/NAME}}.
  \command{LectureTargetSetup}[\marg{target}\marg{settings}]
    \ldeen{akzeptiert \option{filecolor}; \option{profile} wird für
    \OLLM-Builds ignoriert (Profilwahl im Manifest)}{accepts \option{filecolor};
    \option{profile} is ignored for \OLLM\ builds (profile selection in the
    manifest)}.
  \command{IncludeOsgLecturePreamble}[\sarg\aarg{modes}\oarg{class=list}\marg{name}]
    \ldeen{registriert ein bedingtes Präambelfragment; die
    Sternform lädt sofort und erlaubt deshalb keine Bedingungen}{registers a
    conditional preamble fragment; the starred form loads immediately and
    therefore permits no conditions}.
  \command{LectureProjectEnforce}[\marg{settings}]
    \ldeen{setzt Projekt-Policies mit erzwungener Priorität}{sets project
    policies with enforced priority}.
  \command{EnforceLectureProjectConfiguration}[\marg{code}]
    \ldeen{führt beliebigen Konfigurationscode mit erzwungener Priorität aus}{runs
    arbitrary configuration code with enforced priority}.
  \command{DeclareOsgLectureMetadataField}[\marg{name}]
    \ldeen{deklariert ein Metadatenfeld samt Setter und Abfragebefehlen}{declares
    a metadata field together with its setter and query commands}.
\end{commands}

\ldeen{Vordefinierte Metadatenfelder sind \code{title}, \code{subtitle},
\code{author}, \code{institute}, \code{date}, \code{course} und
\code{event}. Zu jedem Feld existieren ein Setter
\cs{OsgLectureSet}\meta{Field}, ein Langwert
\cs{OsgLecture}\meta{Field} und ein Kurzwert
\cs{OsgLectureShort}\meta{Field}. Die Setter akzeptieren
\aarg{mode}\oarg{short value}\marg{long value}.}{The predefined metadata
fields are \code{title}, \code{subtitle}, \code{author}, \code{institute},
\code{date}, \code{course}, and \code{event}. Each field has a setter
\cs{OsgLectureSet}\meta{Field}, a long-value command
\cs{OsgLecture}\meta{Field}, and a short-value command
\cs{OsgLectureShort}\meta{Field}. Setters accept
\aarg{mode}\oarg{short value}\marg{long value}.}

\paragraph{\ldeen{Profile definieren}{Defining profiles}.}
\ldeen{\cs{DeclareOsgLectureProfile}\marg{name}\marg{settings} akzeptiert
vollständig \option{engine}, \option{capabilities}, \option{backend},
\option{adapter}, \option{class}, \option{doctypes},
\option{class-options}, \option{setup-file}, \option{modes},
\option{mode-setup-file}, \option{course-target}, \option{event-target} und
\option{document-metadata}. Die letzten drei Wahlwerte sind
\code{title|subtitle|none}, \code{title|subtitle|none} beziehungsweise
\code{supported|required|forbidden}. Pflichtfelder sind \option{backend},
\option{class} und \option{doctypes}; \option{engine} ist derzeit
\code{lualatex}. Typspezifische Klassenoptionen werden mit
\cs{DeclareOsgLectureProfileClassOptions}\marg{profile}\marg{doctype}
\marg{options} ergänzt.}{\cs{DeclareOsgLectureProfile}\marg{name}
\marg{settings} accepts the complete set \option{engine},
\option{capabilities}, \option{backend}, \option{adapter}, \option{class},
\option{doctypes}, \option{class-options}, \option{setup-file},
\option{modes}, \option{mode-setup-file}, \option{course-target},
\option{event-target}, and \option{document-metadata}. The last three choices
are \code{title|subtitle|none}, \code{title|subtitle|none}, and
\code{supported|required|forbidden}, respectively. Required fields are
\option{backend}, \option{class}, and \option{doctypes}; \option{engine} is
currently \code{lualatex}. Add type-specific class options with
\cs{DeclareOsgLectureProfileClassOptions}\marg{profile}\marg{doctype}
\marg{options}.}

\paragraph{\ldeen{Referenzdienst konfigurieren}{Configuring references}.}
\ldeen{\cs{OsgLectureReferencesSetup}\marg{settings} akzeptiert
\keyis{legacy}{true|false} und \option{replace}. \option{replace} kann eine
Liste aus \code{ref}, \code{pageref}, \code{nameref}, \code{autoref} oder den
Sammelwert \code{all} enthalten und ersetzt die entsprechenden
Standardbefehle durch die serienfähigen Varianten.}{
\cs{OsgLectureReferencesSetup}\marg{settings} accepts
\keyis{legacy}{true|false} and \option{replace}. \option{replace} may contain
a list of \code{ref}, \code{pageref}, \code{nameref}, \code{autoref}, or the
aggregate value \code{all}, replacing the corresponding standard commands
with their series-aware variants.}
