summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/stellenbosch-2/tex/stb-nomencl.sty
blob: c97b340da049dfd06b604dbebfa09bcf1c228969 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
%%
%% This is file `stb-nomencl.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% stb-nomencl.dtx  (with options: `pkg')
%% Copyright (C) 2023 Stellenbosch University
%% All rights reserved.
%% 
%% -------------------------------------------------------------------
%% Stellenbosch University Nomenclature for Theses and Reports
%% -------------------------------------------------------------------
%% 
%% Author:     Danie Els
%% Maintained: Danie Els (dnjels@sun.ac.za)
%% 
%% This work may be distributed and modified, and must be credited
%% under the conditions of the latest version of the Creative Commons
%% License (CC BY 4.0). The latest version of this license is in:
%% 
%%    https://creativecommons.org/licenses/by/4.0/
%% 
%% This package consists of the files:
%%     stb-nomencl.dtx
%%     stb-nomencl.ins
%% and the derived files:
%%     stb-nomencl.sty
%% -------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{stb-nomencl}[2023/07/25
                              v1.1
                              Stellenbosch Thesis Nomenclature (DNJ ELS)]
\RequirePackage{calc}
\newlength{\STBN@tdima}
\newlength{\STBN@NomGrpSep}
\newlength{\NomGrpSep}
\newlength{\NomItmSep}
\newlength{\NomItmMrg}
\newlength{\NomLblSep}
\setlength{\NomGrpSep}{\baselineskip}
\setlength{\NomItmSep}{\smallskipamount}
\setlength{\NomItmMrg}{1em}
\setlength{\NomLblSep}{1em}
\newcommand{\NomGrpLabel}[1]{\textbf{#1}}
\setlength{\STBN@NomGrpSep}{0pt}
\newcommand\NomGroup[1]{%<-Group Headings
   \vspace{\STBN@NomGrpSep}%
   \setlength{\STBN@NomGrpSep}{\NomGrpSep}%
   \item[\hspace*{-\NomItmMrg}\NomGrpLabel{#1}]}
\newcommand{\NomLabel}[1]{#1\hfil}
\newenvironment{Nomencl}[1][2em]%<- Nomenclature list environment
   {\list{}{%
      \setlength{\labelwidth}{#1}%
      \setlength{\labelsep}{\NomLblSep}%
      \setlength{\itemindent}{0pt}%
      \setlength{\leftmargin}{\labelwidth+\labelsep-\itemindent+\NomItmMrg}%
      \setlength{\listparindent}{\parindent}%
      \setlength{\itemsep}{\NomItmSep}%
      \setlength{\parsep}{\parskip}%
      \let\makelabel\NomLabel}}%
  {\endlist}
\newcommand*{\UnitLabel}[1]{~[\,\ensuremath{\mathrm{#1}}\,]}
\newlength{\UnitLabelWdth}
\setlength{\UnitLabelWdth}{2cm}
\newcommand{\UnitLine}[3][\UnitLabelWdth]{{%
    \setlength{\STBN@tdima}{#1}%
    \rightskip\STBN@tdima\relax
    \parfillskip -\rightskip
    \leavevmode
    {#2}\nobreak
    \leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{\tiny.}\mkern \@dotsep mu$}%
    \hfill
    \nobreak
    \makebox[\STBN@tdima][l]{\UnitLabel{#3}}%
}}
\endinput
%%
%% End of file `stb-nomencl.sty'.