From 254b24cb21d6420fc945e739f1bb8353722221b3 Mon Sep 17 00:00:00 2001 From: nuluh Date: Thu, 29 May 2025 20:35:35 +0700 Subject: [PATCH 1/8] feat(viz): Update plotting for STFT data visualization with color map 'jet' and added color bar --- code/notebooks/stft.ipynb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/code/notebooks/stft.ipynb b/code/notebooks/stft.ipynb index 7a86841..b018033 100644 --- a/code/notebooks/stft.ipynb +++ b/code/notebooks/stft.ipynb @@ -334,8 +334,9 @@ "metadata": {}, "outputs": [], "source": [ - "len(ready_data1a)\n", - "# plt.pcolormesh(ready_data1[0])" + "# len(ready_data1a)\n", + "# plt.pcolormesh(ready_data1[0])\n", + "ready_data1a[0].max().max()" ] }, { @@ -345,7 +346,8 @@ "outputs": [], "source": [ "for i in range(6):\n", - " plt.pcolormesh(ready_data1a[i])\n", + " plt.pcolormesh(ready_data1a[i], cmap=\"jet\", vmax=0.03, vmin=0.0)\n", + " plt.colorbar() \n", " plt.title(f'STFT Magnitude for case {i} sensor 1')\n", " plt.xlabel(f'Frequency [Hz]')\n", " plt.ylabel(f'Time [sec]')\n", From 7da3179d0863c827fd92f01cff360b12ecc852a5 Mon Sep 17 00:00:00 2001 From: nuluh Date: Thu, 29 May 2025 22:57:28 +0700 Subject: [PATCH 2/8] refactor(nb): Create and implement helper function `train_and_evaluate_model` --- code/notebooks/stft.ipynb | 267 +++++++++++++++----------------------- 1 file changed, 104 insertions(+), 163 deletions(-) diff --git a/code/notebooks/stft.ipynb b/code/notebooks/stft.ipynb index b018033..e32eda5 100644 --- a/code/notebooks/stft.ipynb +++ b/code/notebooks/stft.ipynb @@ -537,8 +537,8 @@ "metadata": {}, "outputs": [], "source": [ - "# len(y_data[0])\n", - "y_data" + "len(y_data[0])\n", + "# y_data" ] }, { @@ -621,137 +621,15 @@ "metadata": {}, "outputs": [], "source": [ - "accuracies1 = []\n", - "accuracies2 = []\n", - "\n", - "\n", - "# 1. Random Forest\n", - "rf_model1 = RandomForestClassifier()\n", - "rf_model1.fit(x_train1, y_train)\n", - "rf_pred1 = rf_model1.predict(x_test1)\n", - "acc1 = accuracy_score(y_test, rf_pred1) * 100\n", - "accuracies1.append(acc1)\n", - "# format with color coded if acc1 > 90\n", - "acc1 = f\"\\033[92m{acc1:.2f}\\033[00m\" if acc1 > 90 else f\"{acc1:.2f}\"\n", - "print(\"Random Forest Accuracy for sensor 1:\", acc1)\n", - "rf_model2 = RandomForestClassifier()\n", - "rf_model2.fit(x_train2, y_train)\n", - "rf_pred2 = rf_model2.predict(x_test2)\n", - "acc2 = accuracy_score(y_test, rf_pred2) * 100\n", - "accuracies2.append(acc2)\n", - "# format with color coded if acc2 > 90\n", - "acc2 = f\"\\033[92m{acc2:.2f}\\033[00m\" if acc2 > 90 else f\"{acc2:.2f}\"\n", - "print(\"Random Forest Accuracy for sensor 2:\", acc2)\n", - "# print(rf_pred)\n", - "# print(y_test)\n", - "\n", - "# 2. Bagged Trees\n", - "bagged_model1 = BaggingClassifier(estimator=DecisionTreeClassifier(), n_estimators=10)\n", - "bagged_model1.fit(x_train1, y_train)\n", - "bagged_pred1 = bagged_model1.predict(x_test1)\n", - "acc1 = accuracy_score(y_test, bagged_pred1) * 100\n", - "accuracies1.append(acc1)\n", - "# format with color coded if acc1 > 90\n", - "acc1 = f\"\\033[92m{acc1:.2f}\\033[00m\" if acc1 > 90 else f\"{acc1:.2f}\"\n", - "print(\"Bagged Trees Accuracy for sensor 1:\", acc1)\n", - "bagged_model2 = BaggingClassifier(estimator=DecisionTreeClassifier(), n_estimators=10)\n", - "bagged_model2.fit(x_train2, y_train)\n", - "bagged_pred2 = bagged_model2.predict(x_test2)\n", - "acc2 = accuracy_score(y_test, bagged_pred2) * 100\n", - "accuracies2.append(acc2)\n", - "# format with color coded if acc2 > 90\n", - "acc2 = f\"\\033[92m{acc2:.2f}\\033[00m\" if acc2 > 90 else f\"{acc2:.2f}\"\n", - "print(\"Bagged Trees Accuracy for sensor 2:\", acc2)\n", - "\n", - "# 3. Decision Tree\n", - "dt_model = DecisionTreeClassifier()\n", - "dt_model.fit(x_train1, y_train)\n", - "dt_pred1 = dt_model.predict(x_test1)\n", - "acc1 = accuracy_score(y_test, dt_pred1) * 100\n", - "accuracies1.append(acc1)\n", - "# format with color coded if acc1 > 90\n", - "acc1 = f\"\\033[92m{acc1:.2f}\\033[00m\" if acc1 > 90 else f\"{acc1:.2f}\"\n", - "print(\"Decision Tree Accuracy for sensor 1:\", acc1)\n", - "dt_model2 = DecisionTreeClassifier()\n", - "dt_model2.fit(x_train2, y_train)\n", - "dt_pred2 = dt_model2.predict(x_test2)\n", - "acc2 = accuracy_score(y_test, dt_pred2) * 100\n", - "accuracies2.append(acc2)\n", - "# format with color coded if acc2 > 90\n", - "acc2 = f\"\\033[92m{acc2:.2f}\\033[00m\" if acc2 > 90 else f\"{acc2:.2f}\"\n", - "print(\"Decision Tree Accuracy for sensor 2:\", acc2)\n", - "\n", - "# 4. KNeighbors\n", - "knn_model = KNeighborsClassifier()\n", - "knn_model.fit(x_train1, y_train)\n", - "knn_pred1 = knn_model.predict(x_test1)\n", - "acc1 = accuracy_score(y_test, knn_pred1) * 100\n", - "accuracies1.append(acc1)\n", - "# format with color coded if acc1 > 90\n", - "acc1 = f\"\\033[92m{acc1:.2f}\\033[00m\" if acc1 > 90 else f\"{acc1:.2f}\"\n", - "print(\"KNeighbors Accuracy for sensor 1:\", acc1)\n", - "knn_model2 = KNeighborsClassifier()\n", - "knn_model2.fit(x_train2, y_train)\n", - "knn_pred2 = knn_model2.predict(x_test2)\n", - "acc2 = accuracy_score(y_test, knn_pred2) * 100\n", - "accuracies2.append(acc2)\n", - "# format with color coded if acc2 > 90\n", - "acc2 = f\"\\033[92m{acc2:.2f}\\033[00m\" if acc2 > 90 else f\"{acc2:.2f}\"\n", - "print(\"KNeighbors Accuracy for sensor 2:\", acc2)\n", - "\n", - "# 5. Linear Discriminant Analysis\n", - "lda_model = LinearDiscriminantAnalysis()\n", - "lda_model.fit(x_train1, y_train)\n", - "lda_pred1 = lda_model.predict(x_test1)\n", - "acc1 = accuracy_score(y_test, lda_pred1) * 100\n", - "accuracies1.append(acc1)\n", - "# format with color coded if acc1 > 90\n", - "acc1 = f\"\\033[92m{acc1:.2f}\\033[00m\" if acc1 > 90 else f\"{acc1:.2f}\"\n", - "print(\"Linear Discriminant Analysis Accuracy for sensor 1:\", acc1)\n", - "lda_model2 = LinearDiscriminantAnalysis()\n", - "lda_model2.fit(x_train2, y_train)\n", - "lda_pred2 = lda_model2.predict(x_test2)\n", - "acc2 = accuracy_score(y_test, lda_pred2) * 100\n", - "accuracies2.append(acc2)\n", - "# format with color coded if acc2 > 90\n", - "acc2 = f\"\\033[92m{acc2:.2f}\\033[00m\" if acc2 > 90 else f\"{acc2:.2f}\"\n", - "print(\"Linear Discriminant Analysis Accuracy for sensor 2:\", acc2)\n", - "\n", - "# 6. Support Vector Machine\n", - "svm_model = SVC()\n", - "svm_model.fit(x_train1, y_train)\n", - "svm_pred1 = svm_model.predict(x_test1)\n", - "acc1 = accuracy_score(y_test, svm_pred1) * 100\n", - "accuracies1.append(acc1)\n", - "# format with color coded if acc1 > 90\n", - "acc1 = f\"\\033[92m{acc1:.2f}\\033[00m\" if acc1 > 90 else f\"{acc1:.2f}\"\n", - "print(\"Support Vector Machine Accuracy for sensor 1:\", acc1)\n", - "svm_model2 = SVC()\n", - "svm_model2.fit(x_train2, y_train)\n", - "svm_pred2 = svm_model2.predict(x_test2)\n", - "acc2 = accuracy_score(y_test, svm_pred2) * 100\n", - "accuracies2.append(acc2)\n", - "# format with color coded if acc2 > 90\n", - "acc2 = f\"\\033[92m{acc2:.2f}\\033[00m\" if acc2 > 90 else f\"{acc2:.2f}\"\n", - "print(\"Support Vector Machine Accuracy for sensor 2:\", acc2)\n", - "\n", - "# 7. XGBoost\n", - "xgboost_model = XGBClassifier()\n", - "xgboost_model.fit(x_train1, y_train)\n", - "xgboost_pred1 = xgboost_model.predict(x_test1)\n", - "acc1 = accuracy_score(y_test, xgboost_pred1) * 100\n", - "accuracies1.append(acc1)\n", - "# format with color coded if acc1 > 90\n", - "acc1 = f\"\\033[92m{acc1:.2f}\\033[00m\" if acc1 > 90 else f\"{acc1:.2f}\"\n", - "print(\"XGBoost Accuracy:\", acc1)\n", - "xgboost_model2 = XGBClassifier()\n", - "xgboost_model2.fit(x_train2, y_train)\n", - "xgboost_pred2 = xgboost_model2.predict(x_test2)\n", - "acc2 = accuracy_score(y_test, xgboost_pred2) * 100\n", - "accuracies2.append(acc2)\n", - "# format with color coded if acc2 > 90\n", - "acc2 = f\"\\033[92m{acc2:.2f}\\033[00m\" if acc2 > 90 else f\"{acc2:.2f}\"\n", - "print(\"XGBoost Accuracy:\", acc2)" + "def train_and_evaluate_model(model, model_name, sensor_label, x_train, y_train, x_test, y_test):\n", + " model.fit(x_train, y_train)\n", + " y_pred = model.predict(x_test)\n", + " accuracy = accuracy_score(y_test, y_pred) * 100\n", + " return {\n", + " \"model\": model_name,\n", + " \"sensor\": sensor_label,\n", + " \"accuracy\": accuracy\n", + " }" ] }, { @@ -760,8 +638,59 @@ "metadata": {}, "outputs": [], "source": [ - "print(accuracies1)\n", - "print(accuracies2)" + "# Define models for sensor1\n", + "models_sensor1 = {\n", + " # \"Random Forest\": RandomForestClassifier(),\n", + " # \"Bagged Trees\": BaggingClassifier(estimator=DecisionTreeClassifier(), n_estimators=10),\n", + " # \"Decision Tree\": DecisionTreeClassifier(),\n", + " # \"KNN\": KNeighborsClassifier(),\n", + " # \"LDA\": LinearDiscriminantAnalysis(),\n", + " \"SVM\": SVC(),\n", + " \"XGBoost\": XGBClassifier()\n", + "}\n", + "\n", + "results_sensor1 = []\n", + "for name, model in models_sensor1.items():\n", + " res = train_and_evaluate_model(model, name, \"sensor1\", x_train1, y_train, x_test1, y_test)\n", + " results_sensor1.append(res)\n", + " print(f\"{name} on sensor1: Accuracy = {res['accuracy']:.2f}%\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "models_sensor2 = {\n", + " # \"Random Forest\": RandomForestClassifier(),\n", + " # \"Bagged Trees\": BaggingClassifier(estimator=DecisionTreeClassifier(), n_estimators=10),\n", + " # \"Decision Tree\": DecisionTreeClassifier(),\n", + " # \"KNN\": KNeighborsClassifier(),\n", + " # \"LDA\": LinearDiscriminantAnalysis(),\n", + " \"SVM\": SVC(),\n", + " \"XGBoost\": XGBClassifier()\n", + "}\n", + "\n", + "results_sensor2 = []\n", + "for name, model in models_sensor2.items():\n", + " res = train_and_evaluate_model(model, name, \"sensor2\", x_train2, y_train, x_test2, y_test)\n", + " results_sensor2.append(res)\n", + " print(f\"{name} on sensor2: Accuracy = {res['accuracy']:.2f}%\")\n" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "all_results = {\n", + " \"sensor1\": results_sensor1,\n", + " \"sensor2\": results_sensor2\n", + "}\n", + "\n", + "print(all_results)" ] }, { @@ -773,36 +702,48 @@ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "\n", - "models = [rf_model, bagged_model, dt_model, knn_model, lda_model, svm_model, xgboost_model]\n", - "model_names = [\"Random Forest\", \"Bagged Trees\", \"Decision Tree\", \"KNN\", \"LDA\", \"SVM\", \"XGBoost\"]\n", + "def prepare_plot_data(results_dict):\n", + " # Gather unique model names\n", + " models_set = {entry['model'] for sensor in results_dict.values() for entry in sensor}\n", + " models = sorted(list(models_set))\n", + " \n", + " # Create dictionaries mapping sensor -> accuracy list ordered by model name\n", + " sensor_accuracies = {}\n", + " for sensor, entries in results_dict.items():\n", + " # Build a mapping: model -> accuracy for the given sensor\n", + " mapping = {entry['model']: entry['accuracy'] for entry in entries}\n", + " # Order the accuracies consistent with the sorted model names\n", + " sensor_accuracies[sensor] = [mapping.get(model, 0) for model in models]\n", + " \n", + " return models, sensor_accuracies\n", "\n", - "bar_width = 0.35 # Width of each bar\n", - "index = np.arange(len(model_names)) # Index for the bars\n", + "def plot_accuracies(models, sensor_accuracies):\n", + " bar_width = 0.35\n", + " x = np.arange(len(models))\n", + " sensors = list(sensor_accuracies.keys())\n", + " \n", + " plt.figure(figsize=(10, 6))\n", + " # Assume two sensors for plotting grouped bars\n", + " plt.bar(x - bar_width/2, sensor_accuracies[sensors[0]], width=bar_width, color='blue', label=sensors[0])\n", + " plt.bar(x + bar_width/2, sensor_accuracies[sensors[1]], width=bar_width, color='orange', label=sensors[1])\n", + " \n", + " # Add text labels on top of bars\n", + " for i, (a1, a2) in enumerate(zip(sensor_accuracies[sensors[0]], sensor_accuracies[sensors[1]])):\n", + " plt.text(x[i] - bar_width/2, a1 + 0.1, f\"{a1:.2f}%\", ha='center', va='bottom', color='black')\n", + " plt.text(x[i] + bar_width/2, a2 + 0.1, f\"{a2:.2f}%\", ha='center', va='bottom', color='black')\n", + " \n", + " plt.xlabel('Model Name')\n", + " plt.ylabel('Accuracy (%)')\n", + " plt.title('Accuracy of Classifiers for Each Sensor')\n", + " plt.xticks(x, models)\n", + " plt.legend()\n", + " plt.ylim(0, 105)\n", + " plt.tight_layout()\n", + " plt.show()\n", "\n", - "# Plotting the bar graph\n", - "plt.figure(figsize=(14, 8))\n", - "\n", - "# Bar plot for Sensor 1\n", - "plt.bar(index, accuracies1, width=bar_width, color='blue', label='Sensor 1')\n", - "\n", - "# Bar plot for Sensor 2\n", - "plt.bar(index + bar_width, accuracies2, width=bar_width, color='orange', label='Sensor 2')\n", - "\n", - "# Add values on top of each bar\n", - "for i, acc1, acc2 in zip(index, accuracies1, accuracies2):\n", - " plt.text(i, acc1 + .1, f'{acc1:.2f}%', ha='center', va='bottom', color='black')\n", - " plt.text(i + bar_width, acc2 + 1, f'{acc2:.2f}%', ha='center', va='bottom', color='black')\n", - "\n", - "# Customize the plot\n", - "plt.xlabel('Model Name →')\n", - "plt.ylabel('Accuracy →')\n", - "plt.title('Accuracy of classifiers for Sensors 1 and 2 with 513 features')\n", - "plt.xticks(index + bar_width / 2, model_names) # Set x-tick positions\n", - "plt.legend()\n", - "plt.ylim(0, 100)\n", - "\n", - "# Show the plot\n", - "plt.show()\n" + "# Use the functions\n", + "models, sensor_accuracies = prepare_plot_data(all_results)\n", + "plot_accuracies(models, sensor_accuracies)\n" ] }, { From aaccad7ae8262452820529711d8166efff3bf1d9 Mon Sep 17 00:00:00 2001 From: nuluh Date: Sun, 1 Jun 2025 16:47:32 +0700 Subject: [PATCH 3/8] feat(glossaries): wip --- latex/frontmatter/glossaries.tex | 78 ++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 latex/frontmatter/glossaries.tex diff --git a/latex/frontmatter/glossaries.tex b/latex/frontmatter/glossaries.tex new file mode 100644 index 0000000..3351622 --- /dev/null +++ b/latex/frontmatter/glossaries.tex @@ -0,0 +1,78 @@ +% % A new command that enables us to enter bi-lingual (Slovene and English) terms +% % syntax: \addterm[options]{label}{Slovene}{Slovene first use}{English}{Slovene +% % description} +% \newcommand{\addterm}[6][]{ +% \newglossaryentry{#2}{ +% name={#3 (angl.\ #5)}, +% first={#4 (\emph{#5})}, +% text={#3}, +% sort={#3}, +% description={#6}, +% #1 % pass additional options to \newglossaryentry +% } +% } + +% % A new command that enables us to enter (English) acronyms with bi-lingual +% % (Slovene and English) long versions +% % syntax: \addacronym[options]{label}{abbreviation}{Slovene long}{Slovene first +% % use long}{English long}{Slovene description} +% \newcommand{\addacronym}[7][]{ +% % Create the main glossary entry with \newacronym +% % \newacronym[key-val list]{label}{abbrv}{long} +% \newacronym[ +% name={#4 (angl.\ #6,\ #3)}, +% first={\emph{#5} (angl.\ \emph{#6},\ \emph{#3})}, +% sort={#4}, +% description={#7}, +% #1 % pass additional options to \newglossaryentry +% ] +% {#2}{#3}{#4} +% % Create a cross-reference from the abbreviation to the main glossary entry by +% % creating an auxiliary glossary entry (note: we set the label of this entry +% % to '_auxiliary' to avoid clashes) +% \newglossaryentry{#2_auxiliary}{ +% name={#3}, +% sort={#3}, +% description={\makefirstuc{#6}}, +% see=[See:]{#2} +% } +% } + +% % Change the text of the cross-reference links to the Slovene long version. +% \renewcommand*{\glsseeitemformat}[1]{\emph{\acrlong{#1}}.} + +% Define the Indonesian term and link it to the English term +\newglossaryentry{jaringansaraf}{ + name=Jaringan Saraf, + description={The Indonesian term for \gls{nn}} +} +% \newglossaryentry{pemelajaranmesin}{ +% name=Pemelajaran Mesin, +% description={Lihat \gls{machinelearning}} +% } + +% Define the English term and link it to its acronym +\newglossaryentry{neuralnetwork}{ + name=Neural Network, + description={A computational model inspired by the human brain, see \gls{nn}} +} + +% \newglossaryentry{machinelearning}{ +% name=Machine Learning, +% description={A program or system that trains a model from input data. The trained model can make useful predictions from new (never-before-seen) data drawn from the same distribution as the one used to train the model.}} +% \newglossaryentry{pemelajaranmesin}{ +% name={pemelajaran mesin (angl.\ #5)}, +% first={pemelajaran mesin (\emph{machine learning})}, +% text={pemelajaran mesin}, +% sort={ }, +% description={#6}, +% #1 % pass additional options to \newglossaryentry +% } +\longnewglossaryentry{machinelearning}{name={machine learning}} +{A program or system that trains a model from input data. The trained model can make useful predictions from new (never-before-seen) data drawn from the same distribution as the one used to train the model.} +\newterm[see={machinelearning}]{pemelajaranmesin} +% \newglossaryentry{pemelajaran mesin}{} +% \addterm{machinelearning}{pemelajaran mesin}{pemelajaran mesin}{machine learning}{A program or system that trains a model from input data. The trained model can make useful predictions from new (never-before-seen) data drawn from the same distribution as the one used to train the model.} +\newacronym + [description={statistical pattern recognition technique}] + {svm}{SVM}{support vector machine} \ No newline at end of file From 7b934d3fba62d283e8e9090e239ca372864d555d Mon Sep 17 00:00:00 2001 From: nuluh Date: Tue, 3 Jun 2025 15:02:12 +0700 Subject: [PATCH 4/8] fix(acknowledgement): fix file naming --- latex/frontmatter/acknowledgement.tex | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 latex/frontmatter/acknowledgement.tex diff --git a/latex/frontmatter/acknowledgement.tex b/latex/frontmatter/acknowledgement.tex new file mode 100644 index 0000000..e69de29 From 8a3c1ae585e1c8ac6e93d56a863c13f9718e8531 Mon Sep 17 00:00:00 2001 From: nuluh Date: Tue, 3 Jun 2025 16:37:15 +0700 Subject: [PATCH 5/8] refactor(main): comment out unused input sections and update chapter includes --- latex/main.tex | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/latex/main.tex b/latex/main.tex index 35b5cb1..b4f2e8b 100644 --- a/latex/main.tex +++ b/latex/main.tex @@ -19,19 +19,16 @@ \maketitle \frontmatter -\input{frontmatter/approval}\clearpage -\input{frontmatter/originality}\clearpage -\input{frontmatter/acknowledgement}\clearpage +% \input{frontmatter/approval}\clearpage +% \input{frontmatter/originality}\clearpage +% \input{frontmatter/acknowledgement}\clearpage \tableofcontents \clearpage \mainmatter \pagestyle{fancyplain} -% Include content -\include{content/abstract} -\include{content/introduction} \include{chapters/01_introduction} -\include{content/chapter2} -\include{content/conclusion} +\include{chapters/id/02_literature_review/index} +\include{chapters/id/03_methodology/index} % Bibliography % \bibliographystyle{IEEEtran} From cdb3010b786518f2a5918efda72b94a54c924b51 Mon Sep 17 00:00:00 2001 From: nuluh Date: Tue, 3 Jun 2025 19:05:43 +0700 Subject: [PATCH 6/8] fix(documentclass): fix redefined bibliography strings error --- latex/thesis.cls | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/latex/thesis.cls b/latex/thesis.cls index 7aeb853..8c58b1f 100644 --- a/latex/thesis.cls +++ b/latex/thesis.cls @@ -24,15 +24,14 @@ \RequirePackage{svg} % Allows including SVG images directly \RequirePackage{indentfirst} % Makes first paragraph after headings indented \RequirePackage{float} % Provides [H] option to force figure/table placement - +\RequirePackage[style=apa, backend=biber, language=indonesian]{biblatex} % Polyglossia set language -+ \setdefaultlanguage[variant=indonesian]{malay} % Proper Indonesian language setup -+ \setotherlanguage{english} % Enables English as secondary language - -+ \DefineBibliographyStrings{english}{% % Customizes bibliography text -+ andothers={dkk\adddot}, % Changes "et al." to "dkk." -+ pages={hlm\adddot}, % Changes "pp." to "hlm." -+ } +\setdefaultlanguage[variant=indonesian]{malay} % Proper Indonesian language setup +\setotherlanguage{english} % Enables English as secondary language +% \DefineBibliographyStrings{english}{% % Customizes bibliography text +% andothers={dkk\adddot}, % Changes "et al." to "dkk." +% pages={hlm\adddot}, % Changes "pp." to "hlm." +% } % Conditionally load the watermark package and settings \if@draftmark @@ -56,8 +55,6 @@ \setsansfont{Arial} \setmonofont{Courier New} -% Metadata commands -\input{metadata} \newcommand{\setthesisinfo}[7]{% \renewcommand{\thesistitle}{#1}% From 1a994fd59cfbc30e82150e200cc221746413cda0 Mon Sep 17 00:00:00 2001 From: nuluh Date: Tue, 3 Jun 2025 19:10:01 +0700 Subject: [PATCH 7/8] fix(documentclass): restore and customize English bibliography strings --- latex/thesis.cls | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/latex/thesis.cls b/latex/thesis.cls index 8c58b1f..d1174d3 100644 --- a/latex/thesis.cls +++ b/latex/thesis.cls @@ -28,10 +28,10 @@ % Polyglossia set language \setdefaultlanguage[variant=indonesian]{malay} % Proper Indonesian language setup \setotherlanguage{english} % Enables English as secondary language -% \DefineBibliographyStrings{english}{% % Customizes bibliography text -% andothers={dkk\adddot}, % Changes "et al." to "dkk." -% pages={hlm\adddot}, % Changes "pp." to "hlm." -% } +\DefineBibliographyStrings{english}{% % Customizes bibliography text + andothers={dkk\adddot}, % Changes "et al." to "dkk." + pages={hlm\adddot}, % Changes "pp." to "hlm." +} % Conditionally load the watermark package and settings \if@draftmark From 76a09c02198fcecda419a80428845a4c4c471880 Mon Sep 17 00:00:00 2001 From: nuluh Date: Tue, 3 Jun 2025 19:17:08 +0700 Subject: [PATCH 8/8] refactor(documentclass): update title handling by using input files for maketitle Closes #91 --- latex/main.tex | 4 ++-- latex/thesis.cls | 3 --- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/latex/main.tex b/latex/main.tex index b4f2e8b..e0e3784 100644 --- a/latex/main.tex +++ b/latex/main.tex @@ -16,8 +16,8 @@ \input{preamble/macros} \begin{document} - -\maketitle +\input{frontmatter/maketitle} +\input{frontmatter/maketitle_secondary} \frontmatter % \input{frontmatter/approval}\clearpage % \input{frontmatter/originality}\clearpage diff --git a/latex/thesis.cls b/latex/thesis.cls index d1174d3..10e9199 100644 --- a/latex/thesis.cls +++ b/latex/thesis.cls @@ -109,9 +109,6 @@ % \titlespacing*{\chapter}{0pt}{-10pt}{20pt} -% Redefine \maketitle -\renewcommand{\maketitle}{\input{frontmatter/maketitle}} - % Chapter & Section format \renewcommand{\cftchapfont}{\normalsize\MakeUppercase} % \renewcommand{\cftsecfont}{}