Debian Codegraph @

texmf-dist/source/latex/fhj-script/fhjcommon.dtx

raw
1 % \iffalse meta-comment
2 %
3 % Copyright 2025 Michael E. Hammer
4 %
5 % This work may be distributed and/or modified under the
6 % conditions of the LaTeX Project Public License, either version 1.3
7 % of this license or (at your option) any later version.
8 % The latest version of this license is in
9 % http://www.latex-project.org/lppl.txt
10 % and version 1.3 or later is part of all distributions of LaTeX
11 % version 2005/12/01 or later.
12 %
13 % This work has the LPPL maintenance status `maintained'.
14 %
15 % The Current Maintainer of this work is Michael E. Hammer.
16 %
17 % This file is part of the "fhj-script bundle" and all files in that
18 % bundle must be distributed together.
19 %
20 % \fi
21 % \iffalse
22 %<package>\NeedsTeXFormat{LaTeX2e}[2023-11-01]
23 %<package>\ProvidesPackage{fhjcommon}
24 %<package>[2026-02-25 v4.2c Common macros for the FHJ bundle]
25 %
26 %<*driver>
27 \documentclass{ltxdoc}
28 \usepackage{fhjcommon}
29 \EnableCrossrefs
30 \CodelineIndex
31 \RecordChanges
32 \OnlyDescription % We only want the description
33 \begin{document}
34 \DocInput{fhjcommon.dtx}
35 \end{document}
36 %</driver>
37 % \fi
38 %
39 % \GetFileInfo{fhjcommon.sty}
40 % \FHJProgram{DAT}
41 %
42 % \changes{v4.0}{2025/08/03}{Initial package version}
43 %
44 % \title{The \textsf{fhjcommon} package\thanks{This document corresponds to
45 % \textsf{fhjcommon}~\fileversion, dated \filedate.}}
46 % \author{Michael E. Hammer \\ \texttt{[email protected]}}
47 %
48 % \maketitle
49 %
50 % \begin{abstract}
51 % Collection of common macros for the FHJ bundle independent of a chosen
52 % document class.
53 % \end{abstract}
54 %
55 % \tableofcontents
56 %
57 % \section{Configuration}
58 %
59 % \subsection{Used Packages}
60 %
61 % \begin{macrocode}
62 %<*package>
63 \RequirePackage{xstring}
64 \RequirePackage{ifthen}
65 \RequirePackage{calc}
66 % \end{macrocode}
67 %
68 % \section{Naming definitions}
69 %
70 % \DescribeMacro{\FHJ}
71 % One goal of this package is to provide common naming definitions which can and should
72 % be used in all documents which are created in the context of \textit{\FHJ}. This
73 % includes the naming of the university (\cs{FHJ}), the study programs and their long
74 % and short names.
75 %
76 % \subsection{Study program specifics}
77 %
78 % \DescribeMacro{\FHJProgram}
79 % It is assumed that the documents which are generated are created in the context of
80 % a given study program \textit{\FHJDATLong{}} or \textit{\FHJIMSLong}. To set the
81 % study program for the given document us the macro as following:
82 %
83 % \begin{quote}
84 % \cs{FHJProgram}\marg{program-stem}
85 % \end{quote}
86 %
87 % We currently support \texttt{DAT} and \texttt{IMS} for \marg{program-stem}.
88 % \DescribeMacro{\FHJProgramLong} and \DescribeMacro{\FHJProgramShort}
89 % After setting the study program you can use macros which refer to \cs{FHJProgramLong}
90 % and \cs{FHJProgramShort} to get the long and short name of the study program.
91 %
92 % \DescribeMacro{\FHJDATLong} \DescribeMacro{\FHJDATShort}
93 % \DescribeMacro{\FHJIMSLong} \DescribeMacro{\FHJIMSShort}
94 % For convenience, the macros \cs{FHJDATLong}, \cs{FHJDATShort}, \cs{FHJIMSLong} and
95 % \cs{FHJIMSShort} are provided as direct shortcuts if you ever need to name a study
96 % program or its abbreviation which does not belong to the current document.
97 %
98 % \section{Legal declarations}
99 %
100 % Further important macros are the legal declarations which are required to be included
101 % in the master thesis. These declarations ensure compliance with the legal requirements
102 % of \FHJ.
103 %
104 % \DescribeMacro{\FHJMakeDeclaration}
105 % Normally these declarations should be placed on a single page -- therefore we run a
106 % \cs{cleardoublepage} before and after the declaration. The macro \cs{FHJDeclaration}
107 % is also taking care of the language and will automatically switch to the
108 % appropriate language based on the current language setting of the document. We
109 % currently support \textit{ngerman} and \textit{english} as languages.
110 % \DescribeMacro{\FHJDeclarationDE} \DescribeMacro{\FHJDeclarationEN}
111 % The declaration text itself is defined in both German and English and could be typeset
112 % with \cs{FHJDeclarationDE} or \cs{FHJDeclarationEN} respectively without any page
113 % clearing.
114 %
115 % \section{Exercises}
116 %
117 % The class provides a set of macros to define exercises and examples for lectures. To
118 % be able to create the header you will need to redefine the following macros.
119 %
120 % \DescribeMacro{\FHJClassAbbr}
121 % \DescribeMacro{\FHJClassTerm}
122 % \DescribeMacro{\FHJLecturer}
123 % To simplify the generation of the header for exercises we provide a set of macros which
124 % can be redefined to customize the appearance of the header.
125 %
126 % \begin{macrocode}
127 \newcommand{\FHJClassAbbr}{RUL}
128 \newcommand{\FHJClassTerm}{WS 2025-26}
129 \newcommand{\FHJLecturer}{Lisa Musterfrau}
130 % \end{macrocode}
131 %
132 % \DescribeMacro{\FHJExHeader}
133 % The header is actually generated with the macro
134 % \cs{FHJExHeader}\marg{type}\marg{number}\marg{topic} which takes two
135 % arguments: the type of the exercise (like ``Exam'', ``Exercise'' or similar),
136 % exercise number and the topic and my look like this using the macro
137 % with \verb|\FHJExHeader{Exercise}{1}{\LaTeX}| with above default definitions:\\
138 %
139 % \noindent\framebox[\textwidth]{\begin{minipage}{\textwidth-2\fboxsep-2\fboxrule}
140 % \FHJExHeader{Exercise}{1}{\LaTeX}
141 % \end{minipage}}\\
142 %
143 % \DescribeMacro{\FHJExHeaderScheduled}
144 % Additionally we defined the macro \linebreak
145 % \cs{FHJExHeaderScheduled}\marg{exercise number}\marg{topic}\marg{date} which takes an
146 % additional argument for the date which would produce the following example:\\
147 %
148 % \noindent\framebox[\textwidth]{\begin{minipage}{\textwidth-2\fboxsep-2\fboxrule}
149 % \FHJExHeaderScheduled{Exercise}{1}{\LaTeX}{2025-08-13}
150 % \end{minipage}}\\
151 %
152 % \DescribeMacro{\FHJExExample}
153 % To generate the examples themselves you may want to use the macro
154 % \cs{FHJExExample}\oarg{points}\marg{title} which will generate the following section:\\
155 %
156 % \noindent\framebox[\textwidth]{\begin{minipage}{\textwidth-2\fboxsep-2\fboxrule}
157 % \FHJExExample[99]{An amazing challenge!}
158 % \end{minipage}}\\
159 %
160 % The section counter will be incremented automatically and the major number is always
161 % equal to the exercise number.
162 %
163 % \DescribeMacro{\FHJExLLM}
164 % We have formulated a default statement for exercises on how to treat LLMs (Large
165 % Language Models) in the context of the FHJ. This is not an "official" statement from
166 % FHJ - it is more a guideline for students and lecturers on how to approach the
167 % topic.\\
168 %
169 % \noindent\FHJExLLM
170 %
171 % \MaybeStop{\PrintChanges}
172 %
173 % \section{Implementation}
174 %
175 % \begin{macrocode}
176 \newcommand{\PackageName}{fhjcommon}
177 \newcommand{\FHJ}{FH JOANNEUM}
178 \newcommand{\FHJInstitute}{IT+}
179 \newcommand{\FHJDATLong}{Data Science and Artificial Intelligence}
180 \newcommand{\FHJDATShort}{DAT}
181 \newcommand{\FHJIMSLong}{IT and Mobile Security}
182 \newcommand{\FHJIMSShort}{IMS}
183 \newcommand{\FHJProgram}[1]{
184 \IfStrEqCase{#1}{
185 {DAT}{%
186 \newcommand{\FHJProgramLong}{\FHJDATLong}
187 \newcommand{\FHJProgramShort}{\FHJDATShort}
188 }{IMS}{%
189 \newcommand{\FHJProgramLong}{\FHJIMSLong}
190 \newcommand{\FHJProgramShort}{\FHJIMSShort}
191 }{ITP}{%
192 \newcommand{\FHJProgramLong}{Institute for Information Technology+}
193 \newcommand{\FHJProgramShort}{\FHJInstitute}
194 }
195 }[\PackageError{\PackageName}{Unknown study program option: #1}{}]
196 }
197 \newcommand{\FHJDeclarationDE}{
198 \noindent
199 \underline{\textbf{Eidesstattliche Erklärung:}}\\
200
201 Ich erkläre hiermit an Eides statt,
202
203 \begin{itemize}
204 \item dass ich die vorliegende Bachelorarbeit/Masterarbeit selbstständig angefertigt
205 und die mit ihr verbundenen Tätigkeiten selbst erbracht habe und keine anderen als
206 die angegebenen Quellen und Hilfsmittel benutzt habe;
207 \item dass ich mich bei der Erstellung der Arbeit an die Richtlinie der FH JOANNEUM
208 zur Sicherung Guter Wissenschaftlicher Praxis und zur Vermeidung von Fehlverhalten
209 (kurz Richtlinie GWP) gehalten habe;
210 \item dass ich alle aus gedruckten oder ungedruckten Werken sowie aus dem Internet
211 im Wortlaut oder im wesentlichen Inhalt übernommenen Formulierungen und Konzepte
212 gemäß den Regeln für gutes wissenschaftliches Arbeiten (Richtlinie GWP) zitiert und
213 durch genaue Quellenangaben gekennzeichnet habe;
214 \item dass ich in der Methodendarstellung oder einem Verzeichnis alle verwendeten
215 Hilfsmittel (Assistenzsysteme der Künstlichen Intelligenz wie Chatbots [z.B.
216 ChatGPT], Übersetzungsapplikationen [z.B. DeepL], Paraphrasierapplikationen [z.B.
217 Quill bot]), Bildgeneratorapplikationen [z.B. Dall-E] oder Programmierapplikationen
218 [z.B. Github Copilot] deklariert und ihre Verwendung bei den entsprechenden
219 Textstellen angegeben habe;
220 \item dass die vorliegende Originalarbeit in dieser Form zur Erreichung eines
221 akademischen Grades noch keiner anderen Hochschule vorgelegt worden ist.
222 \end{itemize}
223
224 Ich wurde darüber aufgeklärt, dass meine Arbeit auf Plagiate und auf
225 Drittautor:innenschaft menschlichen (Ghostwriting) oder technischen Ursprungs
226 (Assistenzsysteme der künstlichen Intelligenz) überprüft werden kann.\\
227
228 Ich bin mir darüber im Klaren, dass eine wahrheitswidrige Erklärung rechtliche Folgen
229 wie eine negative Beurteilung meiner Arbeit, die nachträgliche Aberkennung des dadurch
230 erlangten Titels und Strafverfolgung nach sich ziehen kann.\\
231
232 \vfill
233 (Unterschrift) \hfill (Ort, Datum)
234 }
235 \newcommand{\FHJDeclarationEN}{
236 \noindent
237 \underline{\textbf{Declaration of Honour:}}\\
238
239 I hereby declare under oath,
240
241 \begin{itemize}
242 \item that I have independently prepared this Bachelor/Master thesis and have
243 performed all associated tasks myself, using no other sources or aids than those
244 indicated.
245 \item that in preparing the thesis I have adhered to the guidelines of FH JOANNEUM
246 for ensuring good scientific practice and for avoiding misconduct during the
247 preparation of this work,
248 \item that I have properly cited all formulations and concepts taken over from
249 printed, unprinted works as well as from the Internet in wording or in the essential
250 content in accordance with the rules of Good Scientific Practice (guideline GSP) and
251 have marked them by precise references,
252 \item that I have declared in the method presentation or an index all aids used
253 (artificial intelligence assistance systems such as chatbots [e.g., ChatGPT],
254 translation applications [e.g., DeepL], paraphrasing applications [e.g., Quill bot],
255 image generator applications [e.g., Dall-E], or programming applications [e.g.,
256 Github Copilot]) and indicated their usage at the corresponding text passages.
257 \item that this original thesis, in its current form, has not been submitted to any
258 other academic institution for the purpose of obtaining an academic degree.
259 \end{itemize}
260
261 I have been informed that my work may be checked for plagiarism and for third-party
262 authorship of human (ghostwriting) or technical origin (artificial intelligence
263 assistance systems).\\
264
265 I am aware that a false statement may result in legal consequences
266 such as a negative assessment of my work, the subsequent revocation of any obtained
267 degree, and legal prosecution.\\
268
269 \vfill
270 (Signature) \hfill (Place, Date)
271 }
272 \newcommand{\FHJMakeDeclaration}{
273 \cleardoublepage
274 \begingroup % to make sure we change parindent only in this group
275 \setlength{\parindent}{0pt}
276 \iflanguage{ngerman}{\FHJDeclarationDE}{}%
277 \iflanguage{english}{\FHJDeclarationEN}{}
278 \endgroup
279 \cleardoublepage
280 }
281
282 \newcommand{\FHJExampleFigDE}{
283 \begin{figure}[!ht]
284 \centerline{
285 \begin{tikzpicture}
286 \draw[->] (-pi,0) -- (3.3,0) node[anchor=west] {$x$};
287 \draw[->] (0,-1.5) -- (0,1.5) node[anchor=south] {$y$};
288 \draw[gray, thick] (-pi,-1) -- (0,-1); \draw[gray, thick] (0,1) -- (pi,1);
289 \draw[thick,color=BrickRed] plot[domain=-pi:pi, samples=629] (\x, {(4/pi)*sin(180*\x/pi)});
290 \draw[thick,color=Purple] plot[domain=-pi:pi, samples=629] (\x, {(4/pi)*(sin(180*\x/pi)+(1/3)*sin(180*3*\x/pi))});
291 \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))});
292 \draw[<-, BrickRed] (pi/2, 1.35) -- +(0, .2) node[anchor=south]{\color{BrickRed}1.};
293 \draw[<-, Purple] (3*pi/4, 1.25) -- +(0, .3) node[anchor=south]{\color{Purple}2.};
294 \draw[<-, NavyBlue] (7*pi/8, 1.25) -- +(0, .3) node[anchor=south]{\color{NavyBlue}3.};
295 \end{tikzpicture}
296 } \medskip
297 \caption{{\color{BrickRed}Erste}, {\color{Purple}zweite} and {\color{NavyBlue}dritte}
298 Fourier-Näherungen einer Rechtecksschwingung als Beispiel für eine Grafik\label{fig:tikz_fn}}
299 \end{figure}
300 }
301 \newcommand{\FHJExampleFigEN}{
302 \begin{figure}[!ht]
303 \centerline{
304 \begin{tikzpicture}
305 \draw[->] (-pi,0) -- (3.3,0) node[anchor=west] {$x$};
306 \draw[->] (0,-1.5) -- (0,1.5) node[anchor=south] {$y$};
307 \draw[gray, thick] (-pi,-1) -- (0,-1); \draw[gray, thick] (0,1) -- (pi,1);
308 \draw[thick, BrickRed] plot[domain=-pi:pi, samples=629] (\x, {(4/pi)*sin(180*\x/pi)});
309 \draw[thick, Purple] plot[domain=-pi:pi, samples=629] (\x, {(4/pi)*(sin(180*\x/pi)+(1/3)*sin(180*3*\x/pi))});
310 \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))});
311 \draw[<-, BrickRed] (pi/2, 1.35) -- +(0, .2) node[anchor=south]{\color{BrickRed}1.};
312 \draw[<-, Purple] (3*pi/4, 1.25) -- +(0, .3) node[anchor=south]{\color{Purple}2.};
313 \draw[<-, NavyBlue] (7*pi/8, 1.25) -- +(0, .3) node[anchor=south]{\color{NavyBlue}3.};
314 \end{tikzpicture}
315 } \medskip
316 \caption{{\color{BrickRed}First}, {\color{Purple}second} and {\color{NavyBlue}third} nontrivial Fourier
317 approximation of a square wave as an example for function plotting\label{fig:tikz_fn}}
318 \end{figure}
319 }
320 \newcommand{\FHJExampleTabDE}{
321 \begin{table}[!ht]
322 \centerline{
323 \begin{tabular}{ll}
324 \textbf{Zahl} & \textbf{Symbol/Wert} \\
325 neutrales Element der Addition & $0$ \\
326 neutrales Element der Multiplication & $1$ \\
327 Euler'sche Zahl & $\mathrm e = 2.71828\,18284\,\ldots$ \\
328 Verhältnis von Kreisumfang zu Durchmesser & $\pi = 3.14159\,26535\,\ldots$ \\
329 imaginäre Einheit & $\mathrm i$ \hspace{5mm}with\hspace{5mm}$\mathrm i^2=-1$
330 \end{tabular}
331 }
332 \caption{Einige bemerkenswerte Zahlen\label{tab:numbers}}
333 \end{table}
334 }
335 \newcommand{\FHJExampleTabEN}{
336 \begin{table}[!ht]
337 \medskip
338 \centerline{\begin{tabular}{ll}
339 \textbf{number} & \textbf{symbol/value} \\
340 neutral element of addition & $0$ \\
341 neutral element of multiplication & $1$ \\
342 Euler's number, related to growth & $\mathrm e = 2.71828\,18284\,\ldots$ \\
343 ratio of circumference to diameter & $\pi = 3.14159\,26535\,\ldots$ \\
344 imaginary unit & $\mathrm i$ \hspace{5mm}with\hspace{5mm}$\mathrm i^2=-1$
345 \end{tabular}}
346 \caption{Some notable numbers\label{tab:numbers}}
347 \end{table}
348 }
349 %% You normally should not need to edit below macros
350 \newcounter{exampleCounter}
351 \newcounter{exerciseCounter}
352
353 \newcommand{\FHJExHeader}[3]{%
354 \setcounter{exerciseCounter}{#2}
355 \setcounter{exampleCounter}{0}
356 \begin{center}
357 \parbox[t]{10cm}{{\FHJClassAbbr} (\FHJProgramLong) \\ FH JOANNEUM}
358 \hfill
359 \parbox[t]{4cm}{\normalsize\raggedleft\FHJLecturer}\\[5mm]
360 \textbf{\large
361 #1 \theexerciseCounter: #3 \hfill \parbox[t]{4cm}{\normalsize\raggedleft\FHJClassTerm}}\\[-3mm]
362 \hrulefill \\
363 \end{center}
364 }
365
366 \newcommand{\FHJExHeaderScheduled}[4]{
367 \FHJExHeader{#1}{#2}{#3}
368 \iflanguage{english}{%
369 \textbf{#1 \theexerciseCounter} (#3) to be solved till #4\\
370 \textbf{Remark:} The Exercises have to be handed in on Moodle on the target day until 23:59.
371 }{}
372 \iflanguage{ngerman}{%
373 \textbf{#1 \theexerciseCounter} (#3) zu lösen bis #4\\
374 \textbf{Hinweis:} Die Aufgaben sind am Abgabetag bis spätestens 23:59 auf Moodle abzugeben.
375 }{}\par
376 \vspace{1em}
377 }
378
379
380 %% Optional first argument - Points to be assigned for this exercise
381 \newcommand{\FHJExExample}[2][]{
382 \refstepcounter{exampleCounter}
383 \ifthenelse{\equal{#1}{}}{%
384 \iflanguage{english}{%
385 \subsection*{Example \theexerciseCounter.\theexampleCounter: #2}}{}
386 \iflanguage{ngerman}{%
387 \subsection*{Aufgbae \theexerciseCounter.\theexampleCounter: #2}}{}
388 }{%
389 \iflanguage{english}{%
390 \subsection*{Example \theexerciseCounter.\theexampleCounter: #2 (#1 Points)}}{}
391 \iflanguage{ngerman}{%
392 \subsection*{Aufgabe \theexerciseCounter.\theexampleCounter: #2 (#1 Points)}}{}
393 }
394 }
395
396 \newcommand{\FHJExLLM}{\framebox[\textwidth]{%
397 \begin{minipage}{\textwidth-2\fboxsep-2\fboxrule}
398 \iflanguage{english}{%
399 \textbf{Usage of LLMs:} You are permitted to use LLMs (e.g., CoPilot,
400 ChatGPT, aso.) to support your work on the exercises. Please note, however, that
401 the use of LLMs is not allowed during assessments. Ensure that you thoroughly
402 understand your solutions and can reproduce them independently without
403 assistance from LLMs.}{} \iflanguage{ngerman}{%
404 \textbf{Einsatz von LLMs:} Sie dürfen LLMs (z.B. CoPilot, ChatGPT, usw.) zur
405 Unterstützung bei der Lösung der Aufgaben verwenden. Beachten Sie jedoch, dass
406 Sie während der Wissensüberprüfung keine LLMs verwenden dürfen. Daher sollten
407 Sie in der Lage sein, Ihre Lösungen vollständig zu verstehen und sie ohne LLMs
408 reproduzieren zu können.}{} \end{minipage}} }
409 %</package>
410 % \end{macrocode}
411 %
412 % \Finale
413 %
414 \endinput