From 508f4deae23f911551b9a8f1d76bcb750c2c84d1 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 18 Feb 2017 10:40:42 +0100 Subject: [PATCH] Output Preamble code of InPreamble styles before the styles themselves. This assures that macros are defined. Fixes: #10215 --- src/LaTeXFeatures.cpp | 5 ++++- src/Paragraph.cpp | 1 + status.22x | 7 +++++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 4702db0e8b..a3aa242e62 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -1484,7 +1484,10 @@ docstring const LaTeXFeatures::getTClassPreamble() const list::const_iterator cit = usedLayouts_.begin(); list::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(); diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 4b07afa8a9..a326bc8477 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -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 diff --git a/status.22x b/status.22x index df669fa107..3100535ab8 100644 --- a/status.22x +++ b/status.22x @@ -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 -- 2.39.5