The way I would tackle this:
- I would create keys for the new types of columns to be created
- I would define the terns for the various types of nomenclature
- Print the specific glossaries
- Ensure your command line compile sequence has the additional makeindex calls
- 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.
- Recognize when you can reuse these styles
- 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
%=============================================================================
\glsaddkey
{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
\glsaddkey
{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
\glsaddkey
{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/71549/how-can-i-repeat-the-header-but-not-the-caption-with-longtable
%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}
{
\setglossarystyle{long3colheader}%
\renewcommand*{\glossaryheader}{%
%\toprule
Symbol & Description
\tabularnewline
\midrule
\endhead
%\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}
{
\setglossarystyle{long4colheader}%
\renewcommand*{\glossaryheader}{%
%\toprule
Symbol & Description & Dimensions & Units
\tabularnewline
\midrule
\endhead
%\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}
{
\setglossarystyle{long3colheader}%
\renewcommand*{\glossaryheader}{%
%\toprule
Symbol & Description & Definition
\tabularnewline
\midrule
\endhead
%\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}
The alttree
style uses \makebox
which won't allow line breaks. You could make a new style based on the alttree
style that uses a \parbox
instead. For example:
\documentclass[12pt,a4paper]{report}
\usepackage{amsmath}
\usepackage{longtable}
\usepackage[acronym,toc,nopostdot]{glossaries}
\glssetwidest[0]{...................}
\newglossaryentry{first_entry}{
name = $\omega_i$ ,
description = Description
}
\newglossaryentry{second_entry}{
name = {$f(epq_{i}, tlz_{i+1},\newline xy)$},
text = {$f(epq_{i}, tlz_{i+1}, xy)$},
description = {Description}
}
\makeatletter
\newglossarystyle{alttree2}{%
\setglossarystyle{alttree}%
\renewcommand{\glossentry}[2]{%
\ifnum\@gls@prevlevel=0\relax
\else
\settowidth{\glstreeindent}{\glstreenamefmt{\@glswidestname\space}}%
\fi
\hangindent\glstreeindent
\parindent\glstreeindent
\makebox[0pt][r]{\parbox[t]{\glstreeindent}{\raggedright
\glsentryitem{##1}\glstreenamefmt{\glstarget{##1}{\glossentryname{##1}}}}}%
\ifglshassymbol{##1}{(\glossentrysymbol{##1})\space}{}%
\glossentrydesc{##1}\glspostdescription \space ##2\par
\def\@gls@prevlevel{0}%
}%
}
\makeatother
\makeglossaries
\begin{document}
\glsaddall
\printglossary[nonumberlist, style = alttree2, title=Nomenclature]
\end{document}
This produces:
Edit:
The \parbox
's height affects the first line of the description, which I'd forgotten about. This can be eliminated by using \smash
like this:
\newglossarystyle{alttree2}{%
\setglossarystyle{alttree}%
\renewcommand{\glossentry}[2]{%
\ifnum\@gls@prevlevel=0\relax
\else
\settowidth{\glstreeindent}{\glstreenamefmt{\@glswidestname\space}}%
\fi
\hangindent\glstreeindent
\parindent\glstreeindent
\makebox[0pt][r]{\smash{\parbox[t]{\glstreeindent}{\raggedright
\glsentryitem{##1}\glstreenamefmt{\glstarget{##1}{\glossentryname{##1}}}}}}%
\ifglshassymbol{##1}{(\glossentrysymbol{##1})\space}{}%
\glossentrydesc{##1}\glspostdescription \space ##2\par
\def\@gls@prevlevel{0}%
}%
}
This modification to the above MWE now produces:
However, since this removes the \parbox
's height, if the description has fewer lines than the name this may cause the excess lines to clash with the next entry. If this is likely to happen, it may be better to use a tabular-like style. Another possibility you might want to consider is to allow the long name to overflow and start the description on the next line, like this:
\documentclass[12pt,a4paper]{report}
\usepackage{amsmath}
\usepackage{longtable}
\usepackage[acronym,toc,nopostdot]{glossaries}
\glssetwidest[0]{...................}
\newglossaryentry{first_entry}{
name = $\omega_i$ ,
description = Description
}
\newglossaryentry{second_entry}{
name = {$f(epq_{i}, tlz_{i+1}, xy)$},
description = {\newline Very long description lines with span several lines and gets broken by a blank line if the symbol span two line. Very long description lines with span several lines and gets broken by a blank line if the symbol span two line.}
}
\makeglossaries
\begin{document}
\glsaddall
\printglossary[nonumberlist, style = alttree, title=Nomenclature]
\end{document}
This produces:
Best Answer
The character
@
, like!
and|
is special for MakeIndex, so it must be escaped if needed literally. The way to escape is by preceding it with"
;babel
doesn't seem to be a problem in this respect.The
arara
directives are just in order to make compilation easier. If you uncomment thebabel
loading, you'll see that"
being a shorthand for German is not relevant for the problem at hand.