Compare commits

...

40 Commits

Author SHA1 Message Date
nuluh
63da3b6308 fix(latex): remove titlepage environment from frontmattersection macro to make the \frontmatter and \mainmatter pagination number type change properly
Closes #57
2025-05-12 00:31:24 +07:00
nuluh
07ed6a9a13 fix(latex): reorder document structure by moving \frontmatter and \mainmatter for proper page numbering 2025-05-11 22:54:02 +07:00
nuluh
1b20376700 Merge branch 'latex/initial-template' into latex/57-feat-add-dynamic-page-style-for-chapter-page 2025-05-11 22:15:40 +07:00
nuluh
104b72e624 fix(latex): remove second \hfill in the \cftaftertoctitle to fix the \contentsname with book document class 2025-05-11 22:15:05 +07:00
nuluh
e9568583e4 fix(latex): change document class from report to book for having access to \frontmatter, \mainmatter, and \backmatter 2025-05-11 22:13:46 +07:00
nuluh
ae201d61fa Merge branch 'latex/initial-template' into latex/57-feat-add-dynamic-page-style-for-chapter-page 2025-05-11 21:56:14 +07:00
nuluh
921dc9245c fix(latex): add draft watermark functionality with conditional loading 2025-05-11 19:32:13 +07:00
nuluh
bf3c43639d fix(latex): update page layout margins to 3cm for all sides 2025-05-11 18:26:46 +07:00
nuluh
f38d44df1d fix(latex): add dummy introductory chapter and sections for doing unittest of new implemented page number and chapter numbering 2025-05-11 13:00:53 +07:00
nuluh
5c70d7db51 fix(latex): ensure fancyplain page style preset is applied before content inclusion so it use top right number for non-first-page chapter 2025-05-11 12:54:55 +07:00
nuluh
702760cc5e fix(latex): assign fancyhdr preset page style to frontmatter section macro 2025-05-11 12:52:52 +07:00
nuluh
43a0f40182 fix(latex): creating header and footer styles preset 2025-05-11 12:51:23 +07:00
nuluh
92a7143d90 fix(latex): update frontmatter section command to correctly add TOC entries as chapters 2025-05-11 11:38:53 +07:00
nuluh
5e08d4f8c6 fix(latex): remove custom table of contents command since it doesnt give any effects when directly \renewcommand without through packages 2025-05-11 11:21:50 +07:00
nuluh
907f725fa7 fix(latex): remove redundant command for chapter dot separation in TOC 2025-05-11 11:13:20 +07:00
nuluh
676b2b1a87 fix(latex): remove accidental prefix 'chapter' string in TOC and fix the section numbering to keep using chapter's counter in arabic instead of inherited in roman 2025-05-11 11:12:50 +07:00
nuluh
e0fbc23257 fix(latex): ensure TOC and references respect custom numbering by redefining \thechapter to preserve the roman in TOC 2025-05-11 11:09:24 +07:00
nuluh
39f966e71b chore(latex): clarify comment for TOC title styling in thesis class 2025-05-11 10:56:32 +07:00
nuluh
740680d1c7 fix(latex): fix \contentsname to keep the title centered by adding dummy second \hfill in the \cftaftertoctitle when using \fancypagestyle or other fancyhdr effects 2025-05-11 10:45:42 +07:00
nuluh
2db5170366 fix(latex): correct chapter dot leaders and page font in table of contents to be all normalfont for all level instead of bfseries 2025-05-11 10:41:40 +07:00
nuluh
f83b890055 fix(latex): add tocbibind package to include toc itself in the toc and give dot leaders to it. 2025-05-11 10:23:30 +07:00
nuluh
7820dd580a feat(latex): add endorsement page with committee approval details and department head information 2025-05-11 08:37:19 +07:00
nuluh
6c0fb67b86 refactor(latex): refactor metadata commands for thesis information and load from external file to implement reusability 2025-05-11 01:08:49 +07:00
nuluh
792ed64027 fix(latex): adjust section number width in table of contents for best desired looks 2025-05-11 00:48:57 +07:00
nuluh
c57a916a1a fixlatex): fix chapter formatting and spacing in thesis class to be aligned at before chapter number and restyle \chapter to be centered and use hardcoded prefix "BAB" following with roman numbering 2025-05-10 18:50:41 +07:00
nuluh
ca668ffc5f feat(latex): add endorsement and originality statements to the document 2025-05-10 17:39:36 +07:00
nuluh
8d09adefd4 fix(latex): rename endorsement page command to avoid core LaTeX primitive for ending environments.
Closes #56
2025-05-10 17:36:15 +07:00
nuluh
05926e3857 feat(latex): add originality frontmatter file 2025-05-10 17:20:25 +07:00
nuluh
d13dfdc34e feat(latex): add frontmatter macros for frontmatters pages (endorsement, originality, approval, acknowledgement etc.) 2025-05-10 17:17:51 +07:00
nuluh
6b866b9ed5 feat(latex): create thesis class and initial document structure with title page and macros 2025-05-10 16:23:39 +07:00
nuluh
4a796694bf feat(latex): add new research papers to appendix with detailed summaries and findings 2025-05-07 00:41:09 +07:00
nuluh
6357136e6c fix(latex): add gap researsch table and adjust column widths in summary table for better layout 2025-05-07 00:37:25 +07:00
nuluh
c7584e2dd8 fix(latex): adjust column count for continuation message in summary table 2025-05-06 16:37:58 +07:00
nuluh
80ee9a3ec4 refactor(latex): update table into new format and comments in summary related paper document 2025-05-06 16:31:36 +07:00
nuluh
f9f346a57e feat(latex): add initial template summary related paper document with structured references 2025-05-06 16:09:51 +07:00
nuluh
cb380219f9 test(notebooks): update file paths for sensor data loading and add markdown for clarity 2025-04-21 00:07:06 +07:00
nuluh
804c178175 fix(notebooks): remove erroneous line and add markdown for testing outside training data 2025-04-20 16:32:31 +07:00
Rifqi D. Panuluh
28681017ad Merge pull request #39 from nuluh/feature/38-feat-redesign-convertpy
Feature/38 feat redesign `convert.py`
2025-03-22 19:57:20 +07:00
nuluh
ff64f3a3ab refactor(data): update type annotations for damage files index and related classes. Need better implementation 2025-03-22 19:48:50 +07:00
nuluh
58a316d9c8 feat(data): implement damage files index generation and data processing
Closes #38
2025-03-21 15:58:50 +07:00
18 changed files with 1241 additions and 31 deletions

View File

@@ -324,9 +324,9 @@
"import pandas as pd\n",
"import matplotlib.pyplot as plt\n",
"ready_data1 = []\n",
"for file in os.listdir('D:/thesis/data/working/sensor1'):\n",
" ready_data1.append(pd.read_csv(os.path.join('D:/thesis/data/working/sensor1', file)))\n",
"# ready_data1[1]\n",
"for file in os.listdir('D:/thesis/data/converted/raw/sensor1'):\n",
" ready_data1.append(pd.read_csv(os.path.join('D:/thesis/data/converted/raw/sensor1', file)))\n",
"ready_data1[0]\n",
"# colormesh give title x is frequency and y is time and rotate/transpose the data\n",
"# Plotting the STFT Data"
]
@@ -362,8 +362,8 @@
"outputs": [],
"source": [
"ready_data2 = []\n",
"for file in os.listdir('D:/thesis/data/working/sensor2'):\n",
" ready_data2.append(pd.read_csv(os.path.join('D:/thesis/data/working/sensor2', file)))\n",
"for file in os.listdir('D:/thesis/data/converted/raw/sensor2'):\n",
" ready_data2.append(pd.read_csv(os.path.join('D:/thesis/data/converted/raw/sensor2', file)))\n",
"ready_data2[5]"
]
},
@@ -407,6 +407,13 @@
"print(x2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Appending"
]
},
{
"cell_type": "code",
"execution_count": null,
@@ -448,15 +455,10 @@
]
},
{
"cell_type": "code",
"execution_count": null,
"cell_type": "markdown",
"metadata": {},
"outputs": [],
"source": [
"y_1 = [1,1,1,1]\n",
"y_2 = [0,1,1,1]\n",
"y_3 = [1,0,1,1]\n",
"y_4 = [1,1,0,0]"
"### Labeling"
]
},
{
@@ -492,6 +494,16 @@
" print(ready_data1[i].shape[0])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"for i in range(len(y_data)):\n",
" print(ready_data2[i].shape[0])"
]
},
{
"cell_type": "code",
"execution_count": null,
@@ -509,7 +521,8 @@
"metadata": {},
"outputs": [],
"source": [
"y_data"
"# len(y_data[0])\n",
"y_data[0]"
]
},
{
@@ -793,7 +806,6 @@
"\n",
" # df1['s1'] = sensor1[sensor1.columns[-1]]\n",
" # df1['s2'] = sensor2[sensor2.columns[-1]]\n",
"ed\n",
" # # Combined Plot for sensor 1 and sensor 2 from data1 file in which motor is operated at 800 rpm\n",
"\n",
" # plt.plot(df1['s2'], label='sensor 2')\n",
@@ -823,14 +835,19 @@
" # plt.show()"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Test with Outside of Its Training Data"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"spectograph('D:/thesis/data/converted/raw')"
]
"source": []
}
],
"metadata": {

View File

@@ -1,16 +1,266 @@
import pandas as pd
import os
import re
import sys
from colorama import Fore, Style, init
from typing import TypedDict, Dict, List
from joblib import load
from pprint import pprint
# class DamageFilesIndices(TypedDict):
# damage_index: int
# files: list[int]
OriginalSingleDamageScenarioFilePath = str
DamageScenarioGroupIndex = int
OriginalSingleDamageScenario = pd.DataFrame
SensorIndex = int
VectorColumnIndex = List[SensorIndex]
VectorColumnIndices = List[VectorColumnIndex]
DamageScenarioGroup = List[OriginalSingleDamageScenario]
GroupDataset = List[DamageScenarioGroup]
class DamageFilesIndices(TypedDict):
damage_index: int
files: List[str]
def generate_damage_files_index(**kwargs) -> DamageFilesIndices:
prefix: str = kwargs.get("prefix", "zzzAD")
extension: str = kwargs.get("extension", ".TXT")
num_damage: int = kwargs.get("num_damage")
file_index_start: int = kwargs.get("file_index_start")
col: int = kwargs.get("col")
base_path: str = kwargs.get("base_path")
damage_scenarios = {}
a = file_index_start
b = col + 1
for i in range(1, num_damage + 1):
damage_scenarios[i] = range(a, b)
a += col
b += col
# return damage_scenarios
x = {}
for damage, files in damage_scenarios.items():
x[damage] = [] # Initialize each key with an empty list
for i, file_index in enumerate(files, start=1):
if base_path:
x[damage].append(
os.path.normpath(
os.path.join(base_path, f"{prefix}{file_index}{extension}")
)
)
# if not os.path.exists(file_path):
# print(Fore.RED + f"File {file_path} does not exist.")
# continue
else:
x[damage].append(f"{prefix}{file_index}{extension}")
return x
# file_path = os.path.join(base_path, f"zzz{prefix}D{file_index}.TXT")
# df = pd.read_csv( file_path, sep="\t", skiprows=10) # Read with explicit column names
class DataProcessor:
def __init__(self, file_index: DamageFilesIndices, cache_path: str = None):
self.file_index = file_index
if cache_path:
self.data = load(cache_path)
else:
self.data = self._load_all_data()
def _extract_column_names(self, file_path: str) -> List[str]:
"""
Extracts column names from the header of the given file.
Assumes the 6th line contains column names.
:param file_path: Path to the data file.
:return: List of column names.
"""
with open(file_path, "r") as f:
header_lines = [next(f) for _ in range(12)]
# Extract column names from the 6th line
channel_line = header_lines[10].strip()
tokens = re.findall(r'"([^"]+)"', channel_line)
if not channel_line.startswith('"'):
first_token = channel_line.split()[0]
tokens = [first_token] + tokens
return tokens # Prepend 'Time' column if applicable
def _load_dataframe(self, file_path: str) -> OriginalSingleDamageScenario:
"""
Loads a single data file into a pandas DataFrame.
:param file_path: Path to the data file.
:return: DataFrame containing the numerical data.
"""
col_names = self._extract_column_names(file_path)
df = pd.read_csv(
file_path, delim_whitespace=True, skiprows=11, header=None, memory_map=True
)
df.columns = col_names
return df
def _load_all_data(self) -> GroupDataset:
"""
Loads all data files based on the grouping dictionary and returns a nested list.
:return: A nested list of DataFrames where the outer index corresponds to group_idx - 1.
"""
data = []
# Find the maximum group index to determine the list size
max_group_idx = max(self.file_index.keys()) if self.file_index else 0
# Initialize empty lists
for _ in range(max_group_idx):
data.append([])
# Fill the list with data
for group_idx, file_list in self.file_index.items():
# Adjust index to be 0-based
list_idx = group_idx - 1
data[list_idx] = [self._load_dataframe(file) for file in file_list]
return data
def get_group_data(self, group_idx: int) -> List[pd.DataFrame]:
"""
Returns the list of DataFrames for the given group index.
:param group_idx: Index of the group.
:return: List of DataFrames.
"""
return self.data.get([group_idx, []])
def get_column_names(self, group_idx: int, file_idx: int = 0) -> List[str]:
"""
Returns the column names for the given group and file indices.
:param group_idx: Index of the group.
:param file_idx: Index of the file in the group.
:return: List of column names.
"""
if group_idx in self.data and len(self.data[group_idx]) > file_idx:
return self.data[group_idx][file_idx].columns.tolist()
return []
def get_data_info(self):
"""
Print information about the loaded data structure.
Adapted for when self.data is a List instead of a Dictionary.
"""
if isinstance(self.data, list):
# For each sublist in self.data, get the type names of all elements
pprint(
[
(
[type(item).__name__ for item in sublist]
if isinstance(sublist, list)
else type(sublist).__name__
)
for sublist in self.data
]
)
else:
pprint(
{
key: [type(df).__name__ for df in value]
for key, value in self.data.items()
}
if isinstance(self.data, dict)
else type(self.data).__name__
)
def _create_vector_column_index(self) -> VectorColumnIndices:
vector_col_idx: VectorColumnIndices = []
y = 0
for data_group in self.data: # len(data_group[i]) = 5
for j in data_group: # len(j[i]) =
c: VectorColumnIndex = [] # column vector c_{j}
x = 0
for _ in range(6): # TODO: range(6) should be dynamic and parameterized
c.append(x + y)
x += 5
vector_col_idx.append(c)
y += 1
return vector_col_idx
def create_vector_column(self, overwrite=True) -> List[List[List[pd.DataFrame]]]:
"""
Create a vector column from the loaded data.
:param overwrite: Overwrite the original data with vector column-based data.
"""
idx = self._create_vector_column_index()
# if overwrite:
for i in range(len(self.data)):
for j in range(len(self.data[i])):
# Get the appropriate indices for slicing from idx
indices = idx[j]
# Get the current DataFrame
df = self.data[i][j]
# Keep the 'Time' column and select only specified 'Real' columns
# First, we add 1 to all indices to account for 'Time' being at position 0
real_indices = [index + 1 for index in indices]
# Create list with Time column index (0) and the adjusted Real indices
all_indices = [0] + real_indices
# Apply the slicing
self.data[i][j] = df.iloc[:, all_indices]
# TODO: if !overwrite:
def create_limited_sensor_vector_column(self, overwrite=True):
"""
Create a vector column from the loaded data.
:param overwrite: Overwrite the original data with vector column-based data.
"""
idx = self._create_vector_column_index()
# if overwrite:
for i in range(len(self.data)):
for j in range(len(self.data[i])):
# Get the appropriate indices for slicing from idx
indices = idx[j]
# Get the current DataFrame
df = self.data[i][j]
# Keep the 'Time' column and select only specified 'Real' columns
# First, we add 1 to all indices to account for 'Time' being at position 0
real_indices = [index + 1 for index in indices]
# Create list with Time column index (0) and the adjusted Real indices
all_indices = [0] + [real_indices[0]] + [real_indices[-1]]
# Apply the slicing
self.data[i][j] = df.iloc[:, all_indices]
# TODO: if !overwrite:
def create_damage_files(base_path, output_base, prefix):
# Initialize colorama
init(autoreset=True)
# Generate column labels based on expected duplication in input files
columns = ['Real'] + [f'Real.{i}' for i in range(1, 30)] # Explicitly setting column names
columns = ["Real"] + [
f"Real.{i}" for i in range(1, 30)
] # Explicitly setting column names
sensor_end_map = {1: 'Real.25', 2: 'Real.26', 3: 'Real.27', 4: 'Real.28', 5: 'Real.29'}
sensor_end_map = {
1: "Real.25",
2: "Real.26",
3: "Real.27",
4: "Real.28",
5: "Real.29",
}
# Define the damage scenarios and the corresponding original file indices
damage_scenarios = {
@@ -19,7 +269,7 @@ def create_damage_files(base_path, output_base, prefix):
3: range(11, 16), # Damage 3 files from zzzAD11.csv to zzzAD15.csvs
4: range(16, 21), # Damage 4 files from zzzAD16.csv to zzzAD20.csv
5: range(21, 26), # Damage 5 files from zzzAD21.csv to zzzAD25.csv
6: range(26, 31) # Damage 6 files from zzzAD26.csv to zzzAD30.csv
6: range(26, 31), # Damage 6 files from zzzAD26.csv to zzzAD30.csv
}
damage_pad = len(str(len(damage_scenarios)))
test_pad = len(str(30))
@@ -27,29 +277,36 @@ def create_damage_files(base_path, output_base, prefix):
for damage, files in damage_scenarios.items():
for i, file_index in enumerate(files, start=1):
# Load original data file
file_path = os.path.join(base_path, f'zzz{prefix}D{file_index}.TXT')
df = pd.read_csv(file_path, sep='\t', skiprows=10) # Read with explicit column names
file_path = os.path.join(base_path, f"zzz{prefix}D{file_index}.TXT")
df = pd.read_csv(
file_path, sep="\t", skiprows=10
) # Read with explicit column names
top_sensor = columns[i-1]
top_sensor = columns[i - 1]
print(top_sensor, type(top_sensor))
output_file_1 = os.path.join(output_base, f'DAMAGE_{damage}', f'DAMAGE{damage}_TEST{i}_01.csv')
output_file_1 = os.path.join(
output_base, f"DAMAGE_{damage}", f"DAMAGE{damage}_TEST{i}_01.csv"
)
print(f"Creating {output_file_1} from taking zzz{prefix}D{file_index}.TXT")
print("Taking datetime column on index 0...")
print(f"Taking `{top_sensor}`...")
os.makedirs(os.path.dirname(output_file_1), exist_ok=True)
df[['Time', top_sensor]].to_csv(output_file_1, index=False)
df[["Time", top_sensor]].to_csv(output_file_1, index=False)
print(Fore.GREEN + "Done")
bottom_sensor = sensor_end_map[i]
output_file_2 = os.path.join(output_base, f'DAMAGE_{damage}', f'DAMAGE{damage}_TEST{i}_02.csv')
output_file_2 = os.path.join(
output_base, f"DAMAGE_{damage}", f"DAMAGE{damage}_TEST{i}_02.csv"
)
print(f"Creating {output_file_2} from taking zzz{prefix}D{file_index}.TXT")
print("Taking datetime column on index 0...")
print(f"Taking `{bottom_sensor}`...")
os.makedirs(os.path.dirname(output_file_2), exist_ok=True)
df[['Time', bottom_sensor]].to_csv(output_file_2, index=False)
df[["Time", bottom_sensor]].to_csv(output_file_2, index=False)
print(Fore.GREEN + "Done")
print("---")
def main():
if len(sys.argv) < 2:
print("Usage: python convert.py <path_to_csv_files>")
@@ -66,5 +323,6 @@ def main():
create_damage_files(base_path, output_base, prefix)
print(Fore.YELLOW + Style.BRIGHT + "All files have been created successfully.")
if __name__ == "__main__":
main()

8
data/QUGS/test.py Normal file
View File

@@ -0,0 +1,8 @@
from convert import *
from joblib import dump, load
# a = generate_damage_files_index(
# num_damage=6, file_index_start=1, col=5, base_path="D:/thesis/data/dataset_A"
# )
# dump(DataProcessor(file_index=a), "D:/cache.joblib")
a = load("D:/cache.joblib")

View File

@@ -0,0 +1,41 @@
2 %Nomor
%for mult rows
& %Judul Jurnal
Real-time vibration-based structural damage detection using one-dimensional convolutional neural networks \href{https://doi.org/10.1016/j.jsv.2016.10.043}{10.1016/j.jsv.
2016.10.043}
%for mult rows
% & %Author
% % Satish B Satpal; Yogesh Khandare; Anirban Guha; Sauvik Banerjee
% %for mult rows
% & %Nama Jurnal
% International Journal of Advanced Structural Engineering (IJASE)
% %for mult rows
% & %Sumber
% \href{http://dx.doi.org/10.1186/2008-6695-5-2}{ResearchGate}
% %for mult rows
% & %Tahun
% 2020
% %for mult rows
& %Tujuan penelitian
Mengidentifikasi lokasi kerusakan struktur secara \textit{real-time} dengan memproses sinyal getaran mentah yang diambil dari jaringan-jaringan akselerometer pada setiap titik tanpa proses tambahan atau ekstraksi fitur.
& %Kesimpulan
% Studi ini menilai kemampuan mesin vektor pendukung untuk memprediksi intensitas kerusakan dan lokasi pada balok kantilever. Meskipun berhasil memprediksi kerusakan dengan sedikit kesalahan, tingkat kebisingan dan lokasi kerusakan memengaruhi keakuratan. Tingkat kebisingan yang tinggi mempengaruhi kinerja secara signifikan, terutama pada intensitas kerusakan yang lebih rendah.
& % Gap Research
\begin{enumerate}
\item Riset ini hanya dilakukan dengan \textit{full-grid array} akselerometer yang diletakkan pada setiap \textit{node} kerusakan, sehingga memerlukan banyak perangkat akselerometer.
\item Tidak ada komparasi performa efisiensi dan akurasi dengan algoritma pembelajaran mesin lain yang lebih populer sebelumnya.
\end{enumerate}

View File

@@ -0,0 +1,68 @@
1
%for mult rows
&
Statistical Feature Extraction in Machine Fault Detection using Vibration Signal (\href{https://doi.org/10.1109/ICTC49870.2020.9289285}{10.1109/ICTC49870.
2020.9289285})
%for mult rows
% &
% Donghui Xu; Xiang Xu; Michael C. Forde; Antonio Caballero
%for mult rows
% &
% Construction and Building Materials
% %for mult rows
% &
% \href{https://doi.org/10.1016/j.conbuildmat.2023.132596}{ScienceDirect}
% %for mult rows
% &
% 2023
% %for mult rows
&
\begin{enumerate}[series=enum]
\item Menginvestigasi cara mengklasifikasi kondisi \textit{gearbox} normal dan rusak menggunakan sinyal getaran berbasis pada kombinasi antara analisis statistik dan FFT dengan algoritma pembelajaran mesin (ANN, Logistic Regression, dan SVM)
\item Mengurangi waktu latih dan kompleksitas kalkulasi dengan analisis statistik sebagai input data meliputi sembilan fitur: mean, median, min, max, kurtosis, \textit{skewness}, \textit{standard deviation}, and \textit{range}.
\end{enumerate}
&
\begin{enumerate}[series=enum2]
\item Nilai \textit{maximum} dan kurtosis adalah fitur yang paling signifikan untuk mengklasifikasi kelas label pembelajaran mesin.
\item ANN meraih akurasi 100\% pada input FFT penuh dan analisis statistik, sedangkan Regresi Logistik (LR) dan SVM meraih akurasi 100\% dengan input FFT penuh namun hanya mendapat akurasi 91\% dengan input analisis statistik
\end{enumerate}
&
\begin{enumerate}
\item Lorem
\item Ipsum
\end{enumerate}
%-------------page break----------------
% \\
% &
% &
% &
% &
% &
% &
% &
% \begin{enumerate}[resume=enum]
% \item Menyajikan berbagai perkembangan penelitian, mendiskusikan dan membandingkannya kelebihan dan kekurangannya
% \item Meringkas kesesuaian berbagai metode pembelajaran mesin untuk masalah SHM yang berbeda
% \item Terakhir, tren masa depan
% \end{enumerate}
% &
% \begin{enumerate}[resume=enum2]
% \item SVM dan hutan acak kurang mendapat perhatian dibandingkan dengan jaringan saraf. Ini digunakan untuk klasifikasi kerusakan. Namun, pemrosesan awal data jauh lebih rumit.
% \end{enumerate}

View File

@@ -0,0 +1,509 @@
\documentclass[12pt,a4paper]{report}
\usepackage{hyperref}
\usepackage[top=1cm,right=3cm,bottom=1cm,left=3cm]{geometry}
\usepackage{multirow}
\usepackage{array}
% \usepackage{makecell}
\usepackage{pdflscape}
\usepackage{longtable,booktabs}
\usepackage{colortbl,xcolor}
\usepackage{enumitem}
\usepackage{pdfpages}
\usepackage{caption}
\usepackage[bahasa]{babel}
\usepackage{xpatch,csquotes}
\usepackage[backend=biber]{biblatex}
\addbibresource{export.bib}
\DeclareSourcemap{
\maps[datatype = bibtex]{
\map{
\step[fieldsource = abstract,
match = \regexp{([^\\])\%},
replace = \regexp{\$1\\\%}]
}
}
}
% \usepackage{tablefootnote}
% \usepackage{showframe}
\definecolor{Gray}{gray}{0.95}
\newcolumntype{a}{>{\columncolor{Gray}}p}
\renewcommand{\thefootnote}{\textit{\alph{footnote}}}
% \newcolumntype{b}{>{\raggedright\arraybackslash}p}
\title{Tugas 2 \\ Metode Penelitian}
\author{Rifqi Damar Panuluh \\ 20210110224}
\begin{document}
\maketitle
\begin{landscape}
% Table generated by Excel2LaTeX from sheet 'Sheet1'
% \begin{table}[h]
\centering
\begin{longtable}{
>{\raggedleft\arraybackslash}p{0.02\linewidth} %1
>{\raggedright\arraybackslash}a{0.1\linewidth} %2
% >{\raggedright\arraybackslash}p{0.1\linewidth} %3
% >{\raggedright\arraybackslash}a{0.075\linewidth} %4
% p{0.065\linewidth} %5
% >{\raggedleft\arraybackslash}p{0.05\linewidth} %6
>{\raggedright\arraybackslash}p{0.25\linewidth} %7
>{\raggedright\arraybackslash}a{0.25\linewidth} %8
>{\raggedright\arraybackslash}p{0.25\linewidth} %9
}
\caption{Tinjauan pustaka, topik: pemanfaatan data getaran untuk monitor kesehatan struktur jembatan}
\label{tab:my_label}
\\
\toprule
\toprule
\rowcolor{white}
No. %1
&
Judul %2
% &
% Nama Penulis %3
% &
% Nama Jurnal %4
% &
% Sumber %5
% &
% Tahun %6
&
Tujuan Penelitian %7
&
Kesimpulan %8
&
Gap Research %9
\\\midrule
\endfirsthead
\toprule
\rowcolor{white}
No. %1
&
Judul %2
% &
% Nama Penulis %3
% &
% Nama Jurnal %4
% &
% Sumber %5
% &
% Tahun %6
&
Tujuan Penelitian %7
&
Kesimpulan %8
\\\midrule
\endhead
\midrule
\multicolumn{4}{r}{\textit{berlanjut di halaman berikutnya}}
\endfoot
\bottomrule
\bottomrule
\endlastfoot
%-----1
\input{important/van2020}
\\
%-----2
\input{important/abdeljaber2017}
\\
%------3
\\
3
& %Judul Jurnal
Real-time nondestructive structural health monitoring using support vector machines and wavelets (Ahmet Bulut; Ambuj K. Singh; Peter Shin; Tony Fountain; Hector Jasso; Linjun Yan; Ahmed Elgamal)
%for mult rows
% & %Author
% Ahmet Bulut; Ambuj K. Singh; Peter Shin; Tony Fountain; Hector Jasso; Linjun Yan; Ahmed Elgamal
%for mult rows
% & %Nama Jurnal
% Case Studies in Construction Materials 13 (2020) e00406
% %for mult rows
% & %Sumber
% SPIE
% %for mult rows
% & %Tahun
% 2005
%for mult rows
& %Tujuan penelitian
Eksplorasi efektivitas SVM dalam deteksi kerusakan; Validasi model SVM dengan data nyata jembatan
& %Kesimpulan
\begin{enumerate} [series=enum]
\item SVM menunjukkan akurasi tinggi dalam mengidentifikasi lokasi kerusakan
\item Rekomendasi untuk penyetelan parameter SVM
\end{enumerate}
%-----------4
\\
4
& %Judul Jurnal
A novel approach of Structural Health Monitoring by the application of FFT and wavelet transform using an index of frequency dispersion (Fragkiskos P. Pentaris; John Stonham; John P. Makris)
%for mult rows
% & %Author
% Fragkiskos P. Pentaris; John Stonham; John P. Makris
%for mult rows
% & %Nama Jurnal
% International Journal of Geology
% %for mult rows
% & %Sumber
% Research Gate
% %for mult rows
% & %Tahun
% 2013
%for mult rows
& %Tujuan penelitian
\begin{enumerate}
\item Memeriksa peran FFT dalam pemrosesan awal data getaran
\item Menilai dampak FFT terhadap keakuratan deteksi kerusakan
\end{enumerate}
& %Kesimpulan
\begin{enumerate} [series=enum]
\item FFT meningkatkan rasio \textit{signal-to-noise} dan meningkatkan deteksi kerusakan.
\item Menyarankan integrasi dengan algoritme lain untuk meningkatkan akurasi.
\end{enumerate}
\\ %-------------page break----------------
%-----------4
\\
5
& %Judul Jurnal
Review of Vibration-Based Structural Health Monitoring Using Deep Learning (Gyungmin Toh; Junhong Park)
%for mult rows
% & %Author
% Gyungmin Toh;
% Junhong Park
% %for mult rows
% & %Nama Jurnal
% Apllied Sciences
% %for mult rows
% & %Sumber
% MDPI
% %for mult rows
% & %Tahun
% 2020
%for mult rows
& %Tujuan penelitian
\begin{enumerate}
\item ringkasan studi penerapan algoritma pembelajaran mesin untuk kesalahan pemantauan (\textit{monitoring}) menggunakan faktor getaran untuk mengkategorikan penelitian.
\item Menyediakan interpretasi singkat tentang jaringan saraf dalam untuk pengaplikasian lebih lanjut dalam analisis getaran struktural.
\end{enumerate}
& %Kesimpulan
\begin{enumerate} [series=enum]
\item Deep learning has the advantage of being able to perform health monitoring on complex structures with high accuracy.
\end{enumerate}
%-------------page break----------------
%-----------4
\\
6
& %Judul Jurnal
A deep learning approach to condition monitoring of cantilever beams via time-frequency extended signatures (Habil. Darian M. Onchis)
%for mult rows
% & %Author
% Habil. Darian M. Onchis
% %for mult rows
% & %Nama Jurnal
% Computers in Industry
% %for mult rows
% & %Sumber
% Science Direct
% %for mult rows
% & %Tahun
% 2019
%for mult rows
& %Tujuan penelitian
\begin{enumerate}
\item ringkasan studi penerapan algoritma pembelajaran mesin untuk kesalahan pemantauan (\textit{monitoring}) menggunakan faktor getaran untuk mengkategorikan penelitian.
\item Menyediakan interpretasi singkat tentang jaringan saraf dalam untuk pengaplikasian lebih lanjut dalam analisis getaran struktural.
\end{enumerate}
& %Kesimpulan
\begin{enumerate} [series=enum]
\item Deep learning has the advantage of being able to perform health monitoring on complex structures with high accuracy.
\end{enumerate}
\\ %-------------page break----------------
% %------------5
% 5
% & %Judul Jurnal
% Advances and development trends in eco-friendly pavements
% %for mult rows
% & %Author
% Aimin Sha, Zhuangzhuang Liu, Wei Jiang, Lin Qi, Liqun Hu, Wenxiu Jiao ,Diego Maria Barbieri
% %for mult rows
% & %Nama Jurnal
% Journal of Road Engineering 1 (2021)
% %for mult rows
% & %Sumber
% ScienceDirect
% %for mult rows
% & %Tahun
% 2021
% %for mult rows
% & %Tujuan penelitian
% Mengembangkan solusi teknis untuk mengatasi tantangan yang terkait dengan penciptaan infrastruktur hijau dan berkelanjutan, misalnya, pengurangan dampak lingkungan, peningkatan keselamatan lalu lintas, dan efisiensi transportasi, dll.\cite{Sha2021}
% &
% \begin{enumerate} [series=enum]
% \item Temuan penelitian terbaru terkait jalan ramah lingkungan
% trotoar diringkas dan dibahas sesuai dengan enam kunci yang berbeda
% karakteristik: permeabel, pengurangan kebisingan, luminescence diri, knalpot
% dekomposisi, penyerapan panas rendah serta \textit{anti-icing} / \textit{de-icing}.\cite{Sha2021}
% \end{enumerate}
% \\
% & %Judul Jurnal
% Advances and development trends in eco-friendly pavements
% %for mult rows
% & %Author
% Aimin Sha, Zhuangzhuang Liu, Wei Jiang, Lin Qi, Liqun Hu, Wenxiu Jiao ,Diego Maria Barbieri
% %for mult rows
% & %Nama Jurnal
% Journal of Road Engineering 1 (2021)
% %for mult rows
% & %Sumber
% ScienceDirect
% %for mult rows
% & %Tahun
% 2021
% %for mult rows
% & %Tujuan penelitian
% Mengembangkan solusi teknis untuk mengatasi tantangan yang terkait dengan penciptaan infrastruktur hijau dan berkelanjutan, misalnya, pengurangan dampak lingkungan, peningkatan keselamatan lalu lintas, dan efisiensi transportasi, dll.\cite{Sha2021}
% &
% \begin{enumerate}[resume=enum]
% \item Teknologi ini dapat memecahkan beberapa tantangan utama yang terkait dengan konstruksi jalan dan lalu lintas (misalnya, kebisingan, efek pulau panas, dan pembangkitan polusi). Sebagian besar solusi saat ini hanya tersedia menampilkan satu fungsi ramah lingkungan pada satu waktu.\cite{Sha2021}
% \end{enumerate}
% %-----------5
% \\
% 5
% & %Judul Jurnal
% Micromobility injury events: Motor vehicle crashes and other transportation systems factors
% %for mult rows
% & %Author
% Kevin Fang
% %for mult rows
% & %Nama Jurnal
% Transportation Research Interdisciplinary Perspectives 14 (2022) 100574
% %for mult rows
% & %Sumber
% ScienceDirect
% %for mult rows
% & %Tahun
% 2022
% %for mult rows
% & %Tujuan penelitian
% Menginformasikan transportasi strategi kebijakan untuk mencoba dan meningkatkan kinerja keselamatan, Dengan cara mengeksplorasi keadaan di mana cedera pengendara mikromobilitas mengalami cederanya, dengan fokus pada faktor-faktor yang berkaitan dengan sistem transportasi.\cite{Fang2022}
% &
% \begin{enumerate} [series=enum]
% \item Kecelakaan kendaraan bermotor secara mengejutkan menjulang sebagai sesuatu yang kemungkinan adalah faktor umum dalam cedera mikromobilitas. Masalah perkerasan, konflik
% dengan pengguna non-otomatis, dan medan juga muncul sebagai faktor cedera yang terukur.\cite{Fang2022}
% \end{enumerate}
% \\
% & %Judul Jurnal
% Micromobility injury events: Motor vehicle crashes and other transportation systems factors
% %for mult rows
% & %Author
% Kevin Fang
% %for mult rows
% & %Nama Jurnal
% Transportation Research Interdisciplinary Perspectives 14 (2022) 100574
% %for mult rows
% & %Sumber
% ScienceDirect
% %for mult rows
% & %Tahun
% 2022
% %for mult rows
% & %Tujuan penelitian
% Menginformasikan transportasi strategi kebijakan untuk mencoba dan meningkatkan kinerja keselamatan, Dengan cara mengeksplorasi keadaan di mana cedera pengendara mikromobilitas mengalami cederanya, dengan fokus pada faktor-faktor yang berkaitan dengan sistem transportasi.\cite{Fang2022}
% &
% \begin{enumerate} [resume=enum]
% \item Di antara faktor-faktor yang berhubungan dengan transportasi, analisis regresi
% menunjukkan bahwa terluka dalam kecelakaan kendaraan bermotor atau di medan berbukit
% sesuai dengan kemungkinan yang lebih besar dari rawat inap dan cedera kepala.\cite{Fang2022}
% \end{enumerate}
% \\
% & %Judul Jurnal
% Micromobility injury events: Motor vehicle crashes and other transportation systems factors
% %for mult rows
% & %Author
% Kevin Fang
% %for mult rows
% & %Nama Jurnal
% Transportation Research Interdisciplinary Perspectives 14 (2022) 100574
% %for mult rows
% & %Sumber
% ScienceDirect
% %for mult rows
% & %Tahun
% 2022
% %for mult rows
% & %Tujuan penelitian
% Menginformasikan transportasi strategi kebijakan untuk mencoba dan meningkatkan kinerja keselamatan, Dengan cara mengeksplorasi keadaan di mana cedera pengendara mikromobilitas mengalami cederanya, dengan fokus pada faktor-faktor yang berkaitan dengan sistem transportasi.\cite{Fang2022}
% &
% \begin{enumerate} [resume=enum]
% \item Mitigasi yang berhasil yang memaksimalkan kinerja mode keselamatan mikromobilitas dapat membantu menarik dan mempertahankan pengguna dan menjaga kepercayaan dari pembuat kebijakan yang peduli keselamatan.\cite{Fang2022}
% \end{enumerate}
% \end{tabular}
\end{longtable}
% \end{table}
\end{landscape}
\clearpage
\pagenumbering{roman}
\setcounter{page}{2}
\thispagestyle{empty}
\printbibliography
\clearpage
\begin{titlepage}
\
\vfill
\centering\noindent \Huge{LAMPIRAN}
\vfill
\
\end{titlepage}
% \clearpage
% \thispagestyle{empty}
% \centering
% \frame{\includegraphics[page=1,scale=.7]{assets/1-s2.0-S2095756420300295-main.pdf}}
% \captionof{figure}{Halaman pertama jurnal pertama}
% \clearpage
% \thispagestyle{empty}
% \centering
% \frame{\includegraphics[page=1,scale=.7]{assets/1-s2.0-S2214509520300024-main.pdf}}
% \captionof{figure}{Halaman pertama jurnal kedua}
% \clearpage
% \thispagestyle{empty}
% \centering
% \frame{\includegraphics[page=1,scale=.7]{assets/1-s2.0-S2214509520300784-main.pdf}}
% \captionof{figure}{Halaman pertama jurnal ketiga}
% \clearpage
% \thispagestyle{empty}
% \centering
% \frame{\includegraphics[page=1,scale=.7]{assets/1-s2.0-S2097049821000044-main.pdf}}
% \captionof{figure}{Halaman pertama jurnal keempat}
% \clearpage
% \thispagestyle{empty}
% \centering
% \frame{\includegraphics[page=1,scale=.7]{assets/1-s2.0-S2590198222000379-main.pdf}}
% \captionof{figure}{Halaman pertama jurnal kelima}
\end{document}

View File

@@ -0,0 +1,15 @@
\chapter{PENDAHULUAN}
\section{Latar Belakang}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc consequat lectus dolor, a commodo odio suscipit nec. Aliquam posuere elit eget tellus dapibus, auctor ornare mi porttitor. Donec auctor aliquet nisl, quis convallis ligula rutrum id. Duis tortor ipsum, scelerisque vestibulum viverra eu, maximus vel mi. Nullam volutpat nunc et varius tempor. Vivamus convallis mi eros, aliquam semper dui tincidunt a. Morbi nunc dui, accumsan ac arcu nec, condimentum efficitur mauris. Etiam sed mauris semper, volutpat justo eu, placerat mauris. Suspendisse at erat eu arcu gravida mattis et id nunc. Aliquam malesuada magna odio, ac dictum erat vestibulum a. Mauris vel nisi sit amet elit tempor bibendum sit amet a velit. Morbi dignissim facilisis placerat.\par
Pellentesque vel accumsan lorem, id vulputate metus. Nulla mollis orci ante, et euismod erat venenatis eget. Proin tempus lobortis feugiat. Fusce vitae sem quis lacus iaculis dignissim ut eget turpis. Vivamus ut nisl in enim porttitor fringilla vel et mauris. Mauris quis porttitor magna. Pellentesque molestie viverra arcu at tincidunt. Maecenas non elit arcu.\par
Etiam feugiat enim sit amet tortor interdum lobortis. Curabitur elementum faucibus sapien. Morbi eget facilisis lorem. In sed suscipit metus. Etiam porttitor, libero sit amet sodales hendrerit, libero dolor hendrerit nulla, sed convallis risus leo posuere metus. Cras gravida ac elit viverra ultrices. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia curae; Maecenas dictum urna elit, nec eleifend nulla mattis sit amet. Pellentesque suscipit metus vitae leo suscipit, a vehicula quam pretium. Sed eu est ut risus convallis hendrerit a vulputate justo. Nulla sollicitudin quam ut risus euismod, quis consequat dui mattis. Mauris id eros varius, pellentesque quam quis, venenatis tellus. Nulla vitae condimentum nisl. Vestibulum suscipit scelerisque dui, non posuere purus finibus nec. Nulla ultrices felis quis vestibulum porta. Suspendisse potenti.\par
Nam tempus tincidunt interdum. Pellentesque at ligula ac massa semper efficitur vitae non ante. Suspendisse potenti. Cras vitae interdum erat, nec facilisis urna. Nulla commodo porttitor tellus non posuere. Vestibulum tristique ut urna quis porttitor. Sed pellentesque lectus sit amet ultrices aliquam. Aliquam erat volutpat. Nam dictum eu erat a mollis. Donec eget nulla vel risus aliquet suscipit sed at libero.\par
Maecenas hendrerit pharetra bibendum. Donec ut tortor ac augue aliquam ullamcorper nec id eros. Quisque consectetur elementum ipsum vitae posuere. Sed ultricies ipsum nibh, vitae volutpat neque bibendum at. Morbi dictum metus eu bibendum malesuada. Nam scelerisque purus erat, id dictum nisl pretium vitae. Curabitur finibus commodo dui ac molestie. In sed sem ac dui dapibus ullamcorper. Aenean molestie nulla eu lorem maximus hendrerit. Vivamus viverra velit dolor, in vehicula eros facilisis at. Vivamus in rhoncus sem.
\section{Lingkup Penelitian}
\section{Tujuan Penelitian}
\section{Manfaat Penelitian}
% \subsubsection{Dolor}

View File

@@ -0,0 +1,6 @@
\chapter{TINJAUAN PUSTAKA DAN LANDASAN TEORI}
\section{Tinjauan Pustaka}
\section{Dasar Teori}
\subsection{Short-Time Fourier Transform}
\subsection{Machine Learning}
% \subsubsection{Dolor}

View File

@@ -0,0 +1,64 @@
% frontmatter/endorsement.tex
\setmainfont{Times New Roman}
\begin{center}
\textbf{\Large LEMBAR PENGESAHAN TUGAS AKHIR} \\[0.5em]
\textit{APPROVAL SHEET}
\end{center}
\vspace{1em}
\renewcommand{\arraystretch}{1.2}
\begin{tabular}{llp{10cm}}
\textbf{Judul} & : & \thesistitle \\
\textit{Title} & & \\
\textbf{Mahasiswa} & : & \studentname \\
\textit{Student} & & \\
\textbf{Nomor Mahasiswa} & : &\studentid \\
\textit{Student ID.} & & \\
\textbf{Dosen Pembimbing} & : & 1. \firstadvisor \\
\textit{Advisors} & & 2. \secondadvisor
\end{tabular}
\vspace{1em}
\textbf{Telah disetujui oleh Tim Penguji:} \\
\textit{Approved by the Committee on Oral Examination}
\vspace{1em}
\begin{tabular}{lp{5cm}}
\textbf{\firstadvisor} &:
% \vspace{2cm} % signature space
% \\[1em] % pull up next row
\\
\textit{Ketua Tim Penguji} &
\noindent\makebox[5cm]{\hrulefill}\\[-0.5em]
\textit{\small Chair} & \small Yogyakarta, \dotfill 2020
\\
\textbf{\secondadvisor} &:
% \vspace{2cm} % signature space
% \\[1em] % pull up next row
\\
\textit{Ketua Tim Penguji} &
\noindent\makebox[5cm]{\hrulefill}\\[-0.5em]
\textit{\small Chair} & \small Yogyakarta, \dotfill 2020 \\
\end{tabular}
\vspace{1em}
\noindent
\textbf{Diterima dan disetujui sebagai persyaratan untuk memperoleh gelar Sarjana Teknik} \\
\textit{Accepted in partial fulfillment of the requirements for the degree of Bachelor of Engineering}
\vspace{2em}
\begin{center}
\textbf{Ketua Program Studi} \\
\textit{Head of Department}
\end{center}
\vspace{3em}
\begin{center}
\textbf{\headdepartement} \\
NIK. \headdepartementid
\end{center}

Binary file not shown.

After

Width:  |  Height:  |  Size: 253 KiB

View File

@@ -0,0 +1,31 @@
\begin{titlepage}
\centering
\vspace*{1cm}
{\fontsize{14pt}{16pt}\selectfont \textbf{\MakeUppercase{Tugas Akhir}}\par}
\vspace{1.5cm}
{\fontsize{14pt}{16pt}\selectfont \textbf{\MakeUppercase{\thesistitle}}\par}
\vspace{1.5cm}
\includegraphics[width=5cm]{frontmatter/img/logo.png}
\vspace{1.5cm}
\textbf{Disusun oleh:} \\
{\fontsize{14pt}{16pt}\selectfont \textbf{\studentname}} \\
{\fontsize{14pt}{16pt}\selectfont \textbf{\studentid}} \\
\vfill
{\fontsize{12pt}{14pt}\selectfont
\textbf{\program} \\
\textbf{\faculty} \\
\textbf{\university} \\
\textbf{\yearofsubmission}
}
\end{titlepage}%

View File

View File

@@ -0,0 +1,40 @@
\documentclass[draftmark]{thesis}
% Title Information
\setthesisinfo
{Prediksi Lokasi Kerusakan dengan Machine Learning}
{Rifqi Damar Panuluh}
{20210110224}
{PROGRAM STUDI TEKNIK SIPIL}
{FAKULTAS TEKNIK}
{UNIVERSITAS MUHAMMADIYAH YOGYAKARTA}
{2025}
% Input preamble
\input{preamble/packages}
% \input{preamble/fonts}
\input{preamble/macros}
\begin{document}
\maketitle
\frontmatter
\setcounter{page}{1}
\theendorsementpage{toc}
\originalitystatement{toc}
\tableofcontents
\clearpage
\mainmatter
\pagestyle{fancyplain}
% Include content
\include{content/abstract}
\include{content/introduction}
\include{chapters/01_introduction}
\include{content/chapter2}
\include{content/conclusion}
% Bibliography
% \bibliographystyle{IEEEtran}
% \bibliography{references}
\end{document}

11
latex/metadata.tex Normal file
View File

@@ -0,0 +1,11 @@
\newcommand{\studentname}{Rifqi Damar Panuluh}
\newcommand{\studentid}{20210110224}
\newcommand{\thesistitle}{Prediksi Lokasi Kerusakan dengan Machine Learning}
\newcommand{\firstadvisor}{Ir. Muhammad Ibnu Syamsi, Ph.D.}
\newcommand{\secondadvisor}{}
\newcommand{\headdepartement}{Puji Harsanto, S.T. M.T., Ph.D.}
\newcommand{\headdepartementid}{19740607201404123064}
\newcommand{\faculty}{Fakultas Teknik}
\newcommand{\program}{Teknik Sipil}
\newcommand{\university}{Universitas Muhammadiyah Yogyakarta}
\newcommand{\yearofsubmission}{2025}

View File

@@ -0,0 +1,5 @@
\newcommand{\eg}{\textit{e.g.},\ }
\newcommand{\ie}{\textit{i.e.},\ }
\newcommand{\etal}{\textit{et al.}}
\let\oldtableofcontents\tableofcontents % backup

View File

@@ -0,0 +1,3 @@
\usepackage{amsmath, amssymb, siunitx}
\usepackage{caption}
\usepackage{subcaption}

134
latex/thesis.cls Normal file
View File

@@ -0,0 +1,134 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{thesis}[2025/05/10 Bachelor Thesis Class]
\newif\if@draftmark
\@draftmarkfalse
\DeclareOption{draftmark}{\@draftmarktrue}
\ProcessOptions \relax
\LoadClass[a4paper,12pt,oneside]{book}
% Load common packages
\RequirePackage{fontspec}
\RequirePackage{titlesec}
\RequirePackage{fancyhdr}
\RequirePackage{geometry}
\RequirePackage{setspace}
\RequirePackage{graphicx}
\RequirePackage{hyperref}
\RequirePackage{etoolbox}
\RequirePackage{tocloft}
\RequirePackage{tocbibind}
% Conditionally load the watermark package and settings
\if@draftmark
\RequirePackage{draftwatermark}
\SetWatermarkText{Draft: \today [wip]}
\SetWatermarkColor[gray]{0.7}
\SetWatermarkFontSize{2cm}
\SetWatermarkAngle{90}
\SetWatermarkHorCenter{1.5cm}
\fi
% Page layout
\geometry{left=3cm, top=3cm, right=3cm, bottom=3cm}
\setlength{\parskip}{0.5em}
\setlength{\parindent}{0pt}
\onehalfspacing
% Fonts
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Times New Roman}
\setsansfont{Arial}
\setmonofont{Courier New}
% Metadata commands
\input{metadata} % Load metadata from external file
\newcommand{\setthesisinfo}[7]{%
\renewcommand{\thesistitle}{#1}%
\renewcommand{\studentname}{#2}%
\renewcommand{\studentid}{#3}%
\renewcommand{\program}{#4}%
\renewcommand{\faculty}{#5}%
\renewcommand{\university}{#6}%
\renewcommand{\yearofsubmission}{#7}%
}
% Header and footer
\fancypagestyle{fancy}{%
\fancyhf{}
\fancyhead[R]{\nouppercase{\rightmark}}
\fancyhead[L]{\nouppercase{\leftmark}}
\fancyfoot[C]{\thepage}
}
\fancypagestyle{fancyplainfrontmatter}{%
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[C]{\thepage}
}
\fancypagestyle{fancyplain}{%
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyhead[R]{\thepage}
}
% Chapter formatting
\titleformat{\chapter}[display]
{\bfseries\Large\centering}
{BAB~\Roman{chapter}} % << display format
{1ex}
{\MakeUppercase}
% Ensure chapter reference in TOC matches
\renewcommand{\cftchappresnum}{BAB~}
\renewcommand{\cftchapaftersnum}{\quad}
% \titlespacing*{\chapter}{0pt}{-10pt}{20pt}
% Redefine \maketitle
\renewcommand{\maketitle}{\input{frontmatter/maketitle}}
% Chapter & Section format
\renewcommand{\cftchapfont}{\bfseries\MakeUppercase}
% \renewcommand{\cftsecfont}{}
% \renewcommand{\cftsubsecfont}{\itshape}
% \renewcommand{\thesection}{\textup{\Roman{chapter}}.\arabic{section}}
% Dot leaders, spacing, indentation
\setlength{\cftbeforechapskip}{0em}
\setlength{\cftchapindent}{0pt}
\setlength{\cftsecindent}{0em}
\setlength{\cftsubsecindent}{3em}
\setlength{\cftchapnumwidth}{4em}
\setlength{\cftsecnumwidth}{2.5em}
\setlength{\cftsubsecnumwidth}{2.5em}
\renewcommand \cftchapdotsep{4.5} % https://tex.stackexchange.com/a/273764
\renewcommand{\cftchapleader}{\normalfont\cftdotfill{\cftsecdotsep}}
\renewcommand{\cftchappagefont}{\normalfont}
% Ensure TOC and References Respect Custom Numbering
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand\thesection{\arabic{chapter}.\arabic{section}}
% Table of Contents (TOC) Title styling
\renewcommand{\contentsname}{DAFTAR ISI}
\renewcommand{\cfttoctitlefont}{\bfseries\MakeUppercase}
\renewcommand{\cftaftertoctitle}{\hfill} % https://tex.stackexchange.com/a/255699/394075
% \renewcommand{\cftaftertoctitle}{\vskip 2em}
% Frontmatter Macro (Toggle TOC Inclusion)
\newcommand{\frontmattersection}[3]{%
\centering
\ifstrequal{#1}{toc}{\thispagestyle{fancyplainfrontmatter}\addcontentsline{toc}{chapter}{#2}}{\chapter*{#2}}%
\input{frontmatter/#3}
\clearpage
}
% Wrapper Command for Each Page
\newcommand{\theendorsementpage}[1]{\frontmattersection{#1}{Pengesahan}{endorsement}}
\newcommand{\originalitystatement}[1]{\frontmattersection{#1}{Pernyataan Keaslian}{originality}}
\endinput