0

Based on this topic, I have constructed the MWE seen below. It uses the glossaries package to produce a list of symbols with physical units. The list is supposed to have lines between the cells, just like a table. The lines are supposed to be black at the table head as well as at the borders of the list. Between each entry, the lines are supposed to be grey.

\documentclass{report}

\usepackage[dvipsnames,table]{xcolor} % The option "table" enables coloured tables.

\usepackage[unicode=true,breaklinks=false,backref=false,pdfstartview=FitH]{hyperref} % This package is inevitable in the project.

\usepackage[acronym,sort=standard,nonumberlist]{glossaries}

\setlength{\glsdescwidth}{0.6\linewidth} \newglossary[slg]{symbolslist}{syi}{syg}{List of physical quantities} % This is necessary in any case if a list of symbols is to be produced, no matter which style is used. \glsaddkey{unit}{\glsentrytext{\glslabel}}{\glsentryunit}{\GLsentryunit}{\glsunit}{\Glsunit}{\GLSunit} \newglossarystyle{symbunitlong}{ \setglossarystyle{long3col}% base this style on the list style \renewenvironment{theglossary}{% Change the table type --> 3 columns \begin{longtable}{| l | p{\glsdescwidth}|>{\centering\arraybackslash}p{2cm}|}} {\end{longtable}} \renewcommand{\glossaryheader}{% Change the table header \hline \bfseries Sign & \bfseries Description & \bfseries Unit \ \hline \endhead} \renewcommand{\glossentry}[2]{% Change the displayed items \glstarget{##1}{\glossentryname{##1}} % & \glossentrydesc{##1}% Description & \glsunit{##1} \tabularnewline \arrayrulecolor{lightgray}\hline\arrayrulecolor{black}}}

\makeglossaries % This seems to be necessary.

\newglossaryentry{sy-c}{name=\ensuremath{c}, description={velocity of light in vacuum}, unit={\ensuremath{\rm{m}/\rm{s}}}, type=symbolslist, sort=c}

\newglossaryentry{sy-height}{name=\ensuremath{h}, description={Height}, unit={\ensuremath{\rm{m}}}, type=symbolslist, sort=height}

\newglossaryentry{sy-h}{name=\ensuremath{h_{\rm{Pl}}}, description={Planck's constant}, unit={\ensuremath{\rm{J}\cdot\rm{s}}}, type=symbolslist, sort=hplanck}

\newglossaryentry{sy-pi}{name=\ensuremath{\pi}, description={Geometrical value}, unit={}, type=symbolslist, sort=pi}

\newglossaryentry{sy-power}{name=\ensuremath{P}, description={Power}, unit={\ensuremath{\rm{W}}}, type=symbolslist, sort=power}

\newglossaryentry{sy-x1}{name=\ensuremath{x_1}, description={Dimensionless energy of particle 1}, unit={}, type=symbolslist, sort=x1}

\newglossaryentry{sy-x2}{name=\ensuremath{x_2}, description={Dimensionless energy of particle 2}, unit={}, type=symbolslist, sort=x2}

\begin{document}

\gls{sy-c}\ \gls{sy-height}\ \gls{sy-h}\ \gls{sy-power}\ \gls{sy-pi}\ \gls{sy-x1}\ \gls{sy-x2}\

\printglossary \printglossary[type=symbolslist,style=symbunitlong] % Produce the list of symbols

\end{document}

Here is the relevant part of the output pdf:

enter image description here

Now, there are three problems that appear in the output pdf:

  1. Below the last list entry, there is a grey line. This line should be black, however. How can I achieve this?
  2. Why are the entries in the unit column hyperlinks? How can I suppress this?
  3. How can I suppress that an empty line is created each time a new alphabetic letter is listed?
Chris
  • 21
  • 1
    Regarding request 3: nogroupskip (e.g. as an option or \printglossary) should help. – leandriis Jan 12 '21 at 18:40
  • 1
    Regarding request 2: \glsentryunit{##1} instead of \glsunit{##1} should remove the hyperlink from the unit. – leandriis Jan 12 '21 at 18:48
  • @TVL: I was under the impression, OP wanted all horizontal lines to be light gray, except for the first two and the last one. – leandriis Jan 12 '21 at 18:58
  • For 1: change \arrayrulecolor{lightgray} to \arrayrulecolor{black}. All horizontal lines were grey and then are black (or red, if you like to ;) ) Edit: I just recognized, that you just want the inner horizontal lines to be grey, the outer black. I'm out, sorry :( – TVL Jan 12 '21 at 19:00
  • Thank you, @leandriis, for addressing the problems. Request 2 and 3 are perfectly solved. Request 1 remains. – Chris Feb 11 '21 at 10:51

0 Answers0