TeX - LaTeX Asked on May 6, 2021
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.6linewidth}
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}|>{centeringarraybackslash}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}hlinearrayrulecolor{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}cdotrm{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:
Now, there are three problems that appear in the output pdf:
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP