% This file is public domain. See the "Examples" chapter
% in the bib2gls user manual for a more detailed description
% of this file.

\documentclass[a4paper]{report}

\usepackage{siunitx}
\usepackage[record,% use bib2gls
 nomain,% don't define 'main' glossary
 section,% use \section* for glossary headings
 nostyles,% don't load default styles
 stylemods={mcols},% load glossary-mcols.sty and patch
 style=mcolindex]{glossaries-extra}

\newglossary*{baseunits}{Base Units}
\newglossary*{derivedunits}{Derived Units}

\GlsXtrLoadResources[
  src={baseunits},
  type=baseunits,
  % make @unit act like @symbol:
  entry-type-aliases={unit=symbol},
  field-aliases={
   unitname=name,
   unitsymbol=symbol,
   measurement=description
  },
  symbol-sort-fallback=name,
  selection={all}
]

\GlsXtrLoadResources[
  src={derivedunits},
  type=derivedunits,
  % make @measurement act like @symbol:
  entry-type-aliases={measurement=symbol},
  field-aliases={
   unitname=name,
   unitsymbol=symbol,
   measurement=description
  },
  symbol-sort-fallback=name,
  selection={all}
]

\begin{document}
\chapter*{Glossaries}

\printunsrtglossary[type=baseunits,nogroupskip]
\printunsrtglossary[type=derivedunits,style=indexgroup]
\end{document}
