# Use glossaries-extra + bib2gls with secondary files via \include instead of \input

## Explanation

I've been writing a larger document for a while and used makeidx to produce my index. However, this seemed to be not flexible enough, so I swapped to the more sophisticated glossaries-extra. This package works fine as long as I include the separate paragraphs with \input instead of \include. Unfortunately, this practice breaks the document's structure when excluding paragraphs; so I'd like to return to using \include.

## code

The following code works as expected. As soon as I switch to \include, only question marks appear in the final document (where there should be glossary entries in the text) and the glossary itself remains empty.

### code - main - (nearly) minimal

\documentclass[10pt,a4paper]{scrartcl}

%\includeonly{kap/kap_1}    %I'd like to use that

% FONT, LANGUAGE
\usepackage{fontspec}
\defaultfontfeatures{Ligatures=TeX}
\setmainfont{Latin Modern Roman}
\usepackage[english]{babel}

%GLOSSARIES
\usepackage[record]{glossaries-extra}
src={glos}, % use glos.bib file
sort={use}
]
\glsdisablehyper

%DOCUMENT
\begin{document}

\input{par/par_1}    %<--- \include

\newpage

%GLOSSARIES

\printunsrtglossaries

\end{document}

## code - par1

code of the document that is included

\gls{entry}

## code - glos.bib

code of glossary bib file

% Encoding: UTF-8

@entry{entry,
name={entryname},
symbol={entrysymbol},
description={description}
}

## Compiling

I am using LuaLaTeX (1.07.0) (Tex Live 2018) on TeXShop (4.01) on a mac (10.13.6) to compile the code. I decided to take approach 4 explained in the glossary quick guide, involving the application of bib2gls (x86_64-darwin). So, I created an engine as described in Dickimaw Books where I substituted pdflatex with lualatex. This works as expected as long as I stick with \input in the main document, meaning the glossary is created and there are no artefacts in the pdf document. As soon as I replace \input by \include, the following error message appears in the console:

### Console output

bib2gls version 1.5 (2018-05-09)
Encoding: UTF-8
Writing /path/main.glstex
No entries written to /path/main.glstex.
Error: No records found in aux file.
Have you used the glossaries-extra.sty 'record' option?
Have you indexed your entries using commands like \gls?
Transcript written to main.glg.

If I missed some crucial information or messed something else up, please let me know :)
Best, TFT

This should now be fixed in version 1.6 (2018-07-07), which I've just uploaded to CTAN (so allow a few days for it to reach the TeX distributions).

• Thanks a lot! I'll test it again as soon as I receive the update and comment if it does not work. – TopologicalFieldTheory - TFT Jul 7 '18 at 17:37