1

I think I may have run into a bug in the glossaries-extra (and hence, possibly glossaries) package.

I like to keep my preamble grouped in a thematic manner, eg. all standard packages (such as amsmath packages, etc.) go in one file standard_preamble.tex which is input into the file preamble.tex under the folder - Preamble. 2nd example - all packages belonging to tikz go in the file tikz_stuff.tex which is input into the file preamble.tex. Finally, the preamble.tex itself is included into the main document, main.tex .

Here is the directory structure to clarify up things

project_root
|-- 0_frontmatter
|   |-- abstract.tex
|   |-- acknowledgement.tex
|    -- dedication.tex
|
|-- Preamble
|   |-- preamble.tex
|   |-- standard_preamble.tex
|   |-- glossaries_preamble.tex
|   |-- tikz_stuff.tex
|-- latexmkrc
 -- main.tex

The usepackage invokation for glossaries-extra in Preamble/glossaries_preamble.tex does not work. In particular, if the usepackage line is not situated in main.tex, this does not produce a corresponding main.acr file for producing glossaries.

Here is a minimal example that demonstrates the problem.

\include{Preamble/preamble} % <----- This is problematic for glossaries

% the below invocation works fine
% \usepackage[translate=babel,abbreviations,nomain,indexonlyfirst,acronym]{glossaries-extra} 

\setabbreviationstyle[acronym]{long-short}
\makeglossaries
\newacronym{zoh}{ZOH}{Zero Order Hold}

\begin{document}
The \gls{zoh} circuit works well. We use \gls{zoh} for \dots blah \dots

\printglossary[type=acronym]
\end{document}

The file Preamble/preamble.tex contains just one line \input{Preamble/glossaries_preamble.tex.

The file glossaries_preamble.tex simply contains the same invocation as the commented-out line in main.tex i.e. \usepackage[translate=babel,abbreviations,nomain,indexonlyfirst,acronym]{glossaries-extra}

To summarize, glossaries-extra seems to be having problems with its loading from subfolders of the project. Any thoughts?

  • 3
    Do not use \include in the preamble. Replace it by \input. – esdd Jul 15 '18 at 13:08
  • 1
    @esdd aargh. That was indeed the problem. I am so sorry. What a silly mistake indeed. Thank you for pointing this out. – Dr Krishnakumar Gopalakrishnan Jul 15 '18 at 13:14
1

The problem was due to the wrong usage of include in the preamble. When include is replaced with input, everything works as expected. Sorry for the noise.

| improve this answer | |

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.