feat: Chapter management

This commit is contained in:
Frederik Beimgraben 2025-10-30 00:44:24 +01:00
parent 861d965825
commit 489d12460b
17 changed files with 3136 additions and 745 deletions

View File

@ -1,6 +1,21 @@
% !TEX root = ../Main.tex
% ==============================================================================
% Table of Contents and Lists
% ==============================================================================
% Description: This file generates the table of contents and all document lists
% including figures, tables, equations, listings, and glossaries.
% The formatting uses the blenderfont style for consistency.
% Author: [Your Name]
% Date: [Date]
% ==============================================================================
% ==== TOC =====
% ------------------------------------------------------------------------------
% Table of Contents
% ------------------------------------------------------------------------------
% Generate the main table of contents with custom formatting
% The blenderfont provides a consistent typographic style
% Vertical spacing is adjusted for optimal layout
% ------------------------------------------------------------------------------
{
\newpage
\blenderfont
@ -8,9 +23,15 @@
\tableofcontents
}
% Add vertical fill to push subsequent content down
\vspace{\fill}
% ==== List of Figures ====
% ------------------------------------------------------------------------------
% List of Figures
% ------------------------------------------------------------------------------
% Generate list of all figures in the document
% Figures are automatically numbered and referenced
% ------------------------------------------------------------------------------
\newpage
{
\noindent
@ -19,30 +40,66 @@
\listoffigures
}
% ==== List of Tables ====
% ------------------------------------------------------------------------------
% List of Tables
% ------------------------------------------------------------------------------
% Generate list of all tables in the document
% Tables are automatically numbered and referenced
% ------------------------------------------------------------------------------
{
\noindent
\blenderfont
\listoftables
}
% ==== List of Equations ====
% ------------------------------------------------------------------------------
% List of Listings
% ------------------------------------------------------------------------------
% Generate list of all code listings in the document
% Code listings are automatically numbered and referenced
% This includes all lstlisting environments with captions
% ------------------------------------------------------------------------------
{
\noindent
\blenderfont
\lstlistoflistings
}
% ------------------------------------------------------------------------------
% List of Equations
% ------------------------------------------------------------------------------
% Generate list of all equations in the document
% Uses custom command \listofmyequations defined in the class
% ------------------------------------------------------------------------------
{
\noindent
\blenderfont
\listofmyequations
}
% ==== Glossary =====
% ------------------------------------------------------------------------------
% Glossary Section
% ------------------------------------------------------------------------------
% Generate glossary and list of acronyms
% Two separate glossaries are printed:
% 1. Main glossary with technical terms
% 2. Acronym list with abbreviations
% ------------------------------------------------------------------------------
{
\noindent
\blenderfont
% --- Main Glossary ---
% Print main glossary with German header "Wort"
{
\renewcommand*{\entryname}{Wort}
\newpage
\vspace*{-2.25em}
\printglossary
}
% --- Acronym List ---
% Print acronym glossary with German header "Abkürzung"
{
\renewcommand*{\entryname}{Abkürzung}
\newpage
@ -50,3 +107,7 @@
\printglossary[type=\acronymtype]
}
}
% ==============================================================================
% End of Table of Contents and Lists
% ==============================================================================

View File

@ -1 +1,73 @@
% !TEX root = ../Main.tex
% ==============================================================================
% Document Content Loader
% ==============================================================================
% Description: This file serves as the main content loader for all chapters.
% Chapters are included via \input commands in the designated area.
% The marked section is automatically managed by chapter scripts.
% Author: [Your Name]
% Date: [Date]
% ==============================================================================
% ------------------------------------------------------------------------------
% TexCount Settings For word count
% ------------------------------------------------------------------------------
%
% Ignore Headings:
%TC:macro \chapter [ignore]
%TC:macro \section [ignore]
%TC:macro \subsection [ignore]
%TC:macro \subsubsection [ignore]
%TC:macro \includesvg [ignore]
%
% Ignore Figures and Tables:
%TC:envir figure [ignore] ignore
%TC:envir table [ignore] ignore
%
% ------------------------------------------------------------------------------
% ------------------------------------------------------------------------------
% Chapter Loading Instructions
% ------------------------------------------------------------------------------
% To add chapters manually:
% 1. Create a new .tex file in Content/Chapters/
% 2. Add \input{Content/Chapters/filename} in the marked area below
%
% To use automatic chapter management:
% - Use ./scripts/create_chapter.sh to create new chapters
% - Use ./scripts/list_chapters.sh to view all chapters
% - Use ./scripts/delete_chapter.sh to remove chapters
%
% The scripts will automatically update this file's chapter list.
% ------------------------------------------------------------------------------
% ==============================================================================
% BEGIN CHAPTER INCLUDES (Auto-managed Section)
% ==============================================================================
% WARNING: Do not manually edit between the BEGIN and END markers if using
% the chapter management scripts. Manual edits will be preserved,
% but may interfere with automatic management.
% ==============================================================================
% --- CHAPTER LIST START --- (Do not remove this marker)
% --- CHAPTER LIST END --- (Do not remove this marker)
% ==============================================================================
% END CHAPTER INCLUDES
% ==============================================================================
% ------------------------------------------------------------------------------
% Additional Content (Optional)
% ------------------------------------------------------------------------------
% Any content that should appear after all chapters but before the bibliography
% can be added here. For example, appendices or supplementary material.
% ------------------------------------------------------------------------------
% Uncomment to add appendices:
% \appendix
% \input{Content/Chapters/appendix_a}
% \input{Content/Chapters/appendix_b}
% ==============================================================================
% End of Content Loader
% ==============================================================================

View File

@ -1,3 +1,90 @@
% !TEX root = ../Main.tex
\newpage
\printbibliography
% ==============================================================================
% Bibliography and References
% ==============================================================================
% Description: This file handles the bibliography generation and formatting.
% It uses BibLaTeX with Biber backend for advanced citation
% management and formatting capabilities.
% Author: [Your Name]
% Date: [Date]
% ==============================================================================
% ------------------------------------------------------------------------------
% Bibliography Chapter
% ------------------------------------------------------------------------------
% Create a new chapter for the bibliography
% This appears in the table of contents as "Literaturverzeichnis"
% ------------------------------------------------------------------------------
\chapter{Literaturverzeichnis}
\label{chap:bibliography}
% ------------------------------------------------------------------------------
% Bibliography Generation
% ------------------------------------------------------------------------------
% Print the bibliography using BibLaTeX
% The bibliography style and sorting are configured in the document class
% All entries from Main.bib that are cited in the document will appear here
% ------------------------------------------------------------------------------
\printbibliography[
heading=none, % Suppress automatic heading (we use \chapter above)
title={} % Empty title since we already have the chapter title
]
% ------------------------------------------------------------------------------
% Bibliography Notes
% ------------------------------------------------------------------------------
% The bibliography is automatically formatted according to the citation style
% configured in the HSRTReport class. Common citation commands include:
%
% \cite{key} - Standard citation
% \textcite{key} - Author name in text with year in parentheses
% \parencite{key} - Full citation in parentheses
% \footcite{key} - Citation in footnote
% \citeauthor{key} - Only author name
% \citeyear{key} - Only year
% \citep{key} - Compatibility alias for \parencite
% \citet{key} - Compatibility alias for \textcite
%
% Multiple citations: \cite{key1,key2,key3}
% Page references: \cite[p.~15]{key}
% Chapter references: \cite[Chapter~3]{key}
% ------------------------------------------------------------------------------
% ------------------------------------------------------------------------------
% Optional: Separate Bibliography Sections
% ------------------------------------------------------------------------------
% If you need to separate the bibliography into sections (e.g., primary and
% secondary sources), you can use the following approach:
%
% \printbibheading[title={Primary Sources}]
% \printbibliography[
% heading=none,
% keyword=primary
% ]
%
% \printbibheading[title={Secondary Sources}]
% \printbibliography[
% heading=none,
% keyword=secondary
% ]
%
% Note: This requires adding keywords to your .bib entries
% ------------------------------------------------------------------------------
% ------------------------------------------------------------------------------
% Optional: Bibliography by Chapter
% ------------------------------------------------------------------------------
% For longer documents, you might want to include bibliographies at the end
% of each chapter. This can be achieved using:
%
% \printbibliography[
% heading=subbibliography,
% segment=\therefsegment
% ]
%
% This requires additional configuration in the preamble
% ------------------------------------------------------------------------------
% ==============================================================================
% End of Bibliography
% ==============================================================================

View File

@ -0,0 +1,469 @@
% !TEX root = ../../Main.tex
% ==============================================================================
% Example Chapter Template
% ==============================================================================
% Description: This file serves as a template for creating new chapters.
% It demonstrates the proper structure, formatting, and various
% LaTeX elements that can be used in academic documents.
% Usage: Copy this file and rename it for your own chapters.
% Include it in the main document using \input{Content/Chapters/your_chapter}
% Author: [Your Name]
% Date: [Date]
% ==============================================================================
% ------------------------------------------------------------------------------
% Chapter Declaration
% ------------------------------------------------------------------------------
% Start a new chapter with a descriptive title
% The \label command allows for cross-referencing
% ------------------------------------------------------------------------------
\chapter{Example Chapter Title}
\label{chap:example_chapter}
% ------------------------------------------------------------------------------
% Chapter Introduction
% ------------------------------------------------------------------------------
% Begin with an introductory paragraph that outlines the chapter's content
% This helps readers understand what to expect
% ------------------------------------------------------------------------------
This chapter demonstrates the various features and formatting options available
in the HSRTReport template. It serves as a comprehensive guide for creating
well-structured academic content. The following sections will cover different
aspects of document formatting, from basic text elements to complex mathematical
expressions and graphical content.
% ==============================================================================
% Section: Basic Text Formatting
% ==============================================================================
\section{Basic Text Formatting}
\label{sec:basic_formatting}
% ------------------------------------------------------------------------------
% Subsection: Text Styles
% ------------------------------------------------------------------------------
\subsection{Text Styles}
\label{subsec:text_styles}
The template supports various text formatting options:
\begin{itemize}
\item \textbf{Bold text} for emphasis on important terms
\item \textit{Italic text} for foreign words or emphasis
\item \texttt{Monospace text} for code, file names, or commands
\item \underline{Underlined text} for special highlighting
\item \textsc{Small Caps} for acronyms or special names
\item Combined styles: \textbf{\textit{bold and italic}}
\end{itemize}
% ------------------------------------------------------------------------------
% Subsection: Quotations
% ------------------------------------------------------------------------------
\subsection{Quotations and Citations}
\label{subsec:quotations}
For short inline quotes, use regular quotation marks: ``This is a short quote.''
For longer quotations, use the quote environment:
\begin{quote}
``This is a longer quotation that demonstrates how block quotes are formatted
in the template. Block quotes are typically indented from both margins and
may have different spacing. They are ideal for quotations that exceed
three lines of text.'' \cite{example2023}
\end{quote}
% Direct citation with page number
According to \textcite[p.~42]{examplebook2022}, the methodology is sound.
% Multiple citations
Several studies have confirmed these findings \parencite{example2023, conference2023}.
% ==============================================================================
% Section: Lists and Enumerations
% ==============================================================================
\section{Lists and Enumerations}
\label{sec:lists}
% ------------------------------------------------------------------------------
% Subsection: Unordered Lists
% ------------------------------------------------------------------------------
\subsection{Unordered Lists}
\label{subsec:unordered_lists}
Simple bullet points:
\begin{itemize}
\item First main point
\item Second main point
\item Third main point with sub-items:
\begin{itemize}
\item First sub-item
\item Second sub-item
\begin{itemize}
\item Nested sub-sub-item
\item Another nested item
\end{itemize}
\end{itemize}
\item Final main point
\end{itemize}
% ------------------------------------------------------------------------------
% Subsection: Ordered Lists
% ------------------------------------------------------------------------------
\subsection{Ordered Lists}
\label{subsec:ordered_lists}
Numbered lists for sequential items:
\begin{enumerate}
\item First step in the process
\item Second step with sub-steps:
\begin{enumerate}
\item Sub-step 2.1
\item Sub-step 2.2
\end{enumerate}
\item Third step
\item Final step
\end{enumerate}
% ------------------------------------------------------------------------------
% Subsection: Description Lists
% ------------------------------------------------------------------------------
\subsection{Description Lists}
\label{subsec:description_lists}
For term definitions:
\begin{description}
\item[Term One] Definition or description of the first term. This can be
multiple lines long and will be properly formatted.
\item[Term Two] Definition of the second term with emphasis on clarity.
\item[Complex Term] A more detailed explanation that might include
technical details, examples, or references to other concepts.
\end{description}
% ==============================================================================
% Section: Mathematical Content
% ==============================================================================
\section{Mathematical Expressions}
\label{sec:mathematics}
% ------------------------------------------------------------------------------
% Subsection: Inline Mathematics
% ------------------------------------------------------------------------------
\subsection{Inline Mathematics}
\label{subsec:inline_math}
Mathematics can be included inline, such as the quadratic formula
$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$, or the famous Euler's identity
$e^{i\pi} + 1 = 0$.
Common mathematical symbols include:
\begin{itemize}
\item Greek letters: $\alpha$, $\beta$, $\gamma$, $\Delta$, $\Omega$
\item Operations: $\sum_{i=1}^{n}$, $\prod_{j=1}^{m}$, $\int_{a}^{b}$
\item Relations: $\leq$, $\geq$, $\approx$, $\equiv$, $\propto$
\item Sets: $\mathbb{R}$, $\mathbb{N}$, $\mathbb{C}$, $\emptyset$
\end{itemize}
% ------------------------------------------------------------------------------
% Subsection: Display Mathematics
% ------------------------------------------------------------------------------
\subsection{Display Mathematics}
\label{subsec:display_math}
For important equations, use the equation environment:
\begin{equation}
\nabla \times \vec{B} - \frac{1}{c^2}\frac{\partial \vec{E}}{\partial t}
= \mu_0 \vec{J}
\label{eq:maxwell}
\end{equation}
Equation \eqref{eq:maxwell} represents one of Maxwell's equations.
Multi-line equations with alignment:
\begin{align}
f(x) & = x^2 + 2x + 1 \label{eq:function} \\
& = (x + 1)^2 \label{eq:factored}
\end{align}
Matrix example:
\begin{equation}
\mathbf{A} = \begin{bmatrix}
a_{11} & a_{12} & \cdots & a_{1n} \\
a_{21} & a_{22} & \cdots & a_{2n} \\
\vdots & \vdots & \ddots & \vdots \\
a_{m1} & a_{m2} & \cdots & a_{mn}
\end{bmatrix}
\label{eq:matrix}
\end{equation}
% ==============================================================================
% Section: Figures and Graphics
% ==============================================================================
\section{Figures and Graphics}
\label{sec:figures}
% ------------------------------------------------------------------------------
% Subsection: Single Figures
% ------------------------------------------------------------------------------
\subsection{Single Figures}
\label{subsec:single_figures}
\begin{figure}[htbp]
\centering
% Replace the rule with actual image:
% \includegraphics[width=0.6\textwidth]{Content/Images/your_image.png}
\rule{0.6\textwidth}{0.4\textwidth} % Placeholder
\caption[Short caption for list of figures]{Detailed caption explaining the
figure content. This caption can be quite long and should provide
sufficient information for understanding the figure without reading
the main text.}
\label{fig:single_example}
\end{figure}
As shown in Figure~\ref{fig:single_example}, the visualization clearly
demonstrates the concept. Always reference figures in the text.
% ------------------------------------------------------------------------------
% Subsection: Multiple Figures
% ------------------------------------------------------------------------------
\subsection{Side-by-Side Figures}
\label{subsec:multiple_figures}
\begin{figure}[htbp]
\centering
\begin{subfigure}[b]{0.45\textwidth}
\centering
% \includegraphics[width=\textwidth]{Content/Images/image1.png}
\rule{\textwidth}{0.6\textwidth} % Placeholder
\caption{First subfigure}
\label{fig:sub1}
\end{subfigure}
\hfill
\begin{subfigure}[b]{0.45\textwidth}
\centering
% \includegraphics[width=\textwidth]{Content/Images/image2.png}
\rule{\textwidth}{0.6\textwidth} % Placeholder
\caption{Second subfigure}
\label{fig:sub2}
\end{subfigure}
\caption{Comparison of two related concepts: (a) shows the first concept,
while (b) illustrates the second concept.}
\label{fig:comparison}
\end{figure}
% ==============================================================================
% Section: Tables
% ==============================================================================
\section{Tables}
\label{sec:tables}
% ------------------------------------------------------------------------------
% Subsection: Simple Tables
% ------------------------------------------------------------------------------
\subsection{Simple Tables}
\label{subsec:simple_tables}
\begin{table}[htbp]
\centering
\caption{Comparison of different methods}
\label{tab:comparison}
\begin{tabular}{lccc}
\toprule
\textbf{Method} & \textbf{Accuracy (\%)} & \textbf{Speed (ms)} & \textbf{Memory (MB)} \\
\midrule
Method A & 95.2 & 12.3 & 256 \\
Method B & 97.8 & 45.6 & 512 \\
Method C & 93.1 & 8.9 & 128 \\
Method D & 99.1 & 78.2 & 1024 \\
\bottomrule
\end{tabular}
\end{table}
Table~\ref{tab:comparison} presents a performance comparison of different methods.
% ------------------------------------------------------------------------------
% Subsection: Complex Tables
% ------------------------------------------------------------------------------
\subsection{Complex Tables with Multicolumn}
\label{subsec:complex_tables}
\begin{table}[htbp]
\centering
\caption{Experimental results across different conditions}
\label{tab:experimental}
\begin{tabular}{l|cc|cc}
\toprule
\multirow{2}{*}{\textbf{Sample}} &
\multicolumn{2}{c|}{\textbf{Condition A}} &
\multicolumn{2}{c}{\textbf{Condition B}} \\
& \textbf{Mean} & \textbf{SD} & \textbf{Mean} & \textbf{SD} \\
\midrule
Sample 1 & 12.3 & 1.2 & 15.6 & 2.1 \\
Sample 2 & 13.5 & 1.5 & 16.8 & 1.9 \\
Sample 3 & 11.9 & 1.1 & 14.2 & 2.3 \\
\midrule
\textbf{Average} & 12.6 & 1.3 & 15.5 & 2.1 \\
\bottomrule
\end{tabular}
\end{table}
% ==============================================================================
% Section: Code Listings
% ==============================================================================
\section{Source Code}
\label{sec:source_code}
% ------------------------------------------------------------------------------
% Subsection: Code Examples
% ------------------------------------------------------------------------------
\subsection{Programming Examples}
\label{subsec:code_examples}
\begin{lstlisting}[language=Python, caption={Python function example}, label=lst:python_example]
def calculate_statistics(data):
"""
Calculate mean and standard deviation of a dataset.
Args:
data (list): List of numerical values
Returns:
tuple: Mean and standard deviation
"""
import numpy as np
mean = np.mean(data)
std = np.std(data)
return mean, std
# Example usage
dataset = [1, 2, 3, 4, 5]
mean, std = calculate_statistics(dataset)
print(f"Mean: {mean:.2f}, Std: {std:.2f}")
\end{lstlisting}
Listing~\ref{lst:python_example} demonstrates a simple statistical calculation
function in Python.
% ==============================================================================
% Section: Cross-References and Hyperlinks
% ==============================================================================
\section{Cross-References}
\label{sec:cross_references}
% ------------------------------------------------------------------------------
% Subsection: Internal References
% ------------------------------------------------------------------------------
\subsection{Internal References}
\label{subsec:internal_refs}
This template supports various types of cross-references:
\begin{itemize}
\item Chapters: See Chapter~\ref{chap:example_chapter}
\item Sections: As discussed in Section~\ref{sec:mathematics}
\item Subsections: Details in Subsection~\ref{subsec:text_styles}
\item Figures: Shown in Figure~\ref{fig:single_example}
\item Tables: Data in Table~\ref{tab:comparison}
\item Equations: According to Equation~\eqref{eq:maxwell}
\item Pages: On page~\pageref{sec:lists}
\end{itemize}
% ------------------------------------------------------------------------------
% Subsection: External Links
% ------------------------------------------------------------------------------
\subsection{External Links}
\label{subsec:external_links}
Links to external resources:
\begin{itemize}
\item URL: \url{https://www.example.com}
\item Email: \href{mailto:email@example.com}{email@example.com}
\item Linked text: \href{https://www.latex-project.org}{LaTeX Project}
\end{itemize}
% ==============================================================================
% Section: Glossary and Acronyms
% ==============================================================================
\section{Using Glossary and Acronyms}
\label{sec:glossary_usage}
% Demonstrate glossary usage
The \gls{Textkoerper} contains the main content. When using acronyms like
\acrfull{a:MPG}, they are automatically formatted. Subsequent uses show only
the short form: \acrshort{a:MPG}.
% Add more glossary entries as needed
Technical terms should be defined in the glossary file and referenced using
the appropriate commands throughout the document.
% ==============================================================================
% Section: Advanced Features
% ==============================================================================
\section{Advanced Features}
\label{sec:advanced}
% ------------------------------------------------------------------------------
% Subsection: Footnotes and Margin Notes
% ------------------------------------------------------------------------------
\subsection{Footnotes}
\label{subsec:footnotes}
Footnotes provide additional information\footnote{This is an example footnote
that contains supplementary information not essential to the main text.} without
interrupting the flow of the main text.
% ------------------------------------------------------------------------------
% Subsection: Theorems and Proofs
% ------------------------------------------------------------------------------
\subsection{Theorems and Definitions}
\label{subsec:theorems}
\begin{definition}[Important Concept]
A formal definition of an important concept that requires precise
mathematical or technical language.
\end{definition}
\begin{theorem}[Fundamental Theorem]
\label{thm:fundamental}
Statement of an important theorem that will be proven or referenced.
\end{theorem}
\begin{proof}
The proof follows from the definition and basic principles...
\[
\text{QED}
\]
\end{proof}
% ==============================================================================
% Chapter Summary
% ==============================================================================
\section{Chapter Summary}
\label{sec:chapter_summary}
This chapter has demonstrated the key features of the HSRTReport template,
including:
\begin{itemize}
\item Text formatting and typography options
\item Mathematical expressions and equations
\item Figures, tables, and code listings
\item Cross-referencing and citations
\item Advanced document features
\end{itemize}
These elements form the foundation for creating professional academic documents
using this template. Each feature can be customized further to meet specific
requirements of your document.
% ==============================================================================
% End of Example Chapter
% ==============================================================================

View File

@ -1,21 +1,91 @@
% !TEX root = Main.tex
% ==============================================================================
% Glossary and Acronym Definitions
% ==============================================================================
% Description: This file contains all glossary entries and acronyms used in
% the document. Entries are automatically sorted and formatted.
% Usage: Reference entries in text using:
% - \gls{label} for glossary entries
% - \acrshort{label} for acronym short form
% - \acrlong{label} for acronym long form
% - \acrfull{label} for full acronym (short and long)
% Author: [Your Name]
% Date: [Date]
% ==============================================================================
% ============================================================================
% GLOSSAR: STIMULATIONSTECHNIKEN (KOMPAKT)
% ============================================================================
% ------------------------------------------------------------------------------
% Glossary Entries
% ------------------------------------------------------------------------------
% Define technical terms, concepts, and important words
% Syntax: \newglossaryentry{label}{
% name={Display Name},
% description={Detailed description},
% plural={Plural form (optional)},
% genitive={Genitive form (optional)}
% }
% ------------------------------------------------------------------------------
% tES / Transkranielle Elektrostimulation
% Example: Technical term
\newglossaryentry{Textkoerper}
{
name=Textkörper,
description={
Bezeichnung für den Bereich innerhalb der Arbeit, in dem die eigentliche Ausarbeitung enthalten ist.
}
Bezeichnung für den Bereich innerhalb der Arbeit, in dem die
eigentliche Ausarbeitung enthalten ist. Der Textkörper umfasst
alle Kapitel zwischen Einleitung und Fazit.
},
genitive=Textkörpers,
plural=Textkörper
}
% ------------------------------------------------------------------------------
% Add more glossary entries here
% ------------------------------------------------------------------------------
% \newglossaryentry{example}
% {
% name=Example,
% description={An example glossary entry for demonstration purposes}
% }
% ==============================================================================
% Acronym Definitions
% ==============================================================================
% Define abbreviations and acronyms that appear in the document
% Syntax: \newacronym{label}{SHORT}{Long Form}
% ------------------------------------------------------------------------------
% Document-related acronyms
\newacronym{a:Abb}{Abb.}{Abbildung}
\newacronym{a:MPG}{MPG}{Medizinproduktegesetz}
\newacronym{a:MS}{MS}{Microsoft®}
\newacronym{a:Tab}{Tab.}{Tabelle}
% Legal and regulatory acronyms
\newacronym{a:MPG}{MPG}{Medizinproduktegesetz}
% Company and organization acronyms
\newacronym{a:MS}{MS}{Microsoft®}
% ------------------------------------------------------------------------------
% Add more acronyms here (alphabetically sorted recommended)
% ------------------------------------------------------------------------------
% Technical acronyms
% \newacronym{a:API}{API}{Application Programming Interface}
% \newacronym{a:CPU}{CPU}{Central Processing Unit}
% \newacronym{a:GPU}{GPU}{Graphics Processing Unit}
% Academic acronyms
% \newacronym{a:BSc}{B.Sc.}{Bachelor of Science}
% \newacronym{a:MSc}{M.Sc.}{Master of Science}
% \newacronym{a:PhD}{Ph.D.}{Doctor of Philosophy}
% ==============================================================================
% Glossary Configuration Notes
% ==============================================================================
% - Entries are automatically sorted alphabetically
% - Unused entries can be included using \glsaddallunused in Main.tex
% - Multiple glossary types can be defined if needed
% - Cross-references between entries are supported
% ==============================================================================
% ==============================================================================
% End of Glossary Definitions
% ==============================================================================

1101
LICENSE

File diff suppressed because it is too large Load Diff

142
Main.bib
View File

@ -1,4 +1,36 @@
% ==============================================================================
% Bibliography Database
% ==============================================================================
% Description: This file contains all bibliographic references for the document.
% Entries are in BibTeX format and are processed by BibLaTeX/Biber.
% Format: Standard BibTeX format with additional BibLaTeX fields
% Usage: Cite entries using \cite{key}, \textcite{key}, \parencite{key}
% Author: [Your Name]
% Date: [Date]
% ==============================================================================
% ------------------------------------------------------------------------------
% Entry Types Overview
% ------------------------------------------------------------------------------
% @article - Journal articles
% @book - Books
% @inbook - Chapter or section in a book
% @incollection - Part of a book with its own title
% @inproceedings - Conference paper
% @manual - Technical documentation
% @mastersthesis - Master's thesis
% @phdthesis - PhD dissertation
% @techreport - Technical report
% @unpublished - Unpublished work
% @online - Online resources
% @misc - Everything else
% ------------------------------------------------------------------------------
% ==============================================================================
% Journal Articles
% ==============================================================================
@article{ott_einfluss_2021,
title = {Einfluss transkranieller Gleichstromstimulation auf das motorische Lernen bei Patienten mit wiederholten Schädelhirntraumen},
rights = {http://www.fu-berlin.de/sites/refubium/rechtliches/Nutzungsbedingungen},
@ -157,6 +189,10 @@ Dies ist die erste Studie, die den stimulatorischen Effekt auf das motorische Le
file = {Full Text PDF:/home/frederik/Zotero/storage/BTGZA7MM/Hamilton et al. - 2015 - Neural signal processing and closed-loop control algorithm design for an implanted neural recording.pdf:application/pdf},
}
% ==============================================================================
% Meta-Analyses and Reviews
% ==============================================================================
@article{simonsmeier_electrical_2018,
title = {Electrical brain stimulation ({tES}) improves learning more than performance: A meta-analysis},
volume = {84},
@ -195,6 +231,10 @@ Dies ist die erste Studie, die den stimulatorischen Effekt auf das motorische Le
file = {Full Text PDF:/home/frederik/Zotero/storage/YT8A9PEV/Senkowski et al. - 2022 - Boosting working memory uncovering the differential effects of tDCS and tACS.pdf:application/pdf},
}
% ==============================================================================
% Online Resources
% ==============================================================================
@online{noauthor_neurowissenschaft_nodate,
title = {Neurowissenschaft: Hirnmanipulation per Hightech},
url = {https://www.spektrum.de/news/transkranielle-hirnstimulation-als-therapie/1345240},
@ -275,6 +315,10 @@ These results provide further evidence for the capacity of {tDCS} applied to {rV
file = {ScienceDirect Full Text PDF:/home/frederik/Zotero/storage/63IKSU5D/Gibson et al. - 2020 - Transcranial direct current stimulation facilitates category learning.pdf:application/pdf;ScienceDirect Snapshot:/home/frederik/Zotero/storage/7N74VDSB/S1935861X19304681.html:text/html},
}
% ==============================================================================
% Book Chapters and Collections
% ==============================================================================
@incollection{chatterjee_chapter_2013,
title = {Chapter 27 - The ethics of neuroenhancement},
volume = {118},
@ -516,6 +560,104 @@ We hope that the remote nature of this training program will facilitate increase
pmcid = {PMC5740087},
}
% ==============================================================================
% Example Entries for Common Reference Types
% ==============================================================================
% Below are template examples for common citation types.
% Copy and modify these for your own references.
% ------------------------------------------------------------------------------
% --- Example: Journal Article ---
@article{example2023,
author = {Lastname, Firstname and Coauthor, Name},
title = {Example Article Title: Subtitle if Present},
journal = {Journal Name},
volume = {42},
number = {3},
pages = {123--145},
year = {2023},
doi = {10.1234/example.2023.001},
url = {https://doi.org/10.1234/example.2023.001},
abstract = {Optional abstract text for reference},
keywords = {keyword1, keyword2, keyword3}
}
% --- Example: Book ---
@book{examplebook2022,
author = {Author, Name},
title = {Book Title: Complete with Subtitle},
subtitle = {Optional Separate Subtitle Field},
publisher = {Publisher Name},
address = {City, Country},
year = {2022},
edition = {2},
isbn = {978-3-12345-678-9},
pages = {350},
series = {Book Series Name},
volume = {3}
}
% --- Example: Conference Paper ---
@inproceedings{conference2023,
author = {Speaker, Name and Collaborator, Other},
title = {Conference Paper Title},
booktitle = {Proceedings of the International Conference Name},
year = {2023},
editor = {Editor, Name},
pages = {45--52},
address = {Conference Location},
publisher = {ACM},
doi = {10.1145/1234567.1234568}
}
% --- Example: Website ---
@online{website2024,
author = {{Organization Name}},
title = {Web Page Title},
year = {2024},
url = {https://www.example.com/page},
urldate = {2024-11-28},
note = {Accessed: November 28, 2024}
}
% --- Example: Thesis ---
@phdthesis{dissertation2023,
author = {Student, Name},
title = {Dissertation Title: A Comprehensive Study},
school = {University Name},
year = {2023},
address = {City, Country},
type = {PhD thesis},
month = {June}
}
% --- Example: Technical Report ---
@techreport{report2023,
author = {Researcher, Name},
title = {Technical Report Title},
institution = {Research Institute},
year = {2023},
type = {Technical Report},
number = {TR-2023-001},
address = {City, Country},
month = {March}
}
% ==============================================================================
% Bibliography Notes
% ==============================================================================
% - Keep entries sorted alphabetically by citation key for easier maintenance
% - Use consistent naming convention for keys (e.g., author_keyword_year)
% - Include DOI when available for better accessibility
% - Add abstracts for complex papers to aid in reference management
% - Use keywords field to categorize references (primary, secondary, etc.)
% - Regular expressions can be used in some fields (check BibLaTeX manual)
% ==============================================================================
% ==============================================================================
% End of Bibliography Database
% ==============================================================================
@article{caulfield_optimized_2022,
title = {Optimized electrode positions, size, and current intensity for high-definition transcranial direct current stimulation},
volume = {12},

View File

@ -1,26 +1,71 @@
% ==============================================================================
% Main Document File
% ==============================================================================
% Description: Main LaTeX document file for HSRT Report template
% Author: [Your Name]
% Date: [Date]
% ==============================================================================
% ------------------------------------------------------------------------------
% Document Class Declaration
% ------------------------------------------------------------------------------
% The HSRTReport class is based on KOMA-Script's scrreprt class
% Options:
% - 11pt: Base font size (alternatives: 10pt, 12pt)
% - paper=a4: Paper format (alternatives: letter, a5, etc.)
% - oneside: Single-sided layout (alternative: twoside for duplex printing)
% - DIV=14: Type area calculation factor (higher = larger text area)
% - onecolumn: Single column layout (alternative: twocolumn)
% ------------------------------------------------------------------------------
\documentclass[
11pt,
paper=a4,
oneside,
DIV=14,
onecolumn
11pt, % Base font size
paper=a4, % Paper format
oneside, % Single-sided printing
DIV=14, % Type area calculation
onecolumn % Column layout
]{HSRTReport/HSRTReport}
\input{Preamble}
\input{Glossary}
% ------------------------------------------------------------------------------
% Preamble and Configuration
% ------------------------------------------------------------------------------
% Load document-specific settings and configurations
\input{Preamble} % Document preamble with bibliography and settings
\input{Glossary} % Glossary and acronym definitions
% ==== Document ====
% ==============================================================================
% Document Body
% ==============================================================================
\begin{document}
% Title page
% ------------------------------------------------------------------------------
% Title Page
% ------------------------------------------------------------------------------
% Generates the title page with university branding and document metadata
% Configuration in Settings/General.tex
\maketitle
% ------------------------------------------------------------------------------
% Document Spacing
% ------------------------------------------------------------------------------
% Set line spacing for the main content (1.0 = single spacing)
\setstretch{1.0}
% ===== Content =====
\input{Content/00_toc}
\input{Content/01_content}
\input{Content/99_bibliography}
% Add all remaining glossary entries that have not been used
% ------------------------------------------------------------------------------
% Content Sections
% ------------------------------------------------------------------------------
% Input content files in order of appearance
\input{Content/00_toc} % Table of contents, lists, and glossaries
\input{Content/01_content} % Main document content
\input{Content/99_bibliography} % Bibliography and references
% ------------------------------------------------------------------------------
% Glossary Processing
% ------------------------------------------------------------------------------
% Add all glossary entries to the document, even if not referenced
% This ensures complete glossary for reference purposes
\glsaddallunused
\end{document}
% ==============================================================================
% End of Main Document
% ==============================================================================

240
Makefile
View File

@ -1,33 +1,241 @@
# Makefile for LaTeX documents
# ==============================================================================
# Makefile for HSRTReport LaTeX Template
# ==============================================================================
# Description: Build automation for LaTeX documents with chapter management
# Usage: make [target]
# Author: HSRTReport Template
# ==============================================================================
# ------------------------------------------------------------------------------
# Configuration
# ------------------------------------------------------------------------------
LATEX = latexmk
BIBTEX=biber
LATEX_FLAGS = -xelatex -shell-escape -synctex=1 -interaction=nonstopmode
BIBER = biber
MAKEGLOSSARIES = makeglossaries
# Main document
SOURCE = Main.tex
PDF = $(SOURCE:.tex=.pdf)
OUT_DIR=Output
# Directories
BUILD_DIR = Build
OUT_DIR = Output
CHAPTERS_DIR = Content/Chapters
SCRIPTS_DIR = scripts
# Output files
PDF_SOURCE = $(BUILD_DIR)/$(PDF)
PDF_TARGET = $(OUT_DIR)/$(PDF)
all: compile
xdg-open $(PDF_TARGET)
# Platform detection for opening PDF
UNAME := $(shell uname)
ifeq ($(UNAME), Linux)
OPEN_CMD = xdg-open
else ifeq ($(UNAME), Darwin)
OPEN_CMD = open
else
OPEN_CMD = start
endif
clean:
git clean -dfX
# Colors for output
RED = \033[0;31m
GREEN = \033[0;32m
YELLOW = \033[1;33m
BLUE = \033[0;34m
NC = \033[0m # No Color
# ------------------------------------------------------------------------------
# Main Targets
# ------------------------------------------------------------------------------
.PHONY: all
all: compile view
@echo -e "$(GREEN)✓ Document built and opened successfully$(NC)"
.PHONY: compile
compile:
# If not Exists, create 'Build' directory
[ -d $(BUILD_DIR) ] || mkdir -p $(BUILD_DIR)
# makeglossaries -o $(BUILD_DIR)/$(SOURCE:.tex=.gls) $(BUILD_DIR)/$(SOURCE:.tex=)
@echo -e "$(BLUE)=== Building LaTeX Document ===$(NC)"
@[ -d $(BUILD_DIR) ] || mkdir -p $(BUILD_DIR)
@echo -e "$(YELLOW)→ Running XeLaTeX...$(NC)"
$(LATEX) $(LATEX_FLAGS) -output-directory=$(BUILD_DIR) $(SOURCE)
# If not Exists, create 'Output/' directory
[ -d $(OUT_DIR) ] || mkdir -p $(OUT_DIR)
# Copy the PDF to the 'Output/' directory
cp $(PDF_SOURCE) $(PDF_TARGET)
@[ -d $(OUT_DIR) ] || mkdir -p $(OUT_DIR)
@cp $(PDF_SOURCE) $(PDF_TARGET)
@echo -e "$(GREEN)✓ PDF created: $(PDF_TARGET)$(NC)"
.PHONY: all clean
.PHONY: full
full: clean-aux compile
@echo -e "$(GREEN)✓ Full build completed$(NC)"
.PHONY: view
view:
@echo -e "$(BLUE)→ Opening PDF...$(NC)"
@if [ -f $(PDF_TARGET) ]; then \
$(OPEN_CMD) $(PDF_TARGET); \
else \
echo -e "$(RED)✗ PDF not found. Run 'make compile' first$(NC)"; \
exit 1; \
fi
# ------------------------------------------------------------------------------
# Clean Targets
# ------------------------------------------------------------------------------
.PHONY: clean
clean: clean-aux clean-output
@echo -e "$(GREEN)✓ All files cleaned$(NC)"
.PHONY: clean-aux
clean-aux:
@echo -e "$(YELLOW)→ Cleaning auxiliary files...$(NC)"
@rm -rf $(BUILD_DIR)
@rm -f *.aux *.log *.out *.toc *.lof *.lot *.lol *.bbl *.blg *.synctex.gz
@rm -f *.fdb_latexmk *.fls *.idx *.ind *.ilg *.glo *.gls *.glg
@rm -f Content/*.aux Content/Chapters/*.aux
@echo -e "$(GREEN)✓ Auxiliary files cleaned$(NC)"
.PHONY: clean-output
clean-output:
@echo -e "$(YELLOW)→ Cleaning output files...$(NC)"
@rm -rf $(OUT_DIR)
@echo -e "$(GREEN)✓ Output files cleaned$(NC)"
.PHONY: distclean
distclean: clean
@echo -e "$(YELLOW)→ Removing all generated files...$(NC)"
@git clean -dfX 2>/dev/null || rm -rf $(BUILD_DIR) $(OUT_DIR)
@echo -e "$(GREEN)✓ Distribution clean completed$(NC)"
# ------------------------------------------------------------------------------
# Chapter Management Targets
# ------------------------------------------------------------------------------
.PHONY: chapter
chapter:
@if [ -z "$(NUM)" ] || [ -z "$(NAME)" ]; then \
echo -e "$(RED)✗ Usage: make chapter NUM=02 NAME=methodology$(NC)"; \
exit 1; \
fi
@echo -e "$(BLUE)=== Creating New Chapter ===$(NC)"
@$(SCRIPTS_DIR)/create_chapter.sh $(NUM) $(NAME)
.PHONY: chapters
chapters: list-chapters
.PHONY: list-chapters
list-chapters:
@echo -e "$(BLUE)=== Chapter Overview ===$(NC)"
@$(SCRIPTS_DIR)/list_chapters.sh
.PHONY: show-chapter
show-chapter:
@if [ -z "$(NAME)" ]; then \
echo -e "$(RED)✗ Usage: make show-chapter NAME=02_methodology$(NC)"; \
exit 1; \
fi
@$(SCRIPTS_DIR)/show_chapter.sh $(NAME)
.PHONY: delete-chapter
delete-chapter:
@if [ -z "$(NAME)" ]; then \
echo -e "$(RED)✗ Usage: make delete-chapter NAME=02_methodology$(NC)"; \
exit 1; \
fi
@echo -e "$(YELLOW)⚠ Warning: This will delete the chapter file$(NC)"
@$(SCRIPTS_DIR)/delete_chapter.sh $(NAME)
# ------------------------------------------------------------------------------
# Development Targets
# ------------------------------------------------------------------------------
.PHONY: watch
watch:
@echo -e "$(BLUE)=== Starting continuous build ===$(NC)"
@echo -e "$(YELLOW)→ Watching for changes... (Ctrl+C to stop)$(NC)"
$(LATEX) $(LATEX_FLAGS) -pvc -output-directory=$(BUILD_DIR) $(SOURCE)
.PHONY: draft
draft:
@echo -e "$(BLUE)=== Building draft version ===$(NC)"
$(LATEX) -xelatex -interaction=nonstopmode -output-directory=$(BUILD_DIR) $(SOURCE)
@[ -d $(OUT_DIR) ] || mkdir -p $(OUT_DIR)
@cp $(PDF_SOURCE) $(OUT_DIR)/$(SOURCE:.tex=_draft.pdf)
@echo -e "$(GREEN)✓ Draft created: $(OUT_DIR)/$(SOURCE:.tex=_draft.pdf)$(NC)"
# ------------------------------------------------------------------------------
# Utility Targets
# ------------------------------------------------------------------------------
.PHONY: count
count:
@echo -e "$(BLUE)=== Document Statistics ===$(NC)"
@echo -n "Chapters: "
@ls -1 $(CHAPTERS_DIR)/*.tex 2>/dev/null | wc -l
@echo -n "Total lines: "
@wc -l $(CHAPTERS_DIR)/*.tex 2>/dev/null | tail -1 | awk '{print $$1}'
@echo -n "Approx. words: "
@cat $(CHAPTERS_DIR)/*.tex 2>/dev/null | \
sed 's/\\[a-zA-Z]*\({[^}]*}\)\?//g' | wc -w
.PHONY: check
check:
@echo -e "$(BLUE)=== Checking Prerequisites ===$(NC)"
@command -v xelatex >/dev/null 2>&1 && \
echo -e "$(GREEN)✓ XeLaTeX found$(NC)" || \
echo -e "$(RED)✗ XeLaTeX not found$(NC)"
@command -v biber >/dev/null 2>&1 && \
echo -e "$(GREEN)✓ Biber found$(NC)" || \
echo -e "$(RED)✗ Biber not found$(NC)"
@command -v makeglossaries >/dev/null 2>&1 && \
echo -e "$(GREEN)✓ makeglossaries found$(NC)" || \
echo -e "$(RED)✗ makeglossaries not found$(NC)"
@command -v latexmk >/dev/null 2>&1 && \
echo -e "$(GREEN)✓ latexmk found$(NC)" || \
echo -e "$(RED)✗ latexmk not found$(NC)"
.PHONY: structure
structure:
@echo -e "$(BLUE)=== Project Structure ===$(NC)"
@tree -d -L 2 --charset ascii 2>/dev/null || \
find . -type d -maxdepth 2 | sed 's|./||' | sort
# ------------------------------------------------------------------------------
# Help Target
# ------------------------------------------------------------------------------
.PHONY: help
help:
@echo -e "$(BLUE)==============================================================================="
@echo "HSRTReport LaTeX Template - Makefile Targets"
@echo -e "===============================================================================$(NC)"
@echo ""
@echo -e "$(GREEN)Main Targets:$(NC)"
@echo " make - Build document and open PDF"
@echo " make compile - Build the LaTeX document"
@echo " make full - Clean and rebuild everything"
@echo " make view - Open the PDF file"
@echo ""
@echo -e "$(GREEN)Chapter Management:$(NC)"
@echo " make chapter NUM=02 NAME=methodology - Create a new chapter"
@echo " make chapters - List all chapters"
@echo " make show-chapter NAME=02_methodology - Display chapter content"
@echo " make delete-chapter NAME=02_methodology - Delete a chapter (with backup)"
@echo ""
@echo -e "$(GREEN)Cleaning:$(NC)"
@echo " make clean - Remove all generated files"
@echo " make clean-aux - Remove auxiliary files only"
@echo " make clean-output - Remove output files only"
@echo " make distclean - Remove everything (git clean)"
@echo ""
@echo -e "$(GREEN)Development:$(NC)"
@echo " make watch - Continuous compilation on file changes"
@echo " make draft - Quick draft compilation"
@echo ""
@echo -e "$(GREEN)Utilities:$(NC)"
@echo " make count - Show document statistics"
@echo " make check - Check for required tools"
@echo " make structure - Show project structure"
@echo " make help - Show this help message"
@echo ""
@echo -e "$(YELLOW)Examples:$(NC)"
@echo " make chapter NUM=01 NAME=introduction"
@echo " make chapter NUM=02 NAME=literature_review"
@echo " make show-chapter NAME=01_introduction"
@echo ""
# Default target
.DEFAULT_GOAL := help

View File

@ -3,18 +3,51 @@
% Document Preamble
% ==============================================================================
% Description: Document-specific configuration and settings
% This file contains all document-specific configurations that
% customize the HSRTReport class for your particular document
% Author: [Your Name]
% Date: [Date]
% ==============================================================================
% ------------------------------------------------------------------------------
% Bibliography Configuration
% ------------------------------------------------------------------------------
% Configure BibLaTeX bibliography management
% The bibliography file (Main.bib) contains all references in BibTeX format
% Additional .bib files can be added with multiple \addbibresource commands
% ------------------------------------------------------------------------------
\addbibresource{Main.bib}
% ------------------------------------------------------------------------------
% Document Settings
% Document Settings Import
% ------------------------------------------------------------------------------
% Load document-specific settings from external files
% This modular approach keeps the preamble clean and organized
% ------------------------------------------------------------------------------
\input{Settings/General} % General document settings (title, author, etc.)
\input{Settings/Logos} % Logo configuration and positioning
% ------------------------------------------------------------------------------
% Custom Commands and Macros (Optional)
% ------------------------------------------------------------------------------
% Add your custom LaTeX commands here
% Example: \newcommand{\mycommand}[1]{#1}
% ------------------------------------------------------------------------------
% ------------------------------------------------------------------------------
% Additional Package Loading (Optional)
% ------------------------------------------------------------------------------
% Load additional packages not included in the HSRTReport class
% Note: Most common packages are already loaded by the class
% Example: \usepackage{mypackage}
% ------------------------------------------------------------------------------
% ------------------------------------------------------------------------------
% Package Configuration (Optional)
% ------------------------------------------------------------------------------
% Configure packages that require specific settings
% Example: \setpackageoption{value}
% ------------------------------------------------------------------------------
\input{Settings/General}
\input{Settings/Logos}
% ==============================================================================
% End of Preamble

293
README.md
View File

@ -1,2 +1,293 @@
# LaTeX-Base
# HSRTReport LaTeX Template
A professional LaTeX report template for academic papers and theses at the University of Applied Sciences Reutlingen (Hochschule Reutlingen).
## 📋 Table of Contents
- [Overview](#overview)
- [Features](#features)
- [Prerequisites](#prerequisites)
- [Installation](#installation)
- [Project Structure](#project-structure)
- [Usage](#usage)
- [Document Class Options](#document-class-options)
- [Customization](#customization)
- [Building the Document](#building-the-document)
- [Troubleshooting](#troubleshooting)
- [Contributing](#contributing)
- [License](#license)
## 📖 Overview
The HSRTReport class is a customized LaTeX document class based on KOMA-Script's `scrreprt` class, specifically designed for creating professional academic reports, seminar papers, and bachelor/master theses at the University of Applied Sciences Reutlingen. It provides a consistent, professional layout with minimal configuration required.
## ✨ Features
- **Professional Typography**: Configured for optimal readability with proper font settings
- **Automatic Title Page Generation**: Customizable title page with university branding
- **Bibliography Management**: Integrated BibLaTeX support for citations
- **Glossary Support**: Built-in glossary and acronym management
- **Code Highlighting**: Syntax highlighting for source code listings
- **Word Count**: Automatic word counting functionality
- **Cross-referencing**: Smart referencing with hyperref
## 🔧 Prerequisites
### Required Software
- **XeLaTeX**: This template requires XeLaTeX for compilation (included in most TeX distributions)
- **TeX Distribution**: One of the following:
- [TeX Live](https://www.tug.org/texlive/) (Linux/Windows/macOS)
- [MiKTeX](https://miktex.org/) (Windows)
- [MacTeX](https://www.tug.org/mactex/) (macOS)
- **GNU make**: Automates compilation and cleaning tasks
### Required LaTeX Packages
The template automatically loads all necessary packages. Key dependencies include:
- KOMA-Script bundle
- BibLaTeX with Biber backend
- glossaries-extra
- fontspec (for font management)
- TikZ (for graphics)
- listings (for code)
## 📁 Project Structure
```
SAT-WiSe-25-26/
├── HSRTReport/ # Document class files
│ ├── HSRTReport.cls # Main class definition
│ ├── Assets/ # Fonts and images
│ │ ├── Fonts/ # Custom fonts
│ │ └── Images/ # Logo and graphics
│ ├── Config/ # Configuration modules
│ │ ├── Fonts.tex # Font settings
│ │ ├── PageSetup.tex # Page layout
│ │ └── ... # Other configurations
│ ├── Imports/ # Package imports
│ │ ├── Core.tex # Core packages
│ │ ├── Document.tex # Document structure
│ │ └── ... # Other imports
│ ├── Modules/ # Feature modules
│ │ ├── Content/ # Content-related features
│ │ ├── Layout/ # Layout features
│ │ └── Tools/ # Utility tools
│ └── Pages/ # Page templates
│ └── Titlepage.tex # Title page definition
├── Content/ # Document content
│ ├── 00_toc.tex # Table of contents and lists
│ ├── 01_content.tex # Chapter loader (auto-managed)
│ ├── 99_bibliography.tex # Bibliography
│ ├── Chapters/ # Individual chapter files
│ │ ├── 01_introduction.tex
│ │ ├── example_chapter.tex
│ │ └── ...
│ └── Images/ # Document images
├── Settings/ # Document settings
│ ├── General.tex # General settings
│ └── Logos.tex # Logo configuration
├── scripts/ # Chapter management scripts
│ ├── create_chapter.sh # Create new chapters
│ ├── list_chapters.sh # List all chapters
│ ├── delete_chapter.sh # Delete chapters
│ └── show_chapter.sh # View chapter content
├── Main.tex # Main document file
├── Preamble.tex # Document preamble
├── Glossary.tex # Glossary definitions
├── Main.bib # Bibliography database
├── Makefile # Build automation
├── .latexmkrc # Latexmk configuration
└── QUICKSTART.md # Quick start guide
```
## 📝 Usage
### Basic Document Setup
1. **Edit `Main.tex`** to configure document class options:
```latex
\documentclass[
11pt, % Font size (10pt, 11pt, 12pt)
paper=a4, % Paper size
oneside, % Single-sided (use twoside for double)
DIV=14, % Page layout calculation
onecolumn % Single column layout
]{HSRTReport/HSRTReport}
```
2. **Configure document metadata** in `Settings/General.tex`:
```latex
% Document title
\title{Your Document Title}
% Title page information
\AddTitlePageDataLine{Thema}{Your Topic}
\AddTitlePageDataLine{Vorgelegt von}{Your Name}
\AddTitlePageDataLine{Studiengang}{Your Study Program}
% ... additional fields
```
3. **Add your content** using one of these methods:
- **Automatic (Recommended)**: Use scripts to manage chapters
```bash
./scripts/create_chapter.sh 02 methodology
./scripts/create_chapter.sh 03 results
./scripts/list_chapters.sh
```
- **Manual**: Create files in `Content/Chapters/` and add them to `Content/01_content.tex`
4. **Manage bibliography** in `Main.bib` using BibTeX format
5. **Define glossary entries** in `Glossary.tex`:
```latex
\newglossaryentry{term}{
name=Term,
description={Description of the term}
}
\newacronym{abbr}{ABBR}{Full Form of Abbreviation}
```
## ⚙️ Document Class Options
The HSRTReport class accepts all standard KOMA-Script `scrreprt` options plus:
| Option | Description | Values |
|--------|-------------|---------|
| `paper` | Paper size | `a4`, `letter`, etc. |
| `fontsize` | Base font size | `10pt`, `11pt`, `12pt` |
| `oneside`/`twoside` | Page layout | Single or double-sided |
| `DIV` | Type area calculation | Integer (12-16 recommended) |
| `onecolumn`/`twocolumn` | Column layout | Single or double column |
## 🎨 Customization
### Modifying the Title Page
Edit `Settings/General.tex` to customize title page fields:
```latex
\AddTitlePageDataLine{Field Name}{Field Content}
\AddTitlePageDataSpace{5pt} % Add vertical space
```
### Adding Custom Packages
Add custom packages to `Preamble.tex`:
```latex
\usepackage{yourpackage}
\yourpackagesetup{options}
```
### Changing Fonts
The template uses custom fonts defined in `HSRTReport/Config/Fonts.tex`. Modify this file to change fonts template-wide.
### Creating Custom Commands
Add custom commands to `Preamble.tex`:
```latex
\newcommand{\mycommand}[1]{#1}
```
## 📚 Chapter Management
### Automatic Chapter Management (Recommended)
The template includes scripts for efficient chapter management:
#### Create a New Chapter
```bash
./scripts/create_chapter.sh 02 methodology
```
This creates `Content/Chapters/02_methodology.tex` with a template structure and automatically adds it to the document.
#### List All Chapters
```bash
./scripts/list_chapters.sh
```
Shows all chapters and their inclusion status in the document.
#### View Chapter Content
```bash
./scripts/show_chapter.sh 02_methodology --info
./scripts/show_chapter.sh 02_methodology --structure
```
#### Delete a Chapter
```bash
./scripts/delete_chapter.sh 02_methodology
```
Removes the chapter and creates a backup in `.chapter_backups/`.
### Manual Chapter Management
1. Create a file in `Content/Chapters/`
2. Add `\input{Content/Chapters/your_chapter}` to the marked section in `Content/01_content.tex`
## 🔨 Building the Document
### Using Make (Recommended)
```bash
# Full build with bibliography and glossary open after
make
# Just build
make compile
# Clean auxiliary files
make clean
```
### Using latexmk
```bash
latexmk -xelatex -bibtex Main.tex
```
## 🐛 Troubleshooting
### Common Issues
1. **"This class can only be used with XeLaTeX" error**
- Solution: Ensure you're using XeLaTeX, not pdfLaTeX
- Check your editor's compiler settings
2. **Bibliography not appearing**
- Run `biber Main` after the first XeLaTeX compilation
- Check for errors in `Main.bib`
3. **Glossary entries not showing**
- Run `makeglossaries Main` after adding new entries
- Ensure entries are referenced in the document using `\gls{term}`
## 📄 License
This template is licensed under the Creative Commons Attribution-ShareAlike 4.0 International License (CC BY-SA 4.0).
- **Original Author**: Martin Oswald (Zürich University of Applied Sciences)
- **Modified by**: Frederik Beimgraben (University of Applied Sciences Reutlingen)
See [LICENSE](LICENSE) for details.
## 📧 Support
For questions, issues, or suggestions:
- Open an issue on GitHub
- Contact the maintainer at [frederik@beimgraben.net](mailto:frederik@beimgraben.net)
## 🙏 Acknowledgments
- Martin Oswald for the original ZHAWReport class
- KOMA-Script team for the excellent document classes
- University of Applied Sciences Reutlingen [Reutlingen University](https://reutlingen-university.de)
---
*Last updated: October 2025*

View File

@ -2,60 +2,136 @@
% ==============================================================================
% Document-Specific General Settings
% ==============================================================================
% Description: Title, author, abstract, and other document metadata
% Description: This file contains all document-specific settings including
% title, author information, abstract, keywords, and other
% metadata required for the title page and document properties.
% Author: [Your Name]
% Date: [Date]
% ==============================================================================
% ------------------------------------------------------------------------------
% Watermark and Date Configuration
% ------------------------------------------------------------------------------
% Meeting date
% Configure document watermark and creation date
% These settings affect the document's visual presentation and metadata
% ------------------------------------------------------------------------------
% Watermark text (leave empty for no watermark)
% Example: \newcommand{\waterMarkText}{DRAFT}
% Example: \newcommand{\waterMarkText}{CONFIDENTIAL}
\newcommand{\waterMarkText}{}
% Current date and time
% Document creation date
% Format: DD.MM.YYYY
% This date appears on the title page and in document metadata
\createdon{XX.XX.20XX}
% ------------------------------------------------------------------------------
% Document Title
% ------------------------------------------------------------------------------
% Main title of the document
% This appears on the title page and in PDF metadata
% For multi-line titles, use \\ for line breaks
% ------------------------------------------------------------------------------
\title{Vorgaben zur Formatierung der Seminararbeit}
% ------------------------------------------------------------------------------
% Title Page Data Fields
% ------------------------------------------------------------------------------
% Configure all fields that appear on the title page
% Use \AddTitlePageDataLine{Label}{Content} for each field
% Use \AddTitlePageDataSpace{dimension} to add vertical spacing
% Use \newline within content for line breaks
% ------------------------------------------------------------------------------
% --- Document Topic ---
% The main topic or theme of the document
\AddTitlePageDataLine{Thema}{
Thema-XXX: \newline
Vorgaben zur Formatierung der Seminararbeit
}
% Add spacing between sections
\AddTitlePageDataSpace{5pt}
% --- Author Information ---
% Student name, semester, and contact information
\AddTitlePageDataLine{Vorgelegt von}{
Hans Maria Muster \newline
X. Fachsemester \newline
\href{mailto:hans-maria.muster@student.hs-reutlingen.de}{hans-maria.muster@student.hs-reutlingen.de}
}
% Add spacing
\AddTitlePageDataSpace{5pt}
% --- Submission Date ---
% Date when the document is submitted
% Format: DD.MM.YYYY
\AddTitlePageDataLine{Vorgelegt am}{XX.XX.20XX}
% Add spacing
\AddTitlePageDataSpace{5pt}
% --- Academic Information ---
% Study program and course details
\AddTitlePageDataLine{Studiengang}{Medizinisch Technische Informatik B.Sc.}
% Module/Course information
\AddTitlePageDataLine{Modul}{
METI6.3 \newline
Seminar Ausgewählter Themen der Medizinisch-Technischen Informatik
}
\AddTitlePageDataLine{Dozent:in}{Prof. Dr. Sven Steddin}
\AddTitlePageDataLine{Semester}{Wintersemester 20XX/20XX}
\AddTitlePageDataSpace{5pt}
\AddTitlePageDataLine{Wortanzahl}{\quickwordcount{Content/01_content}} % !!! Only 01_content.tex !!!
% --- Supervisor Information ---
% Professor or supervisor name
\AddTitlePageDataLine{Dozent:in}{Prof. Dr. Sven Steddin}
% --- Semester Information ---
% Academic semester (e.g., Wintersemester 2024/2025)
\AddTitlePageDataLine{Semester}{Wintersemester 20XX/20XX}
% Add spacing
\AddTitlePageDataSpace{5pt}
% --- Word Count ---
% Automatic word count for the main content
% Note: This only counts words in the specified file (Content/01_content.tex)
% For multiple files, use \quickwordcount{file1,file2,file3}
\AddTitlePageDataLine{Wortanzahl}{\quickwordcount{Content/01_content}}
% ------------------------------------------------------------------------------
% Abstract
% ------------------------------------------------------------------------------
% The abstract provides a concise summary of the document
% It should include:
% - Research objective/hypothesis
% - Methodology used
% - Key findings/results
% - Main conclusions
% Keep it brief (typically 150-250 words)
% ------------------------------------------------------------------------------
\newcommand{\titlepageabstract}{%
Das Abstract beschreibt in wenigen Sätzen die Zielsetzung und das Ergebnis der Ausarbeitung. Das Abstract muss sich vollständig auf der Titelseite befinden. Die Zeichensatzformatierung wird in einem eigenen Absatz beschrieben Das Abstract soll es den Lesern:innen ermöglichen, innerhalb von wenigen Augenblicken zu erfassen, welcher Inhalt hinter der Überschrift steckt und ob das Thema, aus Sicht der Leser:innen, zur weiteren Bearbeitung lohnt. Das Abstract ist keine verbale Beschreibung des Inhaltsverzeichnisses, sondern gibt kurz und knapp z.B. die Zielsetzung (z.B. Hypothese), die eingesetzten Methoden und die erzielten Ergebnisse / Erkenntnisse bekannt. Weitere Hinweise finden Sie außerdem im Vorlesungsskript.
Das Abstract beschreibt in wenigen Sätzen die Zielsetzung und das Ergebnis
der Ausarbeitung. Das Abstract muss sich vollständig auf der Titelseite
befinden. Die Zeichensatzformatierung wird in einem eigenen Absatz
beschrieben. Das Abstract soll es den Lesern:innen ermöglichen, innerhalb
von wenigen Augenblicken zu erfassen, welcher Inhalt hinter der Überschrift
steckt und ob das Thema, aus Sicht der Leser:innen, zur weiteren Bearbeitung
lohnt. Das Abstract ist keine verbale Beschreibung des Inhaltsverzeichnisses,
sondern gibt kurz und knapp z.B. die Zielsetzung (z.B. Hypothese), die
eingesetzten Methoden und die erzielten Ergebnisse / Erkenntnisse bekannt.
Weitere Hinweise finden Sie außerdem im Vorlesungsskript.
}
% ------------------------------------------------------------------------------
% Keywords
% ------------------------------------------------------------------------------
% Keywords help categorize and index the document
% Separate keywords with commas
% Choose 3-7 relevant keywords that describe the main topics
% These appear on the title page and in PDF metadata
% ------------------------------------------------------------------------------
\newcommand{\titlepagekeywords}{%
Seminararbeit, wissenschaftliche Ausarbeitung, Bachelor-Thesis, Studium, Plagiat
}
@ -63,15 +139,53 @@
% ------------------------------------------------------------------------------
% List of Equations Configuration
% ------------------------------------------------------------------------------
% Customize the names for equation-related elements
% These affect how equations are labeled in lists and references
% ------------------------------------------------------------------------------
% Name for the list of equations (appears as chapter/section title)
\renewcommand{\listequationsname}{Formeln und Gleichungen}
% Name for individual equation references
\renewcommand{\equationname}{Formel}
% ------------------------------------------------------------------------------
% Paragraph Configuration
% ------------------------------------------------------------------------------
% Disable indentation
% Configure paragraph formatting throughout the document
% ------------------------------------------------------------------------------
% Paragraph indentation
% 0pt = no indentation (German standard for academic texts)
% >0pt = indent first line of each paragraph (English standard)
\setlength{\parindent}{0pt}
% Paragraph spacing (space between paragraphs)
% Default is usually appropriate, but can be adjusted if needed
% Example: \setlength{\parskip}{6pt plus 2pt minus 1pt}
% ------------------------------------------------------------------------------
% Optional: Custom Author Commands
% ------------------------------------------------------------------------------
% If you need multiple authors or additional author information,
% you can define custom commands here:
%
% \newcommand{\authorOne}{First Author}
% \newcommand{\authorTwo}{Second Author}
% \newcommand{\matriculationNumber}{12345678}
% \newcommand{\studentID}{S-12345}
% ------------------------------------------------------------------------------
% ------------------------------------------------------------------------------
% Optional: Document Version Control
% ------------------------------------------------------------------------------
% For tracking document versions during development
%
% \newcommand{\documentVersion}{1.0}
% \newcommand{\lastModified}{\today}
% \newcommand{\reviewStatus}{Draft}
% ------------------------------------------------------------------------------
% ==============================================================================
% End of General Settings
% ==============================================================================

View File

@ -2,24 +2,97 @@
% ==============================================================================
% Logo Configuration
% ==============================================================================
% Description: Document-specific logo selection and configuration
% Description: This file configures which logos appear on the title page and
% their positioning. Multiple logos can be displayed simultaneously.
% The AddLogo command handles logo placement and scaling.
% Usage: Uncomment the desired logo(s) and adjust parameters as needed.
% Author: [Your Name]
% Date: [Date]
% ==============================================================================
% ------------------------------------------------------------------------------
% Logo Configuration Syntax
% ------------------------------------------------------------------------------
% \AddLogo{LogoName}{ScaleX}{ScaleY}{Format}
%
% Parameters:
% LogoName - Name of the logo file (without extension)
% ScaleX - Horizontal scaling factor (1.0 = original width)
% ScaleY - Vertical scaling factor (1.0 = original height)
% Format - File format (png, svg, pdf, jpg)
%
% Logo files must be placed in: HSRTReport/Assets/Images/
% ------------------------------------------------------------------------------
% ------------------------------------------------------------------------------
% Available Logos
% ------------------------------------------------------------------------------
% STUPA Logo
% Below are pre-configured logos for various departments and organizations.
% Uncomment (remove the % at the beginning) the logo(s) you want to use.
% Multiple logos can be active simultaneously and will be arranged automatically.
% ------------------------------------------------------------------------------
% --- Student Parliament (STUPA) Logo ---
% Use this for student organization related documents
% Scale: 110% width, 70% height
%\AddLogo{STUPA}{1.1}{0.7}{png}
% INF Logo (Informatik Kombiniert)
% --- Informatics Department Logo (Combined Version) ---
% Standard logo for informatics department documents
% Scale: 90% width, 100% height
% This logo is active by default
\AddLogo{INF_Kombiniert}{0.9}{1}{svg}
% HSRT Logo (Hochschule Reutlingen)
% --- Hochschule Reutlingen (HSRT) Main Logo ---
% Official university logo for formal documents
% Scale: 170% width, 100% height
% Uncomment for official university submissions
% \AddLogo{HSRT}{1.7}{1}{png}
% METI Logo
% --- Medical Technical Informatics (METI) Logo ---
% Specific logo for METI study program
% Scale: 100% width, 50% height
% Uncomment for METI-specific documents
% \AddLogo{METI}{1.0}{0.5}{png}
% ------------------------------------------------------------------------------
% Custom Logo Addition
% ------------------------------------------------------------------------------
% To add your own custom logo:
% 1. Place the logo file in HSRTReport/Assets/Images/
% 2. Add a configuration line following this pattern:
% \AddLogo{YourLogoName}{ScaleX}{ScaleY}{Format}
%
% Example for a company logo:
% \AddLogo{CompanyLogo}{1.2}{1.2}{pdf}
%
% Example for a research group logo:
% \AddLogo{ResearchGroup}{0.8}{0.8}{png}
% ------------------------------------------------------------------------------
% ------------------------------------------------------------------------------
% Logo Positioning Notes
% ------------------------------------------------------------------------------
% - Logos are automatically positioned on the title page
% - Multiple logos are arranged in a grid layout
% - The order of \AddLogo commands determines the display order
% - Scaling factors can be adjusted for optimal visual balance
% - SVG format is recommended for scalability
% - PNG format is suitable for raster images
% - PDF format provides best quality for vector graphics
% ------------------------------------------------------------------------------
% ------------------------------------------------------------------------------
% Troubleshooting
% ------------------------------------------------------------------------------
% If a logo doesn't appear:
% 1. Check that the file exists in HSRTReport/Assets/Images/
% 2. Verify the file extension matches the format parameter
% 3. Ensure the \AddLogo line is not commented out
% 4. Check for typos in the logo name
% 5. Try different scaling factors if the logo appears too small/large
% ------------------------------------------------------------------------------
% ==============================================================================
% End of Logo Configuration
% ==============================================================================

250
scripts/create_chapter.sh Executable file
View File

@ -0,0 +1,250 @@
#!/bin/bash
# ==============================================================================
# Create Chapter Script
# ==============================================================================
# Description: Creates a new chapter file and automatically adds it to the
# content loader (01_content.tex)
# Usage: ./scripts/create_chapter.sh <chapter_number> <chapter_name>
# Example: ./scripts/create_chapter.sh 02 methodology
# Author: HSRTReport Template
# ==============================================================================
set -e # Exit on error
# ------------------------------------------------------------------------------
# Configuration
# ------------------------------------------------------------------------------
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
CHAPTERS_DIR="$PROJECT_ROOT/Content/Chapters"
CONTENT_FILE="$PROJECT_ROOT/Content/01_content.tex"
TEMPLATE_FILE="$CHAPTERS_DIR/example_chapter.tex"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# ------------------------------------------------------------------------------
# Functions
# ------------------------------------------------------------------------------
print_usage() {
echo "Usage: $0 <chapter_number> <chapter_name>"
echo ""
echo "Creates a new chapter file and adds it to the content loader."
echo ""
echo "Arguments:"
echo " chapter_number Two-digit number (e.g., 02, 03, 10)"
echo " chapter_name Name without spaces (e.g., methodology, results)"
echo ""
echo "Example:"
echo " $0 02 methodology"
echo " This creates: Content/Chapters/02_methodology.tex"
}
print_error() {
echo -e "${RED}Error: $1${NC}" >&2
}
print_success() {
echo -e "${GREEN}$1${NC}"
}
print_info() {
echo -e "${YELLOW} $1${NC}"
}
capitalize_first() {
echo "$1" | sed 's/\b\(.\)/\U\1/g'
}
# ------------------------------------------------------------------------------
# Input Validation
# ------------------------------------------------------------------------------
# Check if correct number of arguments
if [ $# -ne 2 ]; then
print_error "Invalid number of arguments"
print_usage
exit 1
fi
CHAPTER_NUM="$1"
CHAPTER_NAME="$2"
# Validate chapter number (should be 2 digits)
if ! [[ "$CHAPTER_NUM" =~ ^[0-9]{2}$ ]]; then
print_error "Chapter number must be exactly 2 digits (e.g., 02, 10)"
exit 1
fi
# Validate chapter name (alphanumeric and underscores only)
if ! [[ "$CHAPTER_NAME" =~ ^[a-zA-Z][a-zA-Z0-9_]*$ ]]; then
print_error "Chapter name must start with a letter and contain only letters, numbers, and underscores"
exit 1
fi
# ------------------------------------------------------------------------------
# File Creation
# ------------------------------------------------------------------------------
CHAPTER_FILE="$CHAPTERS_DIR/${CHAPTER_NUM}_${CHAPTER_NAME}.tex"
CHAPTER_INPUT_LINE="\\\\input{Content/Chapters/${CHAPTER_NUM}_${CHAPTER_NAME}}"
# Check if file already exists
if [ -f "$CHAPTER_FILE" ]; then
print_error "Chapter file already exists: $CHAPTER_FILE"
echo "Do you want to overwrite it? (y/N)"
read -r response
if [[ ! "$response" =~ ^[Yy]$ ]]; then
echo "Aborted."
exit 1
fi
fi
# Create chapter file with template content
print_info "Creating chapter file: ${CHAPTER_NUM}_${CHAPTER_NAME}.tex"
CHAPTER_TITLE=$(capitalize_first "$CHAPTER_NAME" | tr '_' ' ')
cat > "$CHAPTER_FILE" << 'EOF'
% !TEX root = ../../Main.tex
% ==============================================================================
% Chapter: CHAPTER_TITLE_PLACEHOLDER
% ==============================================================================
% Description: [Add chapter description here]
% Author: [Your Name]
% Date: CURRENT_DATE
% ==============================================================================
% ------------------------------------------------------------------------------
% Chapter Declaration
% ------------------------------------------------------------------------------
\chapter{CHAPTER_TITLE_PLACEHOLDER}
\label{chap:CHAPTER_LABEL_PLACEHOLDER}
% ------------------------------------------------------------------------------
% Introduction
% ------------------------------------------------------------------------------
% Begin with an introduction to the chapter's content
% ------------------------------------------------------------------------------
[Introduction text for this chapter goes here. Provide an overview of what
will be covered in this chapter.]
% ------------------------------------------------------------------------------
% Section: First Section
% ------------------------------------------------------------------------------
\section{First Section}
\label{sec:CHAPTER_LABEL_PLACEHOLDER_first_section}
[Content for the first section goes here.]
% ------------------------------------------------------------------------------
% Subsection: Example Subsection
% ------------------------------------------------------------------------------
\subsection{Example Subsection}
\label{subsec:CHAPTER_LABEL_PLACEHOLDER_example}
[Subsection content goes here.]
% ------------------------------------------------------------------------------
% Section: Second Section
% ------------------------------------------------------------------------------
\section{Second Section}
\label{sec:CHAPTER_LABEL_PLACEHOLDER_second_section}
[Content for the second section goes here.]
% Example of a figure reference
% \begin{figure}[htbp]
% \centering
% \includegraphics[width=0.8\textwidth]{Content/Images/your_image.png}
% \caption{Caption for your figure}
% \label{fig:CHAPTER_LABEL_PLACEHOLDER_example}
% \end{figure}
% Example of a table
% \begin{table}[htbp]
% \centering
% \caption{Caption for your table}
% \label{tab:CHAPTER_LABEL_PLACEHOLDER_example}
% \begin{tabular}{lcc}
% \toprule
% \textbf{Column 1} & \textbf{Column 2} & \textbf{Column 3} \\
% \midrule
% Data 1 & Value 1 & Result 1 \\
% Data 2 & Value 2 & Result 2 \\
% \bottomrule
% \end{tabular}
% \end{table}
% ------------------------------------------------------------------------------
% Section: Summary
% ------------------------------------------------------------------------------
\section{Summary}
\label{sec:CHAPTER_LABEL_PLACEHOLDER_summary}
[Chapter summary goes here. Summarize the key points covered in this chapter.]
% ==============================================================================
% End of Chapter
% ==============================================================================
EOF
# Replace placeholders
sed -i "s/CHAPTER_TITLE_PLACEHOLDER/$CHAPTER_TITLE/g" "$CHAPTER_FILE"
sed -i "s/CHAPTER_LABEL_PLACEHOLDER/$CHAPTER_NAME/g" "$CHAPTER_FILE"
sed -i "s/CURRENT_DATE/$(date +%Y-%m-%d)/g" "$CHAPTER_FILE"
print_success "Chapter file created: $CHAPTER_FILE"
# ------------------------------------------------------------------------------
# Update Content Loader
# ------------------------------------------------------------------------------
print_info "Updating content loader: 01_content.tex"
# Check if the chapter is already included
if grep -q "$CHAPTER_INPUT_LINE" "$CONTENT_FILE" 2>/dev/null; then
print_info "Chapter already included in content loader"
else
# Add the chapter input line before the END marker
# Using a more robust method to handle the insertion
# Create a temporary file
TEMP_FILE=$(mktemp)
# Process the content file
awk -v input_line="$CHAPTER_INPUT_LINE" '
/^% --- CHAPTER LIST END ---/ {
print input_line
}
{ print }
' "$CONTENT_FILE" > "$TEMP_FILE"
# Move the temporary file back
mv "$TEMP_FILE" "$CONTENT_FILE"
print_success "Added chapter to content loader"
fi
# ------------------------------------------------------------------------------
# Final Output
# ------------------------------------------------------------------------------
echo ""
print_success "Chapter successfully created!"
echo ""
echo "Chapter file: $CHAPTER_FILE"
echo "Chapter will be included in the document automatically."
echo ""
echo "Next steps:"
echo "1. Edit the chapter file to add your content"
echo "2. Build the document with 'make' or 'xelatex Main.tex'"
echo ""
echo "To reference this chapter in other parts of your document, use:"
echo " \\ref{chap:${CHAPTER_NAME}}"

212
scripts/delete_chapter.sh Executable file
View File

@ -0,0 +1,212 @@
#!/bin/bash
# ==============================================================================
# Delete Chapter Script
# ==============================================================================
# Description: Deletes a chapter file and removes it from the content loader
# (01_content.tex)
# Usage: ./scripts/delete_chapter.sh <chapter_filename>
# Example: ./scripts/delete_chapter.sh 02_methodology
# Author: HSRTReport Template
# ==============================================================================
set -e # Exit on error
# ------------------------------------------------------------------------------
# Configuration
# ------------------------------------------------------------------------------
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
CHAPTERS_DIR="$PROJECT_ROOT/Content/Chapters"
CONTENT_FILE="$PROJECT_ROOT/Content/01_content.tex"
BACKUP_DIR="$PROJECT_ROOT/.chapter_backups"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# ------------------------------------------------------------------------------
# Functions
# ------------------------------------------------------------------------------
print_usage() {
echo "Usage: $0 <chapter_filename>"
echo ""
echo "Deletes a chapter file and removes it from the content loader."
echo ""
echo "Arguments:"
echo " chapter_filename Name of the chapter file (with or without .tex extension)"
echo ""
echo "Examples:"
echo " $0 02_methodology"
echo " $0 02_methodology.tex"
echo ""
echo "Note: Deleted files are backed up to .chapter_backups/"
}
print_error() {
echo -e "${RED}Error: $1${NC}" >&2
}
print_success() {
echo -e "${GREEN}$1${NC}"
}
print_info() {
echo -e "${YELLOW} $1${NC}"
}
print_warning() {
echo -e "${YELLOW}$1${NC}"
}
get_chapter_title() {
local file="$1"
# Extract chapter title from \chapter{...} command
if [ -f "$file" ]; then
grep -m 1 "\\\\chapter{" "$file" 2>/dev/null | sed 's/.*\\chapter{\([^}]*\)}.*/\1/' || echo "Untitled"
else
echo "Unknown"
fi
}
# ------------------------------------------------------------------------------
# Input Validation
# ------------------------------------------------------------------------------
# Check if argument provided
if [ $# -ne 1 ]; then
print_error "Invalid number of arguments"
print_usage
exit 1
fi
CHAPTER_NAME="$1"
# Remove .tex extension if provided
CHAPTER_NAME="${CHAPTER_NAME%.tex}"
# Full path to chapter file
CHAPTER_FILE="$CHAPTERS_DIR/${CHAPTER_NAME}.tex"
# Check if file exists
if [ ! -f "$CHAPTER_FILE" ]; then
print_error "Chapter file not found: $CHAPTER_FILE"
echo ""
echo "Available chapters:"
for file in "$CHAPTERS_DIR"/*.tex; do
if [ -f "$file" ]; then
basename "$file"
fi
done
exit 1
fi
# Get chapter information before deletion
CHAPTER_TITLE=$(get_chapter_title "$CHAPTER_FILE")
# ------------------------------------------------------------------------------
# Confirmation
# ------------------------------------------------------------------------------
echo -e "${BLUE}==============================================================================
Chapter Deletion
==============================================================================${NC}"
echo ""
echo "You are about to delete:"
echo " File: $(basename "$CHAPTER_FILE")"
echo " Title: $CHAPTER_TITLE"
echo " Full path: $CHAPTER_FILE"
echo ""
print_warning "This action will:"
echo " 1. Back up the file to .chapter_backups/"
echo " 2. Delete the chapter file"
echo " 3. Remove it from 01_content.tex (if included)"
echo ""
echo -n "Are you sure you want to continue? (y/N): "
read -r response
if [[ ! "$response" =~ ^[Yy]$ ]]; then
echo "Deletion cancelled."
exit 0
fi
# ------------------------------------------------------------------------------
# Create Backup
# ------------------------------------------------------------------------------
print_info "Creating backup..."
# Create backup directory if it doesn't exist
mkdir -p "$BACKUP_DIR"
# Generate backup filename with timestamp
TIMESTAMP=$(date +"%Y%m%d_%H%M%S")
BACKUP_FILE="$BACKUP_DIR/${CHAPTER_NAME}_${TIMESTAMP}.tex"
# Copy file to backup
cp "$CHAPTER_FILE" "$BACKUP_FILE"
print_success "Backup created: $BACKUP_FILE"
# ------------------------------------------------------------------------------
# Remove from Content Loader
# ------------------------------------------------------------------------------
print_info "Removing from content loader..."
# Create the input line pattern to search for
CHAPTER_INPUT_LINE="\\\\input{Content/Chapters/${CHAPTER_NAME}}"
# Check if the chapter is included in content file
if grep -q "$CHAPTER_INPUT_LINE" "$CONTENT_FILE" 2>/dev/null; then
# Create a temporary file
TEMP_FILE=$(mktemp)
# Remove the line containing the chapter input
grep -v "$CHAPTER_INPUT_LINE" "$CONTENT_FILE" > "$TEMP_FILE"
# Move the temporary file back
mv "$TEMP_FILE" "$CONTENT_FILE"
print_success "Removed from content loader"
else
print_info "Chapter was not included in content loader"
fi
# ------------------------------------------------------------------------------
# Delete Chapter File
# ------------------------------------------------------------------------------
print_info "Deleting chapter file..."
rm "$CHAPTER_FILE"
print_success "Chapter file deleted"
# ------------------------------------------------------------------------------
# Final Summary
# ------------------------------------------------------------------------------
echo ""
echo -e "${GREEN}==============================================================================
Chapter Successfully Deleted
==============================================================================${NC}"
echo ""
echo "Summary:"
echo " ✓ Chapter file deleted: $(basename "$CHAPTER_FILE")"
echo " ✓ Backup saved to: $(basename "$BACKUP_FILE")"
if grep -q "$CHAPTER_INPUT_LINE" "$CONTENT_FILE" 2>/dev/null; then
echo " ✓ Removed from document"
fi
echo ""
echo "Recovery options:"
echo " To restore this chapter, copy the backup file back:"
echo " cp \"$BACKUP_FILE\" \"$CHAPTER_FILE\""
echo ""
echo " To re-include in document after restoration:"
echo " Add the following line to Content/01_content.tex:"
echo " $CHAPTER_INPUT_LINE"
echo ""
echo "All backups are stored in: .chapter_backups/"

211
scripts/list_chapters.sh Executable file
View File

@ -0,0 +1,211 @@
#!/bin/bash
# ==============================================================================
# List Chapters Script
# ==============================================================================
# Description: Lists all chapter files in the project and shows their inclusion
# status in the content loader
# Usage: ./scripts/list_chapters.sh
# Author: HSRTReport Template
# ==============================================================================
set -e # Exit on error
# ------------------------------------------------------------------------------
# Configuration
# ------------------------------------------------------------------------------
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
CHAPTERS_DIR="$PROJECT_ROOT/Content/Chapters"
CONTENT_FILE="$PROJECT_ROOT/Content/01_content.tex"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
NC='\033[0m' # No Color
# ------------------------------------------------------------------------------
# Functions
# ------------------------------------------------------------------------------
print_header() {
echo -e "${BLUE}==============================================================================
Chapter Management - File List
==============================================================================${NC}"
}
print_success() {
echo -e "${GREEN}${NC} $1"
}
print_warning() {
echo -e "${YELLOW}${NC} $1"
}
print_error() {
echo -e "${RED}${NC} $1"
}
get_chapter_title() {
local file="$1"
# Extract chapter title from \chapter{...} command
if [ -f "$file" ]; then
grep -m 1 "\\\\chapter{" "$file" 2>/dev/null | sed 's/.*\\chapter{\([^}]*\)}.*/\1/' || echo "Untitled"
else
echo "File not found"
fi
}
is_included() {
local chapter_name="$1"
# Check if chapter is included in content file
if grep -q "\\\\input{Content/Chapters/$chapter_name}" "$CONTENT_FILE" 2>/dev/null; then
return 0
else
return 1
fi
}
# ------------------------------------------------------------------------------
# Main Script
# ------------------------------------------------------------------------------
print_header
echo ""
# Check if chapters directory exists
if [ ! -d "$CHAPTERS_DIR" ]; then
print_error "Chapters directory not found: $CHAPTERS_DIR"
exit 1
fi
# Get all .tex files in chapters directory
CHAPTER_FILES=()
while IFS= read -r -d '' file; do
CHAPTER_FILES+=("$file")
done < <(find "$CHAPTERS_DIR" -maxdepth 1 -name "*.tex" -type f -print0 | sort -z)
if [ ${#CHAPTER_FILES[@]} -eq 0 ]; then
echo "No chapter files found in $CHAPTERS_DIR"
echo ""
echo "To create a new chapter, use:"
echo " ./scripts/create_chapter.sh <number> <name>"
echo ""
echo "Example:"
echo " ./scripts/create_chapter.sh 01 introduction"
exit 0
fi
# ------------------------------------------------------------------------------
# Display Chapter List
# ------------------------------------------------------------------------------
echo -e "${CYAN}Found ${#CHAPTER_FILES[@]} chapter file(s):${NC}"
echo ""
# Table header
printf "%-6s %-30s %-40s %-10s\n" "No." "File Name" "Chapter Title" "Status"
printf "%-6s %-30s %-40s %-10s\n" "---" "$(printf '%30s' | tr ' ' '-')" "$(printf '%40s' | tr ' ' '-')" "----------"
# List each chapter
for i in "${!CHAPTER_FILES[@]}"; do
FILE="${CHAPTER_FILES[$i]}"
BASENAME=$(basename "$FILE")
FILENAME="${BASENAME%.*}"
TITLE=$(get_chapter_title "$FILE")
# Truncate long titles
if [ ${#TITLE} -gt 38 ]; then
TITLE="${TITLE:0:35}..."
fi
# Check if included
if is_included "$FILENAME"; then
STATUS="${GREEN}Included${NC}"
else
STATUS="${YELLOW}Not included${NC}"
fi
printf "%-6s %-30s %-40s " "$((i+1))." "$BASENAME" "$TITLE"
echo -e "$STATUS"
done
echo ""
# ------------------------------------------------------------------------------
# Statistics
# ------------------------------------------------------------------------------
echo -e "${BLUE}------------------------------------------------------------------------------${NC}"
echo "Statistics:"
# Count included chapters
INCLUDED_COUNT=0
NOT_INCLUDED_COUNT=0
for FILE in "${CHAPTER_FILES[@]}"; do
BASENAME=$(basename "$FILE")
FILENAME="${BASENAME%.*}"
if is_included "$FILENAME"; then
((INCLUDED_COUNT++)) || true
else
((NOT_INCLUDED_COUNT++)) || true
fi
done
echo " Total chapters: ${#CHAPTER_FILES[@]}"
echo -e " Included in document: ${GREEN}$INCLUDED_COUNT${NC}"
echo -e " Not included: ${YELLOW}$NOT_INCLUDED_COUNT${NC}"
# ------------------------------------------------------------------------------
# Chapter Order in Document
# ------------------------------------------------------------------------------
echo ""
echo -e "${BLUE}------------------------------------------------------------------------------${NC}"
echo "Chapter order in document (01_content.tex):"
echo ""
# Extract included chapters from content file
if [ -f "$CONTENT_FILE" ]; then
INCLUDED_CHAPTERS=()
while IFS= read -r line; do
if [[ "$line" =~ \\input\{Content/Chapters/([^}]+)\} ]]; then
INCLUDED_CHAPTERS+=("${BASH_REMATCH[1]}.tex")
fi
done < <(sed -n '/% --- CHAPTER LIST START ---/,/% --- CHAPTER LIST END ---/p' "$CONTENT_FILE")
if [ ${#INCLUDED_CHAPTERS[@]} -gt 0 ]; then
for i in "${!INCLUDED_CHAPTERS[@]}"; do
CHAPTER="${INCLUDED_CHAPTERS[$i]}"
TITLE=$(get_chapter_title "$CHAPTERS_DIR/$CHAPTER")
printf " %2d. %-30s %s\n" "$((i+1))" "$CHAPTER" "($TITLE)"
done
else
echo " (No chapters currently included)"
fi
else
print_error "Content file not found: $CONTENT_FILE"
fi
# ------------------------------------------------------------------------------
# Help Information
# ------------------------------------------------------------------------------
echo ""
echo -e "${BLUE}------------------------------------------------------------------------------${NC}"
echo "Available commands:"
echo ""
echo " Create chapter: ./scripts/create_chapter.sh <number> <name>"
echo " List chapters: ./scripts/list_chapters.sh"
echo " Delete chapter: ./scripts/delete_chapter.sh <filename>"
echo " Show chapter: ./scripts/show_chapter.sh <filename>"
echo ""
echo "To manually include/exclude chapters, edit: Content/01_content.tex"
echo ""
# Exit successfully
exit 0

300
scripts/show_chapter.sh Executable file
View File

@ -0,0 +1,300 @@
#!/bin/bash
# ==============================================================================
# Show Chapter Script
# ==============================================================================
# Description: Displays information and content of a specific chapter file
# Usage: ./scripts/show_chapter.sh <chapter_filename>
# Example: ./scripts/show_chapter.sh 02_methodology
# Author: HSRTReport Template
# ==============================================================================
set -e # Exit on error
# ------------------------------------------------------------------------------
# Configuration
# ------------------------------------------------------------------------------
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
CHAPTERS_DIR="$PROJECT_ROOT/Content/Chapters"
CONTENT_FILE="$PROJECT_ROOT/Content/01_content.tex"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
MAGENTA='\033[0;35m'
NC='\033[0m' # No Color
# ------------------------------------------------------------------------------
# Functions
# ------------------------------------------------------------------------------
print_usage() {
echo "Usage: $0 <chapter_filename> [options]"
echo ""
echo "Displays information and content of a specific chapter file."
echo ""
echo "Arguments:"
echo " chapter_filename Name of the chapter file (with or without .tex extension)"
echo ""
echo "Options:"
echo " -h, --head N Show only first N lines of content (default: all)"
echo " -i, --info Show only file information, no content"
echo " -s, --structure Show only document structure (chapters, sections)"
echo ""
echo "Examples:"
echo " $0 02_methodology"
echo " $0 02_methodology.tex --head 50"
echo " $0 01_introduction --info"
echo " $0 03_results --structure"
}
print_error() {
echo -e "${RED}Error: $1${NC}" >&2
}
print_success() {
echo -e "${GREEN}$1${NC}"
}
print_info() {
echo -e "${YELLOW} $1${NC}"
}
print_header() {
echo -e "${BLUE}$1${NC}"
}
get_chapter_title() {
local file="$1"
if [ -f "$file" ]; then
grep -m 1 "\\\\chapter{" "$file" 2>/dev/null | sed 's/.*\\chapter{\([^}]*\)}.*/\1/' || echo "Untitled"
else
echo "Unknown"
fi
}
get_chapter_label() {
local file="$1"
if [ -f "$file" ]; then
grep -m 1 "\\\\label{chap:" "$file" 2>/dev/null | sed 's/.*\\label{chap:\([^}]*\)}.*/\1/' || echo "no-label"
else
echo "unknown"
fi
}
is_included() {
local chapter_name="$1"
if grep -q "\\\\input{Content/Chapters/$chapter_name}" "$CONTENT_FILE" 2>/dev/null; then
return 0
else
return 1
fi
}
count_lines() {
local file="$1"
wc -l < "$file"
}
count_words() {
local file="$1"
# Count words excluding LaTeX commands (approximate)
sed 's/\\[a-zA-Z]*\({[^}]*}\)\?//g' "$file" | wc -w
}
get_file_size() {
local file="$1"
local size=$(stat -c%s "$file" 2>/dev/null || stat -f%z "$file" 2>/dev/null)
if [ "$size" -lt 1024 ]; then
echo "${size} bytes"
elif [ "$size" -lt 1048576 ]; then
echo "$((size / 1024)) KB"
else
echo "$((size / 1048576)) MB"
fi
}
get_modification_date() {
local file="$1"
stat -c%y "$file" 2>/dev/null | cut -d' ' -f1 || stat -f "%Sm" -t "%Y-%m-%d" "$file" 2>/dev/null || echo "Unknown"
}
show_structure() {
local file="$1"
echo -e "${CYAN}Document Structure:${NC}"
echo ""
# Extract chapters, sections, subsections
grep -n "\\\\chapter\|\\\\section\|\\\\subsection" "$file" | while IFS=: read -r line_num content; do
if [[ "$content" =~ \\chapter ]]; then
title=$(echo "$content" | sed 's/.*\\chapter{\([^}]*\)}.*/\1/')
echo -e "${MAGENTA}[$line_num] CHAPTER: $title${NC}"
elif [[ "$content" =~ \\section ]]; then
title=$(echo "$content" | sed 's/.*\\section{\([^}]*\)}.*/\1/')
echo -e "${BLUE} [$line_num] Section: $title${NC}"
elif [[ "$content" =~ \\subsection ]]; then
title=$(echo "$content" | sed 's/.*\\subsection{\([^}]*\)}.*/\1/')
echo -e "${CYAN} [$line_num] Subsection: $title${NC}"
fi
done
}
# ------------------------------------------------------------------------------
# Parse Arguments
# ------------------------------------------------------------------------------
if [ $# -eq 0 ]; then
print_error "No arguments provided"
print_usage
exit 1
fi
CHAPTER_NAME="$1"
shift
# Default options
SHOW_HEAD=0
INFO_ONLY=false
STRUCTURE_ONLY=false
# Parse options
while [[ $# -gt 0 ]]; do
case $1 in
-h|--head)
SHOW_HEAD="$2"
shift 2
;;
-i|--info)
INFO_ONLY=true
shift
;;
-s|--structure)
STRUCTURE_ONLY=true
shift
;;
--help)
print_usage
exit 0
;;
*)
print_error "Unknown option: $1"
print_usage
exit 1
;;
esac
done
# ------------------------------------------------------------------------------
# Validate Input
# ------------------------------------------------------------------------------
# Remove .tex extension if provided
CHAPTER_NAME="${CHAPTER_NAME%.tex}"
# Full path to chapter file
CHAPTER_FILE="$CHAPTERS_DIR/${CHAPTER_NAME}.tex"
# Check if file exists
if [ ! -f "$CHAPTER_FILE" ]; then
print_error "Chapter file not found: $CHAPTER_FILE"
echo ""
echo "Available chapters:"
for file in "$CHAPTERS_DIR"/*.tex; do
if [ -f "$file" ]; then
echo " - $(basename "$file" .tex)"
fi
done
exit 1
fi
# ------------------------------------------------------------------------------
# Display Chapter Information
# ------------------------------------------------------------------------------
echo -e "${BLUE}==============================================================================
Chapter Information
==============================================================================${NC}"
echo ""
# Basic information
echo -e "${CYAN}File Information:${NC}"
echo " File name: $(basename "$CHAPTER_FILE")"
echo " Full path: $CHAPTER_FILE"
echo " File size: $(get_file_size "$CHAPTER_FILE")"
echo " Modified: $(get_modification_date "$CHAPTER_FILE")"
echo " Line count: $(count_lines "$CHAPTER_FILE")"
echo " Word count: ~$(count_words "$CHAPTER_FILE") words (approximate)"
echo ""
# Chapter metadata
echo -e "${CYAN}Chapter Metadata:${NC}"
echo " Title: $(get_chapter_title "$CHAPTER_FILE")"
echo " Label: chap:$(get_chapter_label "$CHAPTER_FILE")"
if is_included "$CHAPTER_NAME"; then
echo -e " Status: ${GREEN}Included in document${NC}"
else
echo -e " Status: ${YELLOW}Not included in document${NC}"
fi
echo ""
# ------------------------------------------------------------------------------
# Show Structure if Requested
# ------------------------------------------------------------------------------
if [ "$STRUCTURE_ONLY" = true ]; then
show_structure "$CHAPTER_FILE"
exit 0
fi
# ------------------------------------------------------------------------------
# Exit if Info Only
# ------------------------------------------------------------------------------
if [ "$INFO_ONLY" = true ]; then
exit 0
fi
# ------------------------------------------------------------------------------
# Display Chapter Content
# ------------------------------------------------------------------------------
echo -e "${BLUE}------------------------------------------------------------------------------${NC}"
echo -e "${CYAN}Chapter Content:${NC}"
echo -e "${BLUE}------------------------------------------------------------------------------${NC}"
echo ""
if [ "$SHOW_HEAD" -gt 0 ]; then
head -n "$SHOW_HEAD" "$CHAPTER_FILE"
echo ""
echo -e "${YELLOW}... (showing first $SHOW_HEAD lines, $(count_lines "$CHAPTER_FILE") total lines)${NC}"
else
cat "$CHAPTER_FILE"
fi
echo ""
echo -e "${BLUE}------------------------------------------------------------------------------${NC}"
echo -e "${CYAN}End of Chapter${NC}"
echo -e "${BLUE}------------------------------------------------------------------------------${NC}"
# ------------------------------------------------------------------------------
# Show Related Commands
# ------------------------------------------------------------------------------
echo ""
echo "Related commands:"
echo " Edit this chapter: \$EDITOR \"$CHAPTER_FILE\""
echo " Show structure only: $0 $CHAPTER_NAME --structure"
echo " Show info only: $0 $CHAPTER_NAME --info"
if ! is_included "$CHAPTER_NAME"; then
echo ""
echo "To include this chapter in the document, add the following line to"
echo "Content/01_content.tex in the marked chapter section:"
echo " \\input{Content/Chapters/$CHAPTER_NAME}"
fi