From 254b24cb21d6420fc945e739f1bb8353722221b3 Mon Sep 17 00:00:00 2001 From: nuluh Date: Thu, 29 May 2025 20:35:35 +0700 Subject: [PATCH 01/24] 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", -- 2.49.1 From 7da3179d0863c827fd92f01cff360b12ecc852a5 Mon Sep 17 00:00:00 2001 From: nuluh Date: Thu, 29 May 2025 22:57:28 +0700 Subject: [PATCH 02/24] 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" ] }, { -- 2.49.1 From aaccad7ae8262452820529711d8166efff3bf1d9 Mon Sep 17 00:00:00 2001 From: nuluh Date: Sun, 1 Jun 2025 16:47:32 +0700 Subject: [PATCH 03/24] 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 -- 2.49.1 From 2c5c78b83c06e4fea62847bf38550a7650aea030 Mon Sep 17 00:00:00 2001 From: "Rifqi D. Panuluh" <69516665+nuluh@users.noreply.github.com> Date: Tue, 3 Jun 2025 13:09:41 +0700 Subject: [PATCH 04/24] Create latexdiff.yml --- .github/workflows/latexdiff.yml | 63 +++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/latexdiff.yml diff --git a/.github/workflows/latexdiff.yml b/.github/workflows/latexdiff.yml new file mode 100644 index 0000000..cba0465 --- /dev/null +++ b/.github/workflows/latexdiff.yml @@ -0,0 +1,63 @@ +name: Generate LaTeX Diff with flatex + +on: + workflow_dispatch: + inputs: + base_branch: + description: 'Base branch (older version)' + required: true + default: 'main' + compare_branch: + description: 'Compare branch (new version)' + required: true + default: 'dev' + +jobs: + latexdiff: + runs-on: ubuntu-latest + + steps: + - name: Checkout base branch + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.base_branch }} + path: base + + - name: Checkout compare branch + uses: actions/checkout@v4 + with: + ref: ${{ github.event.inputs.compare_branch }} + path: compare + + - name: Install TeX Live and flatex + run: | + sudo apt-get update + sudo apt-get install -y texlive-full + pip install flatex + + - name: Create output directory + run: mkdir -p diff_output + + - name: Flatten base/main.tex + run: | + flatex base/latex/main.tex > diff_output/base_flat.tex + + - name: Flatten compare/main.tex + run: | + flatex compare/latex/main.tex > diff_output/compare_flat.tex + + - name: Generate diff.tex + run: | + latexdiff diff_output/base_flat.tex diff_output/compare_flat.tex > diff_output/diff.tex + + - name: Compile diff.tex to PDF + working-directory: diff_output + run: | + xelatex -interaction=nonstopmode diff.tex + xelatex -interaction=nonstopmode diff.tex + + - name: Upload all diff artifacts + uses: actions/upload-artifact@v4 + with: + name: latex-diff-output + path: diff_output/ -- 2.49.1 From e9f953f731168ece23e20e07ba97b4e148205cea Mon Sep 17 00:00:00 2001 From: "Rifqi D. Panuluh" <69516665+nuluh@users.noreply.github.com> Date: Tue, 3 Jun 2025 13:26:38 +0700 Subject: [PATCH 05/24] Create latexmk.yml --- .github/workflows/latexmk.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/latexmk.yml diff --git a/.github/workflows/latexmk.yml b/.github/workflows/latexmk.yml new file mode 100644 index 0000000..b356dc0 --- /dev/null +++ b/.github/workflows/latexmk.yml @@ -0,0 +1,29 @@ +name: Render XeLaTeX on PR to dev + +on: + pull_request: + branches: + - dev + +jobs: + build-pdf: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Compile XeLaTeX + uses: dante-ev/latex-action@2021-A + with: + root_file: main.tex + working_directory: latex + compiler: xelatex + args: -interaction=nonstopmode -halt-on-error -file-line-error + extra_system_packages: "fonts-freefont-otf" + + - name: Upload compiled PDF + uses: actions/upload-artifact@v4 + with: + name: compiled-pdf + path: latex/main.pdf -- 2.49.1 From 3a17cc133105bfe44659206695f947fbc41453ae Mon Sep 17 00:00:00 2001 From: "Rifqi D. Panuluh" <69516665+nuluh@users.noreply.github.com> Date: Tue, 3 Jun 2025 13:42:35 +0700 Subject: [PATCH 06/24] Update latexdiff.yml using a pre-built TeX Live Docker image to avoid reinstalling texlive-full every run --- .github/workflows/latexdiff.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/latexdiff.yml b/.github/workflows/latexdiff.yml index cba0465..371a4e9 100644 --- a/.github/workflows/latexdiff.yml +++ b/.github/workflows/latexdiff.yml @@ -1,4 +1,4 @@ -name: Generate LaTeX Diff with flatex +name: LaTeX Diff on: workflow_dispatch: @@ -15,6 +15,9 @@ on: jobs: latexdiff: runs-on: ubuntu-latest + container: + image: ghcr.io/xu-cheng/texlive-full:latest + options: --user root # allow package install if needed steps: - name: Checkout base branch @@ -29,24 +32,23 @@ jobs: ref: ${{ github.event.inputs.compare_branch }} path: compare - - name: Install TeX Live and flatex + - name: Install flatex (Python flattener) run: | - sudo apt-get update - sudo apt-get install -y texlive-full + apk add --no-cache py3-pip # if Alpine base pip install flatex - - name: Create output directory + - name: Create output folder run: mkdir -p diff_output - - name: Flatten base/main.tex + - name: Flatten base branch run: | flatex base/latex/main.tex > diff_output/base_flat.tex - - name: Flatten compare/main.tex + - name: Flatten compare branch run: | flatex compare/latex/main.tex > diff_output/compare_flat.tex - - name: Generate diff.tex + - name: Generate diff.tex using latexdiff run: | latexdiff diff_output/base_flat.tex diff_output/compare_flat.tex > diff_output/diff.tex @@ -56,7 +58,7 @@ jobs: xelatex -interaction=nonstopmode diff.tex xelatex -interaction=nonstopmode diff.tex - - name: Upload all diff artifacts + - name: Upload diff output files uses: actions/upload-artifact@v4 with: name: latex-diff-output -- 2.49.1 From 26450026bb3fcee8ac718f9618e4fed108c59f60 Mon Sep 17 00:00:00 2001 From: "Rifqi D. Panuluh" <69516665+nuluh@users.noreply.github.com> Date: Tue, 3 Jun 2025 14:00:50 +0700 Subject: [PATCH 07/24] Update latexdiff.yml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix Alpine’s “externally‐managed‐environment” restriction by install flatex inside a virtual environment rather than system‐wide --- .github/workflows/latexdiff.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/latexdiff.yml b/.github/workflows/latexdiff.yml index 371a4e9..8b18607 100644 --- a/.github/workflows/latexdiff.yml +++ b/.github/workflows/latexdiff.yml @@ -17,7 +17,7 @@ jobs: runs-on: ubuntu-latest container: image: ghcr.io/xu-cheng/texlive-full:latest - options: --user root # allow package install if needed + options: --user root steps: - name: Checkout base branch @@ -32,23 +32,25 @@ jobs: ref: ${{ github.event.inputs.compare_branch }} path: compare - - name: Install flatex (Python flattener) + - name: Install flatex (in a virtualenv) run: | - apk add --no-cache py3-pip # if Alpine base + python3 -m venv /tmp/latex-venv + . /tmp/latex-venv/bin/activate pip install flatex + ln -s /tmp/latex-venv/bin/flatex /usr/local/bin/flatex - name: Create output folder run: mkdir -p diff_output - - name: Flatten base branch + - name: Flatten base/main.tex run: | flatex base/latex/main.tex > diff_output/base_flat.tex - - name: Flatten compare branch + - name: Flatten compare/main.tex run: | flatex compare/latex/main.tex > diff_output/compare_flat.tex - - name: Generate diff.tex using latexdiff + - name: Generate diff.tex run: | latexdiff diff_output/base_flat.tex diff_output/compare_flat.tex > diff_output/diff.tex @@ -63,3 +65,4 @@ jobs: with: name: latex-diff-output path: diff_output/ + -- 2.49.1 From 04546f8c358a25658cb143d1211e934f0da0472c Mon Sep 17 00:00:00 2001 From: "Rifqi D. Panuluh" <69516665+nuluh@users.noreply.github.com> Date: Tue, 3 Jun 2025 14:20:23 +0700 Subject: [PATCH 08/24] Update latexdiff.yml ensures that all \include{} or \input{} paths (which are relative to main.tex) resolve correctly --- .github/workflows/latexdiff.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/latexdiff.yml b/.github/workflows/latexdiff.yml index 8b18607..29dc259 100644 --- a/.github/workflows/latexdiff.yml +++ b/.github/workflows/latexdiff.yml @@ -44,13 +44,15 @@ jobs: - name: Flatten base/main.tex run: | - flatex base/latex/main.tex > diff_output/base_flat.tex + cd base/latex + flatex main.tex > ../../../diff_output/base_flat.tex - name: Flatten compare/main.tex run: | - flatex compare/latex/main.tex > diff_output/compare_flat.tex + cd compare/latex + flatex main.tex > ../../../diff_output/compare_flat.tex - - name: Generate diff.tex + - name: Generate diff.tex using latexdiff run: | latexdiff diff_output/base_flat.tex diff_output/compare_flat.tex > diff_output/diff.tex @@ -65,4 +67,3 @@ jobs: with: name: latex-diff-output path: diff_output/ - -- 2.49.1 From f8e9ac93a060ad91d071d17eaf38b71d68f05782 Mon Sep 17 00:00:00 2001 From: "Rifqi D. Panuluh" <69516665+nuluh@users.noreply.github.com> Date: Tue, 3 Jun 2025 14:27:00 +0700 Subject: [PATCH 09/24] Update latexdiff.yml fix path --- .github/workflows/latexdiff.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/latexdiff.yml b/.github/workflows/latexdiff.yml index 29dc259..43aceef 100644 --- a/.github/workflows/latexdiff.yml +++ b/.github/workflows/latexdiff.yml @@ -45,12 +45,12 @@ jobs: - name: Flatten base/main.tex run: | cd base/latex - flatex main.tex > ../../../diff_output/base_flat.tex + flatex main.tex > ../../diff_output/base_flat.tex - name: Flatten compare/main.tex run: | cd compare/latex - flatex main.tex > ../../../diff_output/compare_flat.tex + flatex main.tex > ../../diff_output/compare_flat.tex - name: Generate diff.tex using latexdiff run: | -- 2.49.1 From 05796d016562219c14355254d44abd0a3721bec3 Mon Sep 17 00:00:00 2001 From: "Rifqi D. Panuluh" <69516665+nuluh@users.noreply.github.com> Date: Tue, 3 Jun 2025 14:42:29 +0700 Subject: [PATCH 10/24] Create latex-lint.yml --- .github/workflows/latex-lint.yml | 48 ++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/latex-lint.yml diff --git a/.github/workflows/latex-lint.yml b/.github/workflows/latex-lint.yml new file mode 100644 index 0000000..7dfcb18 --- /dev/null +++ b/.github/workflows/latex-lint.yml @@ -0,0 +1,48 @@ +name: LaTeX Lint + +on: + push: + branches: + - main + - dev + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Install chktex and dependencies + run: | + sudo apt-get update + sudo apt-get install -y chktex + + - name: Find all .tex files and run chktex + run: | + # Exit with non-zero if any .tex file ha​s a lint error + files=$(find latex -type f -name "*.tex") + if [ -z "$files" ]; then + echo "No .tex files found under latex/—skipping lint." + exit 0 + fi + + echo "Running chktex on:" + echo "$files" | tr ' ' '\n' + + # Run chktex on each file; fail if any issues reported + # -q suppresses info messages; -n1 treats warnings/errors as fatal + FAIL=0 + for f in $files; do + chktex -q -n1 "$f" || FAIL=1 + done + + if [ $FAIL -ne 0 ]; then + echo "::error::Lint errors detected in one or more .tex files." + exit 1 + fi + + - name: Success message + if: ${{ always() && success() }} + run: echo "✅ All .tex files passed chktex lint." -- 2.49.1 From 1ad235866eb60348d3ea785234ee475740b558cd Mon Sep 17 00:00:00 2001 From: "Rifqi D. Panuluh" <69516665+nuluh@users.noreply.github.com> Date: Tue, 3 Jun 2025 14:44:52 +0700 Subject: [PATCH 11/24] Update latexdiff.yml --- .github/workflows/latexdiff.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/latexdiff.yml b/.github/workflows/latexdiff.yml index 43aceef..90ac205 100644 --- a/.github/workflows/latexdiff.yml +++ b/.github/workflows/latexdiff.yml @@ -6,11 +6,9 @@ on: base_branch: description: 'Base branch (older version)' required: true - default: 'main' compare_branch: description: 'Compare branch (new version)' required: true - default: 'dev' jobs: latexdiff: -- 2.49.1 From dbc62fea32ebb0f40c6acf609b332dcd133f6385 Mon Sep 17 00:00:00 2001 From: "Rifqi D. Panuluh" <69516665+nuluh@users.noreply.github.com> Date: Tue, 3 Jun 2025 15:01:15 +0700 Subject: [PATCH 12/24] Update latex-lint.yml --- .github/workflows/latex-lint.yml | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/.github/workflows/latex-lint.yml b/.github/workflows/latex-lint.yml index 7dfcb18..096e5cf 100644 --- a/.github/workflows/latex-lint.yml +++ b/.github/workflows/latex-lint.yml @@ -5,44 +5,39 @@ on: branches: - main - dev + paths: + - 'latex/**/*.tex' + - 'latex/main.tex' jobs: lint: runs-on: ubuntu-latest steps: - - name: Check out repository + - name: Checkout repository uses: actions/checkout@v4 - - name: Install chktex and dependencies + - name: Install chktex run: | sudo apt-get update sudo apt-get install -y chktex - - name: Find all .tex files and run chktex + - name: Run chktex inside latex/ + working-directory: latex run: | - # Exit with non-zero if any .tex file ha​s a lint error - files=$(find latex -type f -name "*.tex") - if [ -z "$files" ]; then - echo "No .tex files found under latex/—skipping lint." + TEX_FILES=$(find . -type f -name "*.tex") + if [ -z "$TEX_FILES" ]; then + echo "No .tex files found in latex/. Skipping lint." exit 0 fi - echo "Running chktex on:" - echo "$files" | tr ' ' '\n' - - # Run chktex on each file; fail if any issues reported - # -q suppresses info messages; -n1 treats warnings/errors as fatal + echo "Linting .tex files with chktex..." FAIL=0 - for f in $files; do + for f in $TEX_FILES; do chktex -q -n1 "$f" || FAIL=1 done if [ $FAIL -ne 0 ]; then - echo "::error::Lint errors detected in one or more .tex files." + echo "::error::Lint errors detected." exit 1 fi - - - name: Success message - if: ${{ always() && success() }} - run: echo "✅ All .tex files passed chktex lint." -- 2.49.1 From 7b934d3fba62d283e8e9090e239ca372864d555d Mon Sep 17 00:00:00 2001 From: nuluh Date: Tue, 3 Jun 2025 15:02:12 +0700 Subject: [PATCH 13/24] 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 -- 2.49.1 From fe801b0a1caf98db3dbdcf96d40138f853f8988b Mon Sep 17 00:00:00 2001 From: "Rifqi D. Panuluh" <69516665+nuluh@users.noreply.github.com> Date: Tue, 3 Jun 2025 15:16:16 +0700 Subject: [PATCH 14/24] Update latex-lint.yml --- .github/workflows/latex-lint.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/latex-lint.yml b/.github/workflows/latex-lint.yml index 096e5cf..91f216b 100644 --- a/.github/workflows/latex-lint.yml +++ b/.github/workflows/latex-lint.yml @@ -8,7 +8,8 @@ on: paths: - 'latex/**/*.tex' - 'latex/main.tex' - + workflow_dispatch: + jobs: lint: runs-on: ubuntu-latest -- 2.49.1 From fd765b113ff1e9091b46b7a565c0ce269d9bb7eb Mon Sep 17 00:00:00 2001 From: "Rifqi D. Panuluh" <69516665+nuluh@users.noreply.github.com> Date: Tue, 3 Jun 2025 15:35:51 +0700 Subject: [PATCH 15/24] Update latex-lint.yml --- .github/workflows/latex-lint.yml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/latex-lint.yml b/.github/workflows/latex-lint.yml index 91f216b..5882f00 100644 --- a/.github/workflows/latex-lint.yml +++ b/.github/workflows/latex-lint.yml @@ -31,14 +31,22 @@ jobs: echo "No .tex files found in latex/. Skipping lint." exit 0 fi - - echo "Linting .tex files with chktex..." + + echo "🔍 Linting .tex files with chktex..." FAIL=0 + for f in $TEX_FILES; do - chktex -q -n1 "$f" || FAIL=1 + echo "▶ Checking $f" + # Run chktex and show output; capture error status + if ! chktex "$f"; then + echo "::warning file=$f::ChkTeX found issues in $f" + FAIL=1 + fi done - + if [ $FAIL -ne 0 ]; then - echo "::error::Lint errors detected." + echo "::error::❌ Lint errors or warnings were found in one or more .tex files above." exit 1 + else + echo "✅ All files passed chktex lint." fi -- 2.49.1 From 8a3c1ae585e1c8ac6e93d56a863c13f9718e8531 Mon Sep 17 00:00:00 2001 From: nuluh Date: Tue, 3 Jun 2025 16:37:15 +0700 Subject: [PATCH 16/24] 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} -- 2.49.1 From 4851a9aa5da74d8679ebff6718c5519fc7a5ad54 Mon Sep 17 00:00:00 2001 From: "Rifqi D. Panuluh" <69516665+nuluh@users.noreply.github.com> Date: Tue, 3 Jun 2025 17:05:30 +0700 Subject: [PATCH 17/24] Update latexdiff.yml --- .github/workflows/latexdiff.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/latexdiff.yml b/.github/workflows/latexdiff.yml index 90ac205..f563db9 100644 --- a/.github/workflows/latexdiff.yml +++ b/.github/workflows/latexdiff.yml @@ -53,6 +53,14 @@ jobs: - name: Generate diff.tex using latexdiff run: | latexdiff diff_output/base_flat.tex diff_output/compare_flat.tex > diff_output/diff.tex + - name: Upload flattened .tex and diff.tex early + uses: actions/upload-artifact@v4 + with: + name: latex-diff-tex + path: | + diff_output/base_flat.tex + diff_output/compare_flat.tex + diff_output/diff.tex - name: Compile diff.tex to PDF working-directory: diff_output -- 2.49.1 From 643c0ebce1f92142fc853e46a2c77e47a44d0089 Mon Sep 17 00:00:00 2001 From: "Rifqi D. Panuluh" <69516665+nuluh@users.noreply.github.com> Date: Tue, 3 Jun 2025 17:19:07 +0700 Subject: [PATCH 18/24] Update latexdiff.yml --- .github/workflows/latexdiff.yml | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/latexdiff.yml b/.github/workflows/latexdiff.yml index f563db9..99d7f2e 100644 --- a/.github/workflows/latexdiff.yml +++ b/.github/workflows/latexdiff.yml @@ -43,12 +43,22 @@ jobs: - name: Flatten base/main.tex run: | cd base/latex - flatex main.tex > ../../diff_output/base_flat.tex + echo "📂 Listing files in base/latex:" + ls -R + echo "🔄 Flattening base/latex/main.tex..." + flatex --stdout main.tex > ../../diff_output/base_flat.tex + echo "✅ base_flat.tex preview:" + head -n 50 ../../diff_output/base_flat.tex - name: Flatten compare/main.tex run: | cd compare/latex - flatex main.tex > ../../diff_output/compare_flat.tex + echo "📂 Listing files in compare/latex:" + ls -R + echo "🔄 Flattening compare/latex/main.tex..." + flatex --stdout main.tex > ../../diff_output/compare_flat.tex + echo "✅ compare_flat.tex preview:" + head -n 50 ../../diff_output/compare_flat.tex - name: Generate diff.tex using latexdiff run: | -- 2.49.1 From 033d9493250b2f70225e5d78397e861caec095e4 Mon Sep 17 00:00:00 2001 From: "Rifqi D. Panuluh" <69516665+nuluh@users.noreply.github.com> Date: Tue, 3 Jun 2025 17:29:50 +0700 Subject: [PATCH 19/24] Update latexdiff.yml --- .github/workflows/latexdiff.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/latexdiff.yml b/.github/workflows/latexdiff.yml index 99d7f2e..8c7c088 100644 --- a/.github/workflows/latexdiff.yml +++ b/.github/workflows/latexdiff.yml @@ -46,7 +46,7 @@ jobs: echo "📂 Listing files in base/latex:" ls -R echo "🔄 Flattening base/latex/main.tex..." - flatex --stdout main.tex > ../../diff_output/base_flat.tex + flatex main.tex ../../diff_output/base_flat.tex echo "✅ base_flat.tex preview:" head -n 50 ../../diff_output/base_flat.tex @@ -56,7 +56,7 @@ jobs: echo "📂 Listing files in compare/latex:" ls -R echo "🔄 Flattening compare/latex/main.tex..." - flatex --stdout main.tex > ../../diff_output/compare_flat.tex + flatex main.tex ../../diff_output/compare_flat.tex echo "✅ compare_flat.tex preview:" head -n 50 ../../diff_output/compare_flat.tex -- 2.49.1 From 8dbb448b3217b283f1ef5cbf8a70de9cd77ff70d Mon Sep 17 00:00:00 2001 From: "Rifqi D. Panuluh" <69516665+nuluh@users.noreply.github.com> Date: Tue, 3 Jun 2025 18:00:43 +0700 Subject: [PATCH 20/24] Update latexdiff.yml --- .github/workflows/latexdiff.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/latexdiff.yml b/.github/workflows/latexdiff.yml index 8c7c088..e850868 100644 --- a/.github/workflows/latexdiff.yml +++ b/.github/workflows/latexdiff.yml @@ -18,6 +18,11 @@ jobs: options: --user root steps: + - name: Install latexpand (Perl script) + run: | + tlmgr init-usertree + tlmgr install latexpand + - name: Checkout base branch uses: actions/checkout@v4 with: @@ -30,34 +35,29 @@ jobs: ref: ${{ github.event.inputs.compare_branch }} path: compare - - name: Install flatex (in a virtualenv) - run: | - python3 -m venv /tmp/latex-venv - . /tmp/latex-venv/bin/activate - pip install flatex - ln -s /tmp/latex-venv/bin/flatex /usr/local/bin/flatex - name: Create output folder run: mkdir -p diff_output - - name: Flatten base/main.tex + - name: Flatten base/main.tex (with latexpand) run: | cd base/latex echo "📂 Listing files in base/latex:" ls -R - echo "🔄 Flattening base/latex/main.tex..." - flatex main.tex ../../diff_output/base_flat.tex - echo "✅ base_flat.tex preview:" + echo "🔄 Flattening with latexpand..." + latexpand --verbose --keep-comments --output=../../diff_output/base_flat.tex main.tex + echo "✅ Preview of base_flat.tex:" head -n 50 ../../diff_output/base_flat.tex - - name: Flatten compare/main.tex + + - name: Flatten compare/main.tex (with latexpand) run: | cd compare/latex echo "📂 Listing files in compare/latex:" ls -R - echo "🔄 Flattening compare/latex/main.tex..." - flatex main.tex ../../diff_output/compare_flat.tex - echo "✅ compare_flat.tex preview:" + echo "🔄 Flattening with latexpand..." + latexpand --verbose --keep-comments --output=../../diff_output/compare_flat.tex main.tex + echo "✅ Preview of compare_flat.tex:" head -n 50 ../../diff_output/compare_flat.tex - name: Generate diff.tex using latexdiff -- 2.49.1 From e5b98064628b7b61ff0e6b7f459a9947da2b2dd9 Mon Sep 17 00:00:00 2001 From: "Rifqi D. Panuluh" <69516665+nuluh@users.noreply.github.com> Date: Tue, 3 Jun 2025 18:09:18 +0700 Subject: [PATCH 21/24] Update latexdiff.yml --- .github/workflows/latexdiff.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/latexdiff.yml b/.github/workflows/latexdiff.yml index e850868..235e237 100644 --- a/.github/workflows/latexdiff.yml +++ b/.github/workflows/latexdiff.yml @@ -63,6 +63,7 @@ jobs: - name: Generate diff.tex using latexdiff run: | latexdiff diff_output/base_flat.tex diff_output/compare_flat.tex > diff_output/diff.tex + - name: Upload flattened .tex and diff.tex early uses: actions/upload-artifact@v4 with: @@ -71,7 +72,10 @@ jobs: diff_output/base_flat.tex diff_output/compare_flat.tex diff_output/diff.tex - + + - name: Copy thesis.cls to diff_output + run: cp compare/latex/thesis.cls diff_output/ + - name: Compile diff.tex to PDF working-directory: diff_output run: | -- 2.49.1 From cdb3010b786518f2a5918efda72b94a54c924b51 Mon Sep 17 00:00:00 2001 From: nuluh Date: Tue, 3 Jun 2025 19:05:43 +0700 Subject: [PATCH 22/24] 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}% -- 2.49.1 From 1a994fd59cfbc30e82150e200cc221746413cda0 Mon Sep 17 00:00:00 2001 From: nuluh Date: Tue, 3 Jun 2025 19:10:01 +0700 Subject: [PATCH 23/24] 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 -- 2.49.1 From 76a09c02198fcecda419a80428845a4c4c471880 Mon Sep 17 00:00:00 2001 From: nuluh Date: Tue, 3 Jun 2025 19:17:08 +0700 Subject: [PATCH 24/24] 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}{} -- 2.49.1