[Tex/LaTex] Adding extra columns to the usnomencl nomenclature package

nomenclature

I use the package usnomencl to create nomenclatures e.g.

\setlength{\UnitLabelWdth}{0.4\textwidth}

\begin{Nomencl}[2em]
\item[$\zeta$] damping ratio
\item[$\theta$] \UnitLine{angular displacement}{rad}
\end{Nomencl}

Looking at the line:

\item[$\theta$] \UnitLine{angular displacement}{rad}

one can see that 3 columns are formed, the first one being the unit name, the second one mentioning what the unit stands for and the last column giving the unit symbol.

I would like to add an extra column at the end with the heading "Pages where defined or first used". And then I will manually add the corresponding page numbers.

Is there a way to accomplish this?

Best Answer

The usnomencl is a very simple nomenclature package that I have added to the University of Stellenbosch thesis (usthesis) bundle. It uses a list (description type) environment to set the nomenclature and would be difficult to add additional columns.

I would recommed a tabular type environment if you want more columns or a tabbing environment. Below is a proof of concept for a tabbing environment:

\documentclass{article}
\usepackage{sistyle} % or siunitx
\newcommand\bSI[1]{{\small[\SI{}{#1}]}}

\makeatletter
\newlength\unitwdth
\newlength\numwdth
\settowidth\unitwdth{\quad\bSI{m^3.kg^{-1}.s^{-2}}~}
\settowidth\numwdth{\quad 99}
\newlength\tdima
\newcommand\SIdescr[3]{%
    \setlength\tdima{\linewidth}%
    \addtolength\tdima{\@totalleftmargin}%
    \addtolength\tdima{-\dimen\@curtab}%
    \addtolength\tdima{-\unitwdth}%
    \addtolength\tdima{-\numwdth}%
    \parbox[t]{\tdima}{%
        #1
        \leaders\hbox{$\m@th\mkern \@dotsep mu\hbox{\tiny.}\mkern \@dotsep mu$}%
        \hfill
        \ifhmode\strut\fi
        \makebox[0pt][l]{%
            \makebox[\unitwdth][l]{\quad\bSI{#2}}%
            \makebox[\numwdth][l]{\quad #3}}}}
\makeatother

\begin{document}
\begin{tabbing}
    \parbox[t]{\linewidth}{\small      \hfill Pages\par              % Added
                                       \hfill where\par              % Added
                                 Symbol\hfill defined\par            % Added
                          \rule[.5\baselineskip]{\linewidth}{.5pt}}\\% Added

    \hspace*{1em}\=\hspace*{2em}\=\kill
    \>$x$ \> \SIdescr{coordinate in $x$ direction and a
             lot of other information to make it wrap}{m}{10}\\[1ex]
    \>$y$ \> \SIdescr{coordinate in $y$ direction}{m}{11}\\[1ex]

\end{tabbing}
\end{document}

enter image description here

Related Question