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 e76a0fb8d8
commit 508f4deae2
3 changed files with 10 additions and 3 deletions

View File

@ -1484,7 +1484,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

@ -1386,6 +1386,7 @@ void Paragraph::Private::validate(LaTeXFeatures & features) const
// that needs to switch encoding.
odocstringstream ods;
otexstream os(ods, texrow);
os << layout_->preamble();
if (is_command) {
os << '\\' << from_ascii(layout_->latexname());
// we have to provide all the optional arguments here, even though

View File

@ -73,8 +73,6 @@ What's new
- Updated Arabic, Brazilian, Chinese, German, Italian, Slovakian, Swedish,
Ukrainian and French user interface localization.
- Fix translation of Fixme module description (bug 10058).
* BUILD/INSTALLATION
@ -131,6 +129,9 @@ What's new
- Handle backslash in label and ref insets (bug 4595).
- Output Preamble code of InPreamble styles before the styles themselves
(bug 10215).
* LYX2LYX
@ -221,6 +222,8 @@ What's new
- Added some comments to User Guide section 6.1 about defining formatted
references (bug 10545).
- Fix translation of Fixme module description (bug 10058).
* LYXHTML