From 8d1edfdbf70acc0f70200f349dac8e257072e6c7 Mon Sep 17 00:00:00 2001 From: nuluh Date: Tue, 3 Jun 2025 20:52:54 +0700 Subject: [PATCH] feat(glossaries): add glossary support with custom style for main glossaries entry and location header Closes 84 --- latex/thesis.cls | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/latex/thesis.cls b/latex/thesis.cls index c19b313..f4c0629 100644 --- a/latex/thesis.cls +++ b/latex/thesis.cls @@ -25,6 +25,7 @@ \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} +\RequirePackage[acronym, nogroupskip, toc]{glossaries} % Polyglossia set language \setdefaultlanguage[variant=indonesian]{malay} % Proper Indonesian language setup \setotherlanguage{english} % Enables English as secondary language @@ -170,4 +171,35 @@ % % \pagestyle{fancyplain}% switch for subsequent pages % % } +% Define the header for the location column +\providecommand*{\locationname}{Location} + +% Define the new glossary style called 'mylistalt' for main glossaries +\makeatletter +\newglossarystyle{mylistalt}{% + % start the list, initializing glossaries internals + \renewenvironment{theglossary}% + {\glslistinit\begin{enumerate}}% + {\end{enumerate}}% + % suppress all headers/groupskips + \renewcommand*{\glossaryheader}{}% + \renewcommand*{\glsgroupheading}[1]{}% + \renewcommand*{\glsgroupskip}{}% + % main entries: let \item produce "1." etc., then break + \renewcommand*{\glossentry}[2]{% + \item \glstarget{##1}{\glossentryname{##1}}% + \mbox{}\\ + \glossentrydesc{##1}\space + [##2] % appears on page x + }% + % sub-entries as separate paragraphs, still aligned + \renewcommand*{\subglossentry}[3]{% + \par + \glssubentryitem{##2}% + \glstarget{##2}{\strut}\space + \glossentrydesc{##2}\space ##3% + }% +} +\makeatother + \endinput \ No newline at end of file