Output Preamble code of InPreamble styles before the styles themselves.

This assures that macros are defined.

Fixes: #10215
This commit is contained in:
Juergen Spitzmueller 2017-02-18 10:40:42 +01:00
parent 91719d9089
commit ffacdd8b46
2 changed files with 5 additions and 1 deletions

View File

@ -1568,7 +1568,10 @@ docstring const LaTeXFeatures::getTClassPreamble() const
list<docstring>::const_iterator cit = usedLayouts_.begin();
list<docstring>::const_iterator end = usedLayouts_.end();
for (; cit != end; ++cit)
tcpreamble << tclass[*cit].preamble();
// For InPreamble layouts, we output the preamble stuff earlier
// (before the layouts). See Paragraph::Private::validate.
if (!tclass[*cit].inpreamble)
tcpreamble << tclass[*cit].preamble();
cit = usedInsetLayouts_.begin();
end = usedInsetLayouts_.end();

View File

@ -1391,6 +1391,7 @@ void Paragraph::Private::validate(LaTeXFeatures & features) const
// output is wrong if this paragraph contains content
// that needs to switch encoding.
otexstringstream os;
os << layout_->preamble();
if (is_command) {
os << '\\' << from_ascii(layout_->latexname());
// we have to provide all the optional arguments here, even though