MakeIndex, Nomenclature, Glossaries and Acronymsglossaries | Problem with non-standard Page Numbering

Information and discussion about MakeIndex - the tool to generate subject indices for LaTeX documents.
Post Reply
toms125
Posts: 5
Joined: Fri Feb 01, 2013 5:31 pm

glossaries | Problem with non-standard Page Numbering

Post by toms125 »

Hello,

I am using the glossaries package in my report document using TeXworks.

I have created a new glossary "List of Symbols" that I am trying to display inside chapters with \printglossaries. If I use a classic page numbering like roman or arabic, the "List of Symbols" will contain all the symbols that are used with the command \gls{} or added with \glsadd{} or \glsaddall{}, which is fine.

However, when I redefine the page numbering to have chapter-page, the commands listed above don't add anymore the symbols to the "List of Symbols", which is therefore empty. The symbols are added only if the commands like \gls{} are used before redefining the page numbering.

Here is a minimal example of my code:

Code: Select all

\documentclass[11pt,a4paper,twoside]{report}
\usepackage{datatool}
\usepackage[hyperfirst=false,nowarn,nomain,acronym,nonumberlist,toc,shortcuts]{glossaries}

\newglossary[slg]{symbols}{sym}{sbl}{List of Symbols}
\newglossaryentry{Symbol1}{type=symbols,name=sym},
symbol=,
description=random symbol}
\makeglossaries

\begin{document}

%Redefining the page numbering for chapters
\renewcommand{\thepage}{\arabic{chapter}-\arabic{page}}
\let\oldchapter=\chapter
\def\resetpage{\setcounter{page}{1}}
\def\chapter{\expandafter\resetpage\oldchapter}

\chapter{Chapter 1}
%The list of symbol is empty...
\gls{Symbol1}
\printglossary[type=symbols]

\end{document}
If I don't redefine the page numbering for chapters, the symbol is printed in the "List of Symbols" but with this code it is not.

Does anyone have a solution for this?

Thank you!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
nlct
Posts: 276
Joined: Thu Nov 06, 2008 11:15 am

glossaries | Problem with non-standard Page Numbering

Post by nlct »

You need to change the page compositor to - (hyphen), since your locations are hyphen-separated numbers:

Code: Select all

\glsSetCompositor{-}
This must come before \makeglossaries. (You have to set the compositor even if you've used the nonumberlist option.)

Regards
Nicola Talbot
Post Reply