% \iffalse meta-comment
%
% Copyright 2025 Michael E. Hammer
%
% 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 Michael E. Hammer.
%
% This file is part of the "fhj-script bundle" and all files in that
% bundle must be distributed together.
%
% \fi
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[2023-11-01]
%<package>\ProvidesPackage{fhjcommon}
%<package>[2025-10-16 v4.2b Common macros for the FHJ bundle]
%
%<*driver>
\documentclass{ltxdoc}
\usepackage{fhjcommon}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\OnlyDescription % We only want the description
\begin{document}
    \DocInput{fhjcommon.dtx}
\end{document}
%</driver>
% \fi
%
% \GetFileInfo{fhjcommon.sty}
% \FHJProgram{DAT}
% 
% \changes{v4.0}{2025/08/03}{Initial package version}
%
% \title{The \textsf{fhjcommon} package\thanks{This document corresponds to 
%       \textsf{fhjcommon}~\fileversion, dated \filedate.}}
% \author{Michael E. Hammer \\ \texttt{michael.hammer@fh-joanneum.at}}
%
% \maketitle
% 
% \begin{abstract}
% Collection of common macros for the FHJ bundle independent of a chosen
% document class.
% \end{abstract}
% 
% \tableofcontents
% 
% \section{Configuration}
% 
% \subsection{Used Packages}
% 
%    \begin{macrocode}
%<*package>
\RequirePackage{xstring}
\RequirePackage{ifthen}
\RequirePackage{calc}
%    \end{macrocode}
% 
% \section{Naming definitions}
% 
% \DescribeMacro{\FHJ}
% One goal of this package is to provide common naming definitions which can and should 
% be used in all documents which are created in the context of \textit{\FHJ}. This 
% includes the naming of the university (\cs{FHJ}), the study programs and their long 
% and short names.
% 
% \subsection{Study program specifics}
%
% \DescribeMacro{\FHJProgram}
% It is assumed that the documents which are generated are created in the context of
% a given study program \textit{\FHJDATLong{}} or \textit{\FHJIMSLong}. To set the 
% study program for the given document us the macro as following:
% 
% \begin{quote}
%   \cs{FHJProgram}\marg{program-stem}
% \end{quote}
% 
% We currently support \texttt{DAT} and \texttt{IMS} for \marg{program-stem}.
% \DescribeMacro{\FHJProgramLong} and \DescribeMacro{\FHJProgramShort}
% After setting the study program you can use macros which refer to \cs{FHJProgramLong} 
% and \cs{FHJProgramShort} to get the long and short name of the study program.
% 
% \DescribeMacro{\FHJDATLong} \DescribeMacro{\FHJDATShort} 
% \DescribeMacro{\FHJIMSLong} \DescribeMacro{\FHJIMSShort}
% For convenience, the macros \cs{FHJDATLong}, \cs{FHJDATShort}, \cs{FHJIMSLong} and
% \cs{FHJIMSShort} are provided as direct shortcuts if you ever need to name a study 
% program or its abbreviation which does not belong to the current document.
%
% \section{Legal declarations}
%
% Further important macros are the legal declarations which are required to be included
% in the master thesis. These declarations ensure compliance with the legal requirements
% of \FHJ. 
% 
% \DescribeMacro{\FHJMakeDeclaration}
% Normally these declarations should be placed on a single page -- therefore we run a 
% \cs{cleardoublepage} before and after the declaration. The macro \cs{FHJDeclaration} 
% is also taking care of the language and will automatically switch to the
% appropriate language based on the current language setting of the document. We 
% currently support \textit{ngerman} and \textit{english} as languages.
% \DescribeMacro{\FHJDeclarationDE} \DescribeMacro{\FHJDeclarationEN}
% The declaration text itself is defined in both German and English and could be typeset 
% with \cs{FHJDeclarationDE} or \cs{FHJDeclarationEN} respectively without any page 
% clearing.
%
% \section{Exercises}
% 
% The class provides a set of macros to define exercises and examples for lectures. To 
% be able to create the header you will need to redefine the following macros.
% 
% \DescribeMacro{\FHJClassAbbr}
% \DescribeMacro{\FHJClassTerm}
% \DescribeMacro{\FHJLecturer}
% To simplify the generation of the header for exercises we provide a set of macros which
% can be redefined to customize the appearance of the header.
%
%    \begin{macrocode}
\newcommand{\FHJClassAbbr}{RUL}
\newcommand{\FHJClassTerm}{WS 2025-26}
\newcommand{\FHJLecturer}{Lisa Musterfrau}
%    \end{macrocode}
% 
% \DescribeMacro{\FHJExHeader}
% The header is actually generated with the macro 
% \cs{FHJExHeader}\marg{exercise number}\marg{topic} which takes two
% arguments: the exercise number and the topic and my look like this using the macro 
% with \verb|\FHJExHeader{1}{\LaTeX}| with above default definitions:\\
% 
% \noindent\framebox[\textwidth]{\begin{minipage}{\textwidth-2\fboxsep-2\fboxrule}
%   \FHJExHeader{1}{\LaTeX}
% \end{minipage}}\\
% 
% \DescribeMacro{\FHJExHeaderScheduled}
% Additionally we defined the macro \linebreak
% \cs{FHJExHeaderScheduled}\marg{exercise number}\marg{topic}\marg{date} which takes an 
% additional argument for the date which would produce the following example:\\
% 
% \noindent\framebox[\textwidth]{\begin{minipage}{\textwidth-2\fboxsep-2\fboxrule}
%   \FHJExHeaderScheduled{1}{\LaTeX}{2025-08-13}
% \end{minipage}}\\
%
% \DescribeMacro{\FHJExExample}
% To generate the examples themselves you may want to use the macro 
% \cs{FHJExExample}\oarg{points}\marg{title} which will generate the following section:\\
% 
% \noindent\framebox[\textwidth]{\begin{minipage}{\textwidth-2\fboxsep-2\fboxrule}
%   \FHJExExample[99]{An amazing challenge!}
% \end{minipage}}\\
%
% The section counter will be incremented automatically and the major number is always
% equal to the exercise number.
%
% \DescribeMacro{\FHJExLLM}
% We have formulated a default statement for exercises on how to treat LLMs (Large 
% Language Models) in the context of the FHJ. This is not an "official" statement from 
% FHJ - it is more a guideline for students and lecturers on how to approach the 
% topic.\\
%
% \noindent\FHJExLLM
%
% \MaybeStop{\PrintChanges}
% 
% \section{Implementation}
% 
%    \begin{macrocode}
\newcommand{\PackageName}{fhjcommon}
\newcommand{\FHJ}{FH JOANNEUM}
\newcommand{\FHJInstitute}{IT+}
\newcommand{\FHJDATLong}{Data Science and Artificial Intelligence}
\newcommand{\FHJDATShort}{DAT}
\newcommand{\FHJIMSLong}{IT and Mobile Security}
\newcommand{\FHJIMSShort}{IMS}
\newcommand{\FHJProgram}[1]{
    \IfStrEqCase{#1}{
      {DAT}{%
        \newcommand{\FHJProgramLong}{\FHJDATLong}
        \newcommand{\FHJProgramShort}{\FHJDATShort}
      }{IMS}{%
        \newcommand{\FHJProgramLong}{\FHJIMSLong}
        \newcommand{\FHJProgramShort}{\FHJIMSShort}
      }{ITP}{%
        \newcommand{\FHJProgramLong}{Institute for Information Technology+}
        \newcommand{\FHJProgramShort}{\FHJInstitute}
      }
    }[\PackageError{\PackageName}{Unknown study program option: #1}{}]
}
\newcommand{\FHJDeclarationDE}{
\noindent
\underline{\textbf{Eidesstattliche Erklärung:}}\\

Ich erkläre hiermit an Eides statt, 

\begin{itemize}
    \item dass ich die vorliegende Bachelorarbeit/Masterarbeit selbstständig angefertigt
    und die mit ihr verbundenen Tätigkeiten selbst erbracht habe und keine anderen als
    die angegebenen Quellen und Hilfsmittel benutzt habe;
    \item dass ich mich bei der Erstellung der Arbeit an die Richtlinie der FH JOANNEUM
    zur Sicherung Guter Wissenschaftlicher Praxis und zur Vermeidung von Fehlverhalten
    (kurz Richtlinie GWP) gehalten habe;
    \item dass ich alle aus gedruckten oder ungedruckten Werken sowie aus dem Internet
    im Wortlaut oder im wesentlichen Inhalt übernommenen Formulierungen und Konzepte
    gemäß den Regeln für gutes wissenschaftliches Arbeiten (Richtlinie GWP) zitiert und
    durch genaue Quellenangaben gekennzeichnet habe;
    \item dass ich in der Methodendarstellung oder einem Verzeichnis alle verwendeten
    Hilfsmittel (Assistenzsysteme der Künstlichen Intelligenz wie Chatbots [z.B.
    ChatGPT], Übersetzungsapplikationen [z.B. DeepL], Paraphrasierapplikationen [z.B.
    Quill bot]), Bildgeneratorapplikationen [z.B. Dall-E] oder Programmierapplikationen
    [z.B. Github Copilot] deklariert und ihre Verwendung bei den entsprechenden
    Textstellen angegeben habe;
    \item dass die vorliegende Originalarbeit in dieser Form zur Erreichung eines
    akademischen Grades noch keiner anderen Hochschule vorgelegt worden ist.
\end{itemize}

Ich wurde darüber aufgeklärt, dass meine Arbeit auf Plagiate und auf
Drittautor:innenschaft menschlichen (Ghostwriting) oder technischen Ursprungs
(Assistenzsysteme der künstlichen Intelligenz) überprüft werden kann.\\

Ich bin mir darüber im Klaren, dass eine wahrheitswidrige Erklärung rechtliche Folgen
wie eine negative Beurteilung meiner Arbeit, die nachträgliche Aberkennung des dadurch
erlangten Titels und Strafverfolgung nach sich ziehen kann.\\

\vfill
(Unterschrift) \hfill (Ort, Datum)
}
\newcommand{\FHJDeclarationEN}{
\noindent
\underline{\textbf{Declaration of Honour:}}\\

I hereby declare under oath,

\begin{itemize}
    \item that I have independently prepared this Bachelor/Master thesis and have
    performed all associated tasks myself, using no other sources or aids than those
    indicated.
    \item that in preparing the thesis I have adhered to the guidelines of FH JOANNEUM
    for ensuring good scientific practice and for avoiding misconduct during the
    preparation of this work,
    \item that I have properly cited all formulations and concepts taken over from
    printed, unprinted works as well as from the Internet in wording or in the essential
    content in accordance with the rules of Good Scientific Practice (guideline GSP) and
    have marked them by precise references,
    \item that I have declared in the method presentation or an index all aids used
    (artificial intelligence assistance systems such as chatbots [e.g., ChatGPT],
    translation applications [e.g., DeepL], paraphrasing applications [e.g., Quill bot],
    image generator applications [e.g., Dall-E], or programming applications [e.g.,
    Github Copilot]) and indicated their usage at the corresponding text passages.
    \item that this original thesis, in its current form, has not been submitted to any
    other academic institution for the purpose of obtaining an academic degree.
\end{itemize}

I have been informed that my work may be checked for plagiarism and for third-party
authorship of human (ghostwriting) or technical origin (artificial intelligence
assistance systems).\\

I am aware that a false statement may result in legal consequences
such as a negative assessment of my work, the subsequent revocation of any obtained
degree, and legal prosecution.\\

\vfill
(Signature) \hfill (Place, Date)
}
\newcommand{\FHJMakeDeclaration}{
  \cleardoublepage
  \begingroup % to make sure we change parindent only in this group
    \setlength{\parindent}{0pt}
    \iflanguage{ngerman}{\FHJDeclarationDE}{}%
    \iflanguage{english}{\FHJDeclarationEN}{}
  \endgroup
  \cleardoublepage
}

\newcommand{\FHJExampleFigDE}{
\begin{figure}[!ht]
  \centerline{
    \begin{tikzpicture}
       \draw[->] (-pi,0) -- (3.3,0) node[anchor=west] {$x$};
       \draw[->] (0,-1.5) -- (0,1.5) node[anchor=south] {$y$};
       \draw[gray, thick] (-pi,-1) -- (0,-1); \draw[gray, thick] (0,1) -- (pi,1);
       \draw[thick,color=BrickRed] plot[domain=-pi:pi, samples=629] (\x, {(4/pi)*sin(180*\x/pi)});
       \draw[thick,color=Purple] plot[domain=-pi:pi, samples=629] (\x, {(4/pi)*(sin(180*\x/pi)+(1/3)*sin(180*3*\x/pi))});
       \draw[thick,color=NavyBlue] plot[domain=-pi:pi, samples=629] (\x, {(4/pi)*(sin(180*\x/pi)+(1/3)*sin(180*3*\x/pi))+(1/5)*sin(180*5*\x/pi))});
       \draw[<-, BrickRed] (pi/2, 1.35) -- +(0, .2) node[anchor=south]{\color{BrickRed}1.};
       \draw[<-, Purple] (3*pi/4, 1.25) -- +(0, .3) node[anchor=south]{\color{Purple}2.};
       \draw[<-, NavyBlue] (7*pi/8, 1.25) -- +(0, .3) node[anchor=south]{\color{NavyBlue}3.};
    \end{tikzpicture}
  } \medskip
  \caption{{\color{BrickRed}Erste}, {\color{Purple}zweite} and {\color{NavyBlue}dritte} 
  Fourier-Näherungen einer Rechtecksschwingung als Beispiel für eine Grafik\label{fig:tikz_fn}}
\end{figure}
}
\newcommand{\FHJExampleFigEN}{
\begin{figure}[!ht]
  \centerline{
    \begin{tikzpicture}
       \draw[->] (-pi,0) -- (3.3,0) node[anchor=west] {$x$};
       \draw[->] (0,-1.5) -- (0,1.5) node[anchor=south] {$y$};
       \draw[gray, thick] (-pi,-1) -- (0,-1); \draw[gray, thick] (0,1) -- (pi,1);
       \draw[thick, BrickRed] plot[domain=-pi:pi, samples=629] (\x, {(4/pi)*sin(180*\x/pi)});
       \draw[thick, Purple] plot[domain=-pi:pi, samples=629] (\x, {(4/pi)*(sin(180*\x/pi)+(1/3)*sin(180*3*\x/pi))});
       \draw[thick, NavyBlue] plot[domain=-pi:pi, samples=629] (\x, {(4/pi)*(sin(180*\x/pi)+(1/3)*sin(180*3*\x/pi))+(1/5)*sin(180*5*\x/pi))});
       \draw[<-, BrickRed] (pi/2, 1.35) -- +(0, .2) node[anchor=south]{\color{BrickRed}1.};
       \draw[<-, Purple] (3*pi/4, 1.25) -- +(0, .3) node[anchor=south]{\color{Purple}2.};
       \draw[<-, NavyBlue] (7*pi/8, 1.25) -- +(0, .3) node[anchor=south]{\color{NavyBlue}3.};
    \end{tikzpicture}
  } \medskip
  \caption{{\color{BrickRed}First}, {\color{Purple}second} and {\color{NavyBlue}third} nontrivial Fourier
    approximation of a square wave as an example for function plotting\label{fig:tikz_fn}}
\end{figure}
}
\newcommand{\FHJExampleTabDE}{
  \begin{table}[!ht]
    \centerline{
      \begin{tabular}{ll}
        \textbf{Zahl} & \textbf{Symbol/Wert} \\
        neutrales Element der Addition & $0$ \\
        neutrales Element der Multiplication & $1$ \\
        Euler'sche Zahl & $\mathrm e = 2.71828\,18284\,\ldots$ \\
        Verhältnis von Kreisumfang zu Durchmesser & $\pi = 3.14159\,26535\,\ldots$ \\
        imaginäre Einheit & $\mathrm i$ \hspace{5mm}with\hspace{5mm}$\mathrm i^2=-1$
      \end{tabular}
    }
    \caption{Einige bemerkenswerte Zahlen\label{tab:numbers}}
  \end{table}
}
\newcommand{\FHJExampleTabEN}{
  \begin{table}[!ht]
    \medskip
    \centerline{\begin{tabular}{ll}
      \textbf{number} & \textbf{symbol/value} \\
      neutral element of addition & $0$ \\
      neutral element of multiplication & $1$ \\
      Euler's number, related to growth & $\mathrm e = 2.71828\,18284\,\ldots$ \\
      ratio of circumference to diameter & $\pi = 3.14159\,26535\,\ldots$ \\
      imaginary unit & $\mathrm i$ \hspace{5mm}with\hspace{5mm}$\mathrm i^2=-1$
    \end{tabular}}
    \caption{Some notable numbers\label{tab:numbers}}
  \end{table}
}
%% You normally should not need to edit below macros
\newcounter{exampleCounter}
\newcounter{exerciseCounter}

\newcommand{\FHJExHeader}[2]{%
    \setcounter{exerciseCounter}{#1}
    \setcounter{exampleCounter}{0}
    \begin{center}
        \parbox[t]{10cm}{{\FHJClassAbbr} (\FHJProgramLong) \\ FH JOANNEUM}
        \hfill 
        \parbox[t]{4cm}{\normalsize\raggedleft\FHJLecturer}\\[5mm]
        \textbf{\large
        Exercise \theexerciseCounter: #2 \hfill \parbox[t]{4cm}{\normalsize\raggedleft\FHJClassTerm}}\\[-3mm] 
        \hrulefill \\
    \end{center}
}

\newcommand{\FHJExHeaderScheduled}[3]{
    \FHJExHeader{#1}{#2}
    \iflanguage{english}{%
        \textbf{Exercise \theexerciseCounter} (#2) to be solved till #3\\
        \textbf{Remark:} The Exercises have to be handed in on Moodle on the target day until 23:59.
    }{}
    \iflanguage{ngerman}{%
        \textbf{Übungsblatt \theexerciseCounter} (#2) zu lösen bis #3\\
        \textbf{Hinweis:} Die Aufgaben sind am Abgabetag bis spätestens 23:59 auf Moodle abzugeben.
    }{}\par
    \vspace{1em}
}


%% Optional first argument - Points to be assigned for this exercise
\newcommand{\FHJExExample}[2][]{
    \refstepcounter{exampleCounter}
    \ifthenelse{\equal{#1}{}}{%
        \iflanguage{english}{%
            \subsection*{Example \theexerciseCounter.\theexampleCounter: #2}}{}
        \iflanguage{ngerman}{%
            \subsection*{Aufgbae \theexerciseCounter.\theexampleCounter: #2}}{}
    }{%
        \iflanguage{english}{%
            \subsection*{Example \theexerciseCounter.\theexampleCounter: #2 (#1 Points)}}{}
        \iflanguage{ngerman}{%
            \subsection*{Aufgabe \theexerciseCounter.\theexampleCounter: #2 (#1 Points)}}{}
    }
}

\newcommand{\FHJExLLM}{\framebox[\textwidth]{%
    \begin{minipage}{\textwidth-2\fboxsep-2\fboxrule}
        \iflanguage{english}{%
            \textbf{Usage of LLMs:} You are permitted to use LLMs (e.g., CoPilot,
        ChatGPT, aso.) to support your work on the exercises. Please note, however, that
        the use of LLMs is not allowed during assessments. Ensure that you thoroughly
        understand your solutions and can reproduce them independently without
        assistance from LLMs.}{} \iflanguage{ngerman}{%
            \textbf{Einsatz von LLMs:} Sie dürfen LLMs (z.B. CoPilot, ChatGPT, usw.) zur
        Unterstützung bei der Lösung der Aufgaben verwenden. Beachten Sie jedoch, dass
        Sie während der Wissensüberprüfung keine LLMs verwenden dürfen. Daher sollten
        Sie in der Lage sein, Ihre Lösungen vollständig zu verstehen und sie ohne LLMs
        reproduzieren zu können.}{} \end{minipage}} }
%</package>
%    \end{macrocode}
% 
% \Finale
% 
\endinput
