From 85a0aebf3609c73b730e1f995edd99c275c5d283 Mon Sep 17 00:00:00 2001 From: nuluh Date: Tue, 3 Jun 2025 20:54:45 +0700 Subject: [PATCH] feat(documentclass): add custom glossary style 'altlong3customheader' for notation with three-column layout Closes #95 --- latex/thesis.cls | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/latex/thesis.cls b/latex/thesis.cls index f4c0629..6c1e8c3 100644 --- a/latex/thesis.cls +++ b/latex/thesis.cls @@ -200,6 +200,52 @@ \glossentrydesc{##2}\space ##3% }% } + + +% Define the new glossary style 'altlong3customheader' for notation +\newglossarystyle{altlong3customheader}{% + % The glossary will be a longtable environment with three columns: + % 1. Symbol (left-aligned) + % 2. Description (paragraph, width \glsdescwidth) + % 3. Location (paragraph, width \glspagelistwidth) + \renewenvironment{theglossary}% + {\begin{longtable}{lp{\glsdescwidth}p{\glspagelistwidth}}}% + {\end{longtable}}% + % Define the table header row + \renewcommand*{\symbolname}{Simbol} + \renewcommand*{\descriptionname}{Keterangan} + \renewcommand*{\locationname}{Halaman} + \renewcommand*{\glossaryheader}{% + \bfseries\symbolname & \bfseries\descriptionname & \bfseries\locationname \tabularnewline\endhead}% + % Suppress group headings (e.g., A, B, C...) + \renewcommand*{\glsgroupheading}[1]{}% + % Define how a main glossary entry is displayed + % ##1 is the entry label + % ##2 is the location list (page numbers) + \renewcommand{\glossentry}[2]{% + \glsentryitem{##1}% Inserts entry number if entrycounter option is used + \glstarget{##1}{\glossentryname{##1}} & % Column 1: Symbol (with hyperlink target) + \glossentrydesc{##1}\glspostdescription & % Column 2: Description (with post-description punctuation) + ##2\tabularnewline % Column 3: Location list + }% + % Define how a sub-entry is displayed + % ##1 is the sub-entry level (e.g., 1 for first sub-level) + % ##2 is the entry label + % ##3 is the location list + \renewcommand{\subglossentry}[3]{% + & % Column 1 (Symbol) is left blank for sub-entries to create an indented look + \glssubentryitem{##2}% Inserts sub-entry number if subentrycounter is used + \glstarget{##2}{\strut}\glossentrydesc{##2}\glspostdescription & % Column 2: Description (target on strut for hyperlink) + ##3\tabularnewline % Column 3: Location list + }% + % Define the skip between letter groups (if group headings were enabled) + % For 3 columns, we need 2 ampersands for a full blank row if not using \multicolumn + \ifglsnogroupskip + \renewcommand*{\glsgroupskip}{}% + \else + \renewcommand*{\glsgroupskip}{& & \tabularnewline}% + \fi +} \makeatother \endinput \ No newline at end of file