# Converting a Nomenclature Example to Use Glossaries

I am hoping to get pointers for how to convert this example to use the glossaries package:

How to achieve nomenclature entries like: symbol, Description, Dimension and unit, etc?

The aforementioned post is exactly what I want, but I prefer glossaries as it is built-in to the wrapper I use (Latexian) to generate the pdf.

What steps would I need to take to 'rewrite' this?

Edit: MWE Layout, but non-working code:

Nomenclature

Acronyms
Symbol  Description     % no Dimensions and Units
EVRA    Euler Vector Rotation Angle
...

Greek Symbols
Symbol  Description             Dimensions     Units
alpha    angle of attack        1 or (-)       radians
...

Roman Symbols
Symbol  Description             Dimensions     Units
S       Surface area vector     L^2            m^2
...

Superscripts
Symbol  Description     % no Dimensions and Units
b       bottom surface
...

Dimensionless Numbers
Symbol  Description     Definition
Re      reynolds number  equation
...

\documentclass{article}
\usepackage{longtable}
\usepackage{siunitx}
\usepackage[acronym]{glossaries}
etc.

\newcommands % make it easy to add each type of nomenclature

\makeglossaries
\begin{document}
bunch of stuff \superscript[A]{$$A$$}{a dimensionless coefficient}{--}{1}

more stuff \acronym[EVRA]{$$EVRA$$}{Euler Vector Rotation Angle}

\printglossary[title=Nomenclature]

\end{document}

• I have never used nomenclature but I can help you configure for nomenclature in glossaries. Could you update your question to provide a small table of examples that give example data and describe some of the columns you would like included in your summary table of nomenclature? For example, dimensions and units are easy to add to the glossaries environment, but its implementation is more efficient with an example to work from. Formatting will be helpful but can be addressed as part of follow up. – EngBIRD May 19 '15 at 3:13
• I added a layout of what I am trying to accomplish in glossaries. Very similar to the previous post. I guess it's technically not a MWE, but a layout. – Dakota May 19 '15 at 7:35
• I believe the solution below is now complete. The custom table style is very simple but greatly extend-able with alternate table environments such as threeparttable. There are many great questions on this site with complex table styles for custom glossaries. – EngBIRD May 23 '15 at 1:08

The way I would tackle this:

1. I would create keys for the new types of columns to be created
2. I would define the terns for the various types of nomenclature
3. Print the specific glossaries
4. Ensure your command line compile sequence has the additional makeindex calls
5. Create a custom style for your glossary components, and use the newly created field keys to insert the information such as units, definitions, and dimensions.
6. Recognize when you can reuse these styles
7. Pay attention to the definitions of first={} in the \newglossaryentry{} because if it is absent, only the name will be used (possibly desired), but watch the result of this formatting carefully in your final document.

Comment/Note: I haven't explored how this solution would change when not exclusively the \gls{} commands in your tex. I prefer to use the \gls{} everywhere even though there is an acronym command already defined. I find this gives me flexibility when the glossary entry is being bounced around different types of glossaries.

\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage{longtable,floatrow,booktabs}
\usepackage{siunitx,microtype,textcomp,textgreek}
\usepackage[nogroupskip,toc,indexonlyfirst]{glossaries}

%=============================================================================
%   G L O S S A R Y   S E T U P
%=============================================================================

{unit}          % new key
{\relax}        % default value if "unit" isn't used in \newglossaryentry
{\glsentryunit} % analogous to \glsentrytext
{\Glsentryunit} % analogous to \Glsentrytext
{\glsunit}      % analogous to \glstext
{\Glsunit}      % analogous to \Glstext
{\GLSunit}      % analogous to \GLStext

{dimension}     % new key
{\relax}            % default value if "dimension" isn't used in \newglossaryentry
{\glsentrydim}      % analogous to \glsentrytext
{\Glsentrydim}      % analogous to \Glsentrytext
{\glsdim}           % analogous to \glstext
{\Glsdim}           % analogous to \Glstext
{\GLSdim}           % analogous to \GLStext

{def}       % new key
{\relax}            % default value if "prerequisite" isn't used in \newglossaryentry
{\glsentrydef}      % analogous to \glsentrytext
{\Glsentrydef}      % analogous to \Glsentrytext
{\glsdef}           % analogous to \glstext
{\Glsdef}           % analogous to \Glstext
{\GLSdef}           % analogous to \GLStext

\newglossary[alg]{acronym}{acr}{acn}{List of Acronyms}% if not using the acronyms package option - can declare it myself
\newglossary[nlgG]{notationGreek}{notG}{ntnG}{Greek Symbols}
\newglossary[nlgR]{notationRoman}{notR}{ntnR}{Roman Symbols}
\newglossary[dnlg]{dimensionlessNumber}{dnt}{dntn}{Dimensionless Numbers}
\newglossary[sslg]{superscript}{sst}{sstn}{Superscripts}

% please note these should be accompanied by command line calls to makeindex eg:

% "%MikTexPath%makeindex.exe" -s "main.ist" -t "main.glg"  -o "main.gls"  "main.glo"
% "%MikTexPath%makeindex.exe" -s "main.ist" -t "main.alg"  -o "main.acr"  "main.acn"
% "%MikTexPath%makeindex.exe" -s "main.ist" -t "main.nlgG" -o "main.notG" "main.ntnG"
% "%MikTexPath%makeindex.exe" -s "main.ist" -t "main.nlgR" -o "main.notR" "main.ntnR"
% "%MikTexPath%makeindex.exe" -s "main.ist" -t "main.dnlg" -o "main.dnt"  "main.dntn"
% "%MikTexPath%makeindex.exe" -s "main.ist" -t "main.sslg" -o "main.sst"  "main.sstn"

%==================================================================================================================================================================

%http://tex.stackexchange.com/questions/78016/questions-regarding-conversion-from-acronym-package-to-glossaries
%http://tex.stackexchange.com/questions/8946/how-to-combine-acronym-and-glossary
%http://tex.stackexchange.com/questions/26563/problems-with-glossaries-package-see-attribute

%http://tex.stackexchange.com/questions/126323/glossaries-list-only-page-number-of-the-first-occurrence

%\renewcommand*{\glspostdescription}{}%removes dot at end

\floatsetup[table]{style=ruled,
objectset=raggedright,
margins=raggedright,
midcode=captionskip,
captionskip=10pt}

\newglossarystyle{custom_acronyms}
{

%\toprule
Symbol & Description
\tabularnewline
\midrule

%\bottomrule
\endfoot
}%
\setlength\glsdescwidth{.4\textwidth}%
\setlength\glspagelistwidth{.95\textwidth}%
\renewcommand{\glossentry}[2]{\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & \glossentrydesc{##1}
\tabularnewline
}%
}

\newglossarystyle{custom_symbols}
{

%\toprule
Symbol & Description & Dimensions & Units
\tabularnewline
\midrule

%\bottomrule
\endfoot
}%
\setlength\glsdescwidth{.4\textwidth}%
\setlength\glspagelistwidth{.95\textwidth}%
\renewcommand{\glossentry}[2]{\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & \glossentrydesc{##1} & \glsentrydim{##1} & \glsentryunit{##1}
\tabularnewline
}%
}

\newglossarystyle{custom_dimlessnum}
{

%\toprule
Symbol & Description & Definition
\tabularnewline
\midrule

%\bottomrule
\endfoot
}%
\setlength\glsdescwidth{.4\textwidth}%
\setlength\glspagelistwidth{.95\textwidth}%
\renewcommand{\glossentry}[2]{\glsentryitem{##1}\glstarget{##1}{\glossentryname{##1}} & \glossentrydesc{##1} & \glsentrydef{##1}
\tabularnewline
}%
}

%==================================================================================================================================================================

\newglossaryentry{EVRA}{ type={acronym}, sort={EVRA},  name={EVRA}, short={EVRA}, long={Euler Vector Rotation Angle}, first={Euler Vector Rotation Angle (EVRA)}, description={Euler Vector Rotation Angle} }

\newglossaryentry{EVA}{ type={acronym}, sort={EVA},  name={EVA}, short={EVA}, long={Extra Vehicular Activity}, first={Extra Vehicular Activity (EVA)}, description={Extra Vehicular Activity} }

\newglossaryentry{angle of attack}{ type={notationGreek}, name={\textalpha}, first={angle of attack (\textalpha)}, description={angle of attack}, dimension={1 or (-)}, unit={radians} }

\newglossaryentry{SAvector}{ type={notationRoman}, name={S},description={Surface area vector}, first={surface area vector (S)}, dimension={\si{L^2}}, unit={\si{m^2}}}

\newglossaryentry{bS}{ type={superscript}, name={bS},description={bottom surface} }

\newglossaryentry{Re}{ type={dimensionlessNumber}, name={Re}, description={reynolds nummber}, def={math mode equation } }

\makeglossaries
\begin{document}
\noindent
Begin document:

First example is of an acronym:  Could call \gls{EVRA} and we would see the expansion.  \Gls{EVRA} again yields just the abbreviation.  Another acronym is \gls{EVA}
\medskip

Example of a greek symbol with dimensions and units \gls{angle of attack}
\medskip

Roman symbol example:  \gls{SAvector}, and \gls{SAvector}
\medskip

Superscript examble \gls{bS} (if included in the formula with the gls command, the  glossary can hyperlink to the use and automate the population of your superscript list )
\medskip

Dimensionless number such as reynolds number \gls{Re}

\printglossary[type=acronym,style=custom_acronyms]
\printglossary[type=notationGreek,style=custom_symbols]
\printglossary[type=notationRoman,style=custom_symbols]
\printglossary[type=superscript,style=custom_acronyms]
\printglossary[type=dimensionlessNumber,style=custom_dimlessnum]
%\printglossary[type=main]

\end{document}

• I am sorry, but what is the need for this piece of code \floatsetup[table]{style=ruled,...? – Diaa Aug 13 '16 at 19:59
• @DiaaAbidou I don't really know if it currently is needed or if float settings for tables are more or less standard nowadays, so it's possible you may not see any noticeable effect by including it. I probably got this from an older questions MWE, but looking at the raggedright and skips, I think this is basically just spacing and paragraph alignment controls for tables controlled globally by float. My custom glossary styles in the answer above are table based and so are subject to float influences/settings. A fresh question will certainly get you a better answer than I can provide. – EngBIRD Aug 15 '16 at 23:56