# Problems with printglossaries in Main.tex using external glossary file and external chapters tex files

I'm writing a heavy PhD thesis structured in several chapters. Each chapter has many figures, acronyms, symbols and equations. So I decided to structure in separated folders of Figures, Chapters texts, Glossaries, Acronyms and Symbols. There is a Main.tex calling the chapters and glossaries.

All the acronyms of the thesis entries are gathered in only one file as glossaries and symbols as well.

The fact is that after compiling, the aspect is quite good but the list of glossaries, acronyms and symbols don't appear. I have observe that if a \gls{ } is placed in the Main.tex \printglossaries is effective but if they are placed in the different chapter texts located in other folders, \printglossaries does not work.

Sorry. I have tried to upload several times my MWE. This is the content ofMain.tex:

\documentclass[10pt,a4paper, twoside,titlepage]{report}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{sidecap}
\usepackage[left=4cm,right=3cm,top=3cm,bottom=2cm]{geometry}
\usepackage[sort]{natbib}

\title{Title of Thesis}
\author{Name of author}
\date{Presentation date}

%Package for header and footer customization
\usepackage{fancyhdr}
\usepackage{chappg}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[RE,LO]{Author's name - PhD thesis title}
\fancyfoot[CE,CO]{\thepage}

\renewcommand{\footrulewidth}{1pt}

%Additional counter for Table of content' depth control
\setcounter{tocdepth}{4}

\usepackage{setspace}
\onehalfspacing

\usepackage[acronym,toc]{glossaries}

\newglossary[slg]{symbols}{sym}{sbl}{List of Symbols}

\makeglossaries

\begin{document}

\tableofcontents

\input{Chapters/Chapter2}

\printglossaries


Chapter 2 is placed in other folder called "Chapters". glosario.tex, acronimos.tex and simbolos.tex are placed in folder Chapters as well.

The content of chapter 2 is:

\chapter{Governing Equations}

\label{Chapter2}

\section{Introduction}

\section{Near-wall treatment}

\subsection{Texto de tutorial}

The k- models, the RSM, and the  \gls{les} model are primarily valid for turbulent core
flows (i.e., the flow in the regions somewhat far from walls). Consideration therefore
needs to be given as to how to make these models suitable for wall-bounded flows. The
Spalart-Allmaras and $k-\omega$ models were designed to be applied throughout
the boundary layer, provided that the near-wall mesh resolution is sufficient.

\section{Diplomatic Memoirs}

When I was an \gls{attache}, I lived in a \gls{culdesac}, but
I didn't much care for it as I found there was a fair amount
of \gls{elitism} amongst my neighbours.

\section{Student Memoirs}

When I was a student I often left bits of electronic circuitry
in my pockets, such as \glspl{led} and \glspl{eeprom}, which
often ended up in the washing machine. The \glspl{led} didn't
fair too badly, but the \glspl{eeprom} frequently broke.

\section{Symbols}

The \gls{angstrom} is commonly used in structural biology,
whereas the \gls{ohm} is used in electronics.


The content of glosario.tex is: % The following definitions will go in the main glossary

\newglossaryentry{culdesac}{name=cul-de-sac,description={passage
or street closed at one end},plural=culs-de-sac}

\newglossaryentry{elite}{name={\'e}lite,description={select
group or class},sort=elite}

of dominance by an \gls{elite}},sort=elitism}

\newglossaryentry{attache}{name=attach\'e,
description={person with special diplomatic responsibilities}}


The content of acronimos.tex is:

% The following definitions will go in the list of acronyms

\newacronym{led}{LED}{light-emitting diode}

\newacronym{eeprom}{EEPROM}{electrically erasable programmable

\newacronym{dsf}{DSF}{Deterministic Separated Flow}
\newacronym{les}{LES}{Large Eddy Simulation}


The content of simbolos.tex is:

% The following definitions will go in the list of symbols

\newglossaryentry{ohm}{type=symbols,name=ohm,
symbol={\ensuremath{\Omega}},
description=unit of electrical resistance}

\newglossaryentry{angstrom}{type=symbols,name={\aa}ngstr\"om,
symbol={\AA},sort=angstrom,
description={non-SI unit of length}}

• Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – darthbith Mar 19 '15 at 21:41
• Have you included your entries with \loadglsentries{} and included a \makeglossaries and/or \makeindex command in your tex file? Have you also included makeindex.exe commands as part of your compile sequence? – EngBIRD Mar 19 '15 at 21:44

Glossary information is only written to the external files when commands like \gls are used. Without a minimal working example, it's difficult to say for certain, but if you're using \include then it may be possible that you're using a command like \includeonly to only selectively include chapters. If the excluded files contain commands like \gls they'll be skipped when the file is skipped, which means that they won't be written to the glossary file and no glossary will appear.

Here's an example. The main file test.tex:

\documentclass{report}

\usepackage{glossaries}

\makeglossaries

\begin{document}

\include{chapters/test-ch1}

\include{chapters/test-ch2}

\include{chapters/test-ch3}

\printglossaries

\end{document}


In the chapters directory (folder) the files are:

test-ch1.tex:

\chapter{Sample}

\gls{lorem}


test-ch2.tex:

\chapter{Another}

\gls{dolor}


test-ch3.tex:

\chapter{No Glossary Entries Here}


Now the following document build sequence:

pdflatex test
makeglossaries test
pdflatex test


will correctly generate the glossary. However, suppose I now add

\includeonly{chapters/test-ch3}


to the preamble. This excludes the two chapters that use \gls and only includes the chapter that doesn't contain any \gls (or similar) command. This means that nothing is written to the glossary. Now recompile (rebuild) the document:

pdflatex test
makeglossaries test


This produces an error message from makeglossaries:

makeglossaries version 2.15 (2014-07-30)
Warning: File 'test.glo' is empty.
Have you used any entries defined in glossary 'main'?
Remember to use package option 'nomain' if you
don't want to use the main glossary.


This is because nothing has been written to test.glo because all the commands that perform that write have been skipped.

What should you do? Well, if you're excluding chapters, that means you're still working on the document, in which case it doesn't matter. The document is already an incomplete draft since there are some chapters missing, so just skip the makeglossaries step until you're ready to check the entire document rather than just the particular chapter you're working on. Once you go back to including the files that contain glossary references, then go back to building the glossary.

Edit: Another possibility is that you may be using an old version of makeglossaries which didn't pick up \@input from the .aux file. This was corrected in makeglossaries version 1.9 (distributed with glossaries v2.07 2010/07/10).

I have been unable to reproduce your problem so here is a MWE that I believe parallels your structure.

Main Tex file:

\documentclass{report}
\usepackage[utf8]{inputenc}

\setlength\parindent{0pt}

%=========================================================================================================================================
% PACKAGES REQUIRED FOR GLOSSARIES
%=========================================================================================================================================

% Glossaries must be loaded before amsmath as per details in the following forum answer
% http://tex.stackexchange.com/questions/85696/what-causes-this-strange-interaction-between--and-amsmath
\usepackage[nogroupskip,toc,acronym]{glossaries} % must come after href
\usepackage{scrwfile}%http://www.dickimaw-books.com/cgi-bin/faq.cgi?action=view&categorylabel=glossaries#glsnewwriteexceeded
\makeglossaries

\newglossaryentry{ICPMS}{ type={acronym}, sort={inductively coupled plasma mass spectrometry},  name={ICPMS}, short={ICPMS}, long={inductively coupled plasma mass spectrometry}, first={inductively coupled plasma mass spectrometry (ICPMS)}, description={inductively coupled plasma mass spectrometry} }

\begin{document}

\part{Abbreviations in a full glossary example}
\input{src/a}

\part{Abbreviations repeated}
\glslocalresetall[acronym]
\input{src/b}

\part{glossaries}
\printglossary[type=acronym]

\end{document}


Contents of src/a.tex

\chapter{First}
\begin{itemize}
\item \gls{ICPMS}
\item this term is fully expanded and summarized on first use which displays \gls{ICPMS}
\item this both makes sense because \gls{ICPMS} has appeared multiple times and because this is exactly what is what the documentation describes.
\item This is likely exactly the situation glossaries was designed for...
\end{itemize}


Contents of src/b.tex

\chapter{next}
I have just reset the acronyms.  And will use it again

\begin{itemize}
\item \gls{ICPMS}
\item \gls{ICPMS}
\end{itemize}


Compiled with a bat file in the same directory as the main tex file:

:CheckOS
IF "%PROCESSOR_ARCHITECTURE%"=="x86" (GOTO 32BIT) ELSE (GOTO 64BIT)

:64BIT
ECHO 64-bit compiling
SET MikTexPath=C:\Program Files\MiKTeX 2.9\miktex\bin\x64\
GOTO END

:32BIT
ECHO 32-bit compiling
SET MikTexPath=C:\Program Files\MiKTeX 2.9\miktex\bin\
GOTO END

:END

SET TeXCompilier=xelatex.exe

FOR %%A IN (*.tex) DO (
"%MikTexPath%%TeXCompilier%" "%%~nxA" &_
"%MikTexPath%makeindex.exe" -s "%%~nA.ist" -t "%%~nA.glg" -o "%%~nA.gls" "%%~nA.glo" &_
"%MikTexPath%makeindex.exe" -s "%%~nA.ist" -t "%%~nA.alg" -o "%%~nA.acr" "%%~nA.acn" &_
"%MikTexPath%%TeXCompilier%" "%%~nxA" &_
"%MikTexPath%%TeXCompilier%" "%%~nxA" &_
)