Files
leibnizfh-tex/leibnizfh.cls
T
2026-05-08 14:54:06 +02:00

280 lines
8.2 KiB
OpenEdge ABL

% -----------------------------------------------------------------------------
% LeibnizFH LaTeX-Klasse v1.1.1WIP
% Erstellt von: F. L. Werner
% Datum: 27.01.2026
%
% Beschreibung:
% Erstellt nach den Hochschulvorgaben (s. Datum). Angaben ohne Gewähr.
% Beiträge und Verbesserungen sind willkommen - viel Spaß beim Nutzen!
%
% Repository / Versionierung: http://gitea.wernerslab.work/hxf1302/leibnizfh-tex
%
%% leibnizfh.cls
%% Copyright 2026 F. L. Werner
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
% http://www.latex-project.org/lppl.txt
% and version 1.3 or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is F. L. Werner.
%
% This work consists of the file leibnizfh.cls
% -----------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{leibnizfh}[2026/01/21 v1.1.1WIP Leibniz FH Dokumentenklasse]
% Eigene Klassenoptionen:
\newif\if@ngerman
\newif\if@german
\newif\if@english
\newif\iflfh@plaintitle
\newif\if@truetitle
\@truetitlefalse
\@ngermanfalse
\@germanfalse
\@englishfalse
\DeclareOption{plaintitle}{%
\lfh@plaintitletrue
}
\DeclareOption{truetitle}{%
\@truetitletrue
}
\DeclareOption{ngerman}{%
\ClassWarning{leibnizfh}{Option 'ngerman' is deprecated. Use \protect\selectlanguage{german} in the document body instead}%
\@ngermantrue
\@germanfalse
\@englishfalse
}
\DeclareOption{german}{%
\ClassWarning{leibnizfh}{Option 'german' is deprecated. Use \protect\selectlanguage{german} in the document body instead}%
\@germantrue
\@ngermanfalse
\@englishfalse
}
\DeclareOption{english}{%
\ClassWarning{leibnizfh}{Option 'english' is deprecated. Use \protect\selectlanguage{english} in the document body instead}%
\@englishtrue
\@ngermanfalse
\@germanfalse
}
\newcommand{\lfh@ifgerman}[2]{%
\iflanguage{german}{#1}{%
\iflanguage{ngerman}{#1}{#2}%
}%
}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions\relax
% Standardklasse laden
\LoadClass[a4paper,11pt]{article}
% Pakete laden
% Standardformat
\RequirePackage[left=4cm, right=2cm, top=2.5cm, bottom=2.5cm]{geometry} % Abstände
\RequirePackage{tex-gyre} % Für TeX Gyre Heros (Serifenlose Schrift)
\RequirePackage{setspace} % Zeilenabstände
\RequirePackage{microtype} % Bessere Typographie im Blocksatz
% Headerzusätze
\RequirePackage{fancyhdr}
\RequirePackage{hyperref}
\RequirePackage{graphicx}
% Konfiguration per Key->Value
\RequirePackage{keyval}
% Sprache
\RequirePackage[english,ngerman ,german]{babel}
\if@english
\AtBeginDocument{\selectlanguage{english}}
\else
\if@ngerman
\AtBeginDocument{\selectlanguage{ngerman}}
\ClassWarning{leibnizfh}{ngerman deprecated. Use german instead}%
\else
\if@german
\AtBeginDocument{\selectlanguage{german}}
\else
% Keine Sprache gewählt -> Standard
\AtBeginDocument{\selectlanguage{german}}
\fi
\fi
\fi
% Formatgrundlagen
\renewcommand{\familydefault}{\sfdefault} % Font
\onehalfspacing %Zeilenabstand
\setlength{\parindent}{0pt} % Absatzeinrückung
\setlength{\parskip}{11pt} % Absatzhöhe
% Helpercommandos
% Logo
\newcommand{\lfh@includeLogo}{%
\ifx\lfh@logo\@empty
\ClassInfo{leibnizfh}{No logo file specified. Use \protect\lfhsetup{logo=path/to/file.ext}}%
\else
\IfFileExists{\lfh@logo}{%
\includegraphics[height=3\baselineskip]{\lfh@logo}%
}{%
\ClassWarning{leibnizfh}{Logo file '\lfh@logo' not found. Header rendered without logo}%
}%
\fi
}
% Fußnote
\renewcommand\footnotesize{%
\@setfontsize\footnotesize{9pt}{11pt} }
% Konfiguration
\newcommand*\lfh@title{Thema (Schrift groß oder fett)}
\newcommand*\lfh@subtitle{}
\newcommand*\lfh@module{Nennung des Moduls}
\newcommand*\lfh@semester{Semesterangabe\, z. B. „WS2025/2026“}
\newcommand*\lfh@worktype{Leistungsnachweis/Hausarbeit Praxisreflexion/Projektarbeit/Seminararbeit/ }
\newcommand*\lfh@author{Vorname Nachname}
\newcommand*\lfh@studentid{XXXXXX}
\newcommand*\lfh@email{e-mail@addresse.invalid}
\newcommand*\lfh@prof{Name des Professors/in}
\newcommand*\lfh@program{Studiengang}
\newcommand*\lfh@submission{\today}
\newcommand*\lfh@headerone{Muster}
\newcommand*\lfh@headertwo{Haus-\, Seminararbeiten\, Praxisreflexionen\, Essays…}
\newcommand*\lfh@headerthree{Leibniz-Fachhochschule $\cdot$ Version 2025}
\newcommand*\lfh@logo{}
\define@key{lfh}{title}{\def\lfh@title{#1}}
\define@key{lfh}{subtitle}{\def\lfh@subtitle{#1}}
\define@key{lfh}{module}{\def\lfh@module{#1}}
\define@key{lfh}{semester}{\def\lfh@semester{#1}}
\define@key{lfh}{worktype}{\def\lfh@worktype{#1}}
\define@key{lfh}{author}{\def\lfh@author{#1}}
\define@key{lfh}{studentid}{\def\lfh@studentid{#1}}
\define@key{lfh}{email}{\def\lfh@email{#1}}
\define@key{lfh}{prof}{\def\lfh@prof{#1}}
\define@key{lfh}{program}{\def\lfh@program{#1}}
\define@key{lfh}{logo}{\def\lfh@logo{#1}}
\define@key{lfh}{submission}{\def\lfh@submission{#1}}
\define@key{lfh}{headerone}{\def\lfh@headerone{#1}}
\define@key{lfh}{headertwo}{\def\lfh@headertwo{#1}}
\define@key{lfh}{headerthree}{\def\lfh@headerthree{#1}}
\define@key{lfh}{logo}{\def\lfh@logo{#1}}
\newcommand{\lfhsetup}[1]{\setkeys{lfh}{#1}}
% Header
% Globale Header-Höhen
\setlength{\headheight}{36pt}
\setlength{\footskip}{25pt}
% lfhheader
\fancypagestyle{lfhheader}{%
\fancyhf{}
\fancyhead[L]{%
\textbf{\fontsize{10}{12}\selectfont \lfh@headerone}\\
\textbf{\fontsize{10}{12}\selectfont \lfh@headertwo}\\
\fontsize{10}{12}\selectfont \lfh@headerthree
}
\fancyhead[R]{\lfh@includeLogo}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}
}
% lfhplain
\fancypagestyle{lfhplain}{%
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
% lfhpage
\fancypagestyle{lfhpage}{%
\fancyhf{}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
%maketitle
\newcommand*{\makelfhtitle}{%
\newgeometry{left=3cm,right=2cm,top=3cm,bottom=1cm}
\begin{titlepage}
\iflfh@plaintitle
\thispagestyle{lfhplain} % <- Plain ohne Header
\else
\thispagestyle{lfhheader} % <- Standard mit Header
\fi
\vspace{2cm}
\begin{flushleft}
\lfh@ifgerman{%
\fontsize{11.5}{12}\selectfont Leibniz-Fachhochschule\\[0.5em]
\fontsize{11.5}{12}\selectfont \lfh@program\\[0.5em]
\fontsize{11.5}{12}\selectfont Betreut durch: \lfh@prof
}{
\iflanguage{english}{%
\fontsize{11.5}{12}\selectfont Leibniz-Fachhochschule\\[0.5em]
\fontsize{11.5}{12}\selectfont \lfh@program\\[0.5em]
\fontsize{11.5}{12}\selectfont Supervised by: \lfh@prof
}{}
}
\end{flushleft}
\vspace{2cm}
\begin{center}
\fontsize{11.5}{12}\selectfont \lfh@worktype\\[0.5em]
\if@truetitle
\fontsize{11.5}{12}\selectfont \lfh@module\ \lfh@semester
\else
\lfh@ifgerman{%
\fontsize{11.5}{12}\selectfont im Fach \lfh@module\ im \lfh@semester
}{
\iflanguage{english}{%
\fontsize{11.5}{12}\selectfont in the subject \lfh@module\ in \lfh@semester
}{}
}
\fi
\end{center}
\vspace{1.8cm}
\begin{center}
{\Huge\bfseries \lfh@title}\\
{\Large\bfseries \lfh@subtitle}
\end{center}
\vfill
\begin{flushleft}
\lfh@ifgerman{%
\fontsize{11.5}{12}\selectfont \lfh@author\\[0.8em]
\fontsize{11.5}{12}\selectfont Matrikel.-Nr.: \lfh@studentid\\[0.8em]
\fontsize{11.5}{12}\selectfont E-Mail: \href{mailto:\lfh@email}{\lfh@email}\\[1em]
\fontsize{11.5}{12}\selectfont Abgabedatum: \lfh@submission
}{
\iflanguage{english}{%
\fontsize{11.5}{12}\selectfont \lfh@author\\[0.8em]
\fontsize{11.5}{12}\selectfont matr.-no.: \lfh@studentid\\[0.8em]
\fontsize{11.5}{12}\selectfont e-mail: \href{mailto:\lfh@email}{\lfh@email}\\[1em]
\fontsize{11.5}{12}\selectfont Submission date: \lfh@submission
}{}
}
\end{flushleft}
\end{titlepage}
\restoregeometry
}