The following MWE works like a charm:
% test.tex
\documentclass{article}
\usepackage[subpreambles]{standalone}
\usepackage{filecontents}
\usepackage{glossaries}
%
\begin{filecontents}{stdalone}
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\newglossaryentry{cafe}
{
name={cafe},
% name={café},
description={beverage that makes you sleep if you don't drink it}
}
\begin{document}
Foo.
\end{document}
\end{filecontents}
%
\begin{document}
\input{stdalone}
\end{document}
But, as soon as name={cafe}
is replaced by some string containing accents, e.g. name={café}
, the standalone input file's content is ignored with the following warning:
Package standalone Warning: Sub-preamble of file 'stdalone.tex' has changed.
Content will be ignored. Please rerun LaTeX! on input line 14.
The sub-preamble of file stdalone.tex
is stored in the file test.sta
and, AFAICS, it doesn't change between compilations (from the 2nd one).
Do you see what's going on?
\usepackage[utf8]{inputenc}
to the main file, so it is probably a catcode issue.glossaries
is not fully functional if entries are defined after\begin{document}
and it is strongly recommended that all entries be defined in the preamble (or in files loaded there etc.). Alsoglossaries
provides its own method for loading files of entries and it would almost certainly be better to make use of that facility.standalone
and theinputenc
packages are loaded in the main but through a personal class, and the trouble still occurs. But your comment made me realize the former was loaded before the latter, which wasn't in any case a good idea. Interchanging the order solved this issue :).sta
contains all is in the preamble of the subfile(s), for instance the\usepackage
and the\newglossaryentry
commands. If it would not be input in the preamble of the main file; compilations would fail because of the\usepackage
commands.subpreambles
is used or not (and subsequent other optionssort
,print
, etc.).