Fix forcing of text class for LaTeX snippets

When the input document is not a full document, make sure that the -c
is taken into account.
This commit is contained in:
Jean-Marc Lasgouttes 2022-07-18 00:45:01 +02:00
parent 2b24c03e8b
commit efef533d91

View File

@ -2174,17 +2174,17 @@ void Preamble::parse(Parser & p, string const & forceclass,
if (detectEncoding && !is_full_document)
return;
// Force textclass if the user wanted it
if (!forceclass.empty()) {
setTextClass(forceclass, tc);
class_set = true;
}
while (is_full_document && p.good()) {
if (detectEncoding && h_inputencoding != "auto-legacy" &&
h_inputencoding != "auto-legacy-plain")
return;
// Force textclass if the user wanted it
if (!forceclass.empty()) {
setTextClass(forceclass, tc);
class_set = true;
}
Token const & t = p.get_token();
#ifdef FILEDEBUG