nlct / bib2gls

Command line application to convert .bib files to glossaries-extra.sty resource file
GNU General Public License v3.0
22 stars 1 forks source link

Provide an option to merge neighbouring locations with explicit ranges #20

Closed nlct closed 1 year ago

nlct commented 2 years ago

This is on my to-do list. Example:

\documentclass{report}

\usepackage{lipsum}
\usepackage[record]{glossaries-extra}

\GlsXtrLoadResources[src=example-glossaries-brief]

\begin{document}
\chapter{First}
\gls{lorem}

\chapter{Second}

\glsadd[format=(]{lorem}
\lipsum
\glsadd[format=)]{lorem}

\chapter{Third}
\gls{lorem}

\printunsrtglossaries
\end{document}

This results in the location list "1, 2–3, 4". I would like to be able to have an option that can compact this into "1–4".

nlct commented 1 year ago

This can now be done with the merge-ranges resource option added to bib2gls v3.1.