0

I know how to change the counter used for referencing occurrences in the glossaries package options. For instance, I know how to use sections instead of pages.

Thing is, I have several glossaries in my document, and the most relevant counter for each of them is not the same (IMHO).

Is it possible to set a different counter for each glossary? For instance, can I use pages as a counter for a glossary, and sections for another?

If yes, how can I achieve that?

2 Answers 2

1

Well, looking at the documentation once more gave me the answer. I don't get how I missed this part as I have read it quite a number of times…

p. 174

\newglossary[〈log-ext〉]{〈name〉}{〈in-ext〉}{〈out-ext〉}{〈title〉}[〈counter〉]

So, it is easy to have counters on a per glossary basis, as you just may set the counter you want to use when creating a new glossary.

-1

You could perhaps use this snippet from my "personal documentation" :p

\documentclass{article}
\begin{document}

\section{New Counter}

You could use \verb!\newcounter{}! to  create a new counting thing. For example if you wanted to create a thing called \textit{Crap} and count how many craps I have you can do: \\

\verb!\newcounter{Crap}! \newcounter{Crap} and then use \verb!\stepcounter{Crap}! to move these forward: \\

\noindent
\stepcounter{Crap}\arabic{Crap}{.} One crap \\
\stepcounter{Crap}\arabic{Crap}{.} Two crap \\
\stepcounter{Crap}\arabic{Crap}{.} Three crap \\

Then if you might want to step these up a notch (or down) you can use \verb!\addtocounter{Name}{number}! \addtocounter{Crap}{3} to  reset the count: \\

\noindent
\stepcounter{Crap}\arabic{Crap}{.} Some crap which has been jumped up by 3. \\

To print the numbers of these craps you use labeling definitions like \verb!\arabic{Crap}! or \verb!\alph{Crap}! where you want the numbering to appear: \\

\noindent
\stepcounter{Crap} More crap (\alph{Crap}). \\
\stepcounter{Crap} Even more crap (\alph{Crap}). \\

To get the section/chapter numbers with it simply add a counter definition for the desired document part and what you want to separate, like \verb!\arabic{section}.\alph{Crap}! \\

\noindent
\stepcounter{Crap} This is the last crap: \arabic{section}.\alph{Crap} \\

To get a dot or a semicolon or some such thing after a nude counter label just add the symbol in curly brackets after the numbering definition like \verb!\arabic{Crap}{.}!. 

\end{document}
2
  • Sorry, but I don't see how your snippet is supposed to answer my question. You don't even load the glossaries package. I know how to create a custom counter and how to use it. I'll try to clarify my question with some example code as soon as possible. Oct 7, 2020 at 17:13
  • 1
    @Melchisedech I apologise for being unhelpful. I suppose it was my mistake for assuming that my own try-anything-approach works for others.
    – Plergux
    Oct 7, 2020 at 17:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.