diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index 198d6d96ab..a350a4939b 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -809,6 +809,7 @@ void PreviewLoader::Impl::dumpPreamble(otexstream & os, Flavor flavor) const runparams.moving_arg = true; runparams.free_spacing = true; runparams.is_child = buffer_.parent(); + runparams.for_preview = true; buffer_.writeLaTeXSource(os, buffer_.filePath(), runparams, Buffer::OnlyPreamble); // FIXME! This is a HACK! The proper fix is to control the 'true' diff --git a/src/insets/InsetBranch.cpp b/src/insets/InsetBranch.cpp index 7a97e2c3b4..229e1bc37e 100644 --- a/src/insets/InsetBranch.cpp +++ b/src/insets/InsetBranch.cpp @@ -22,6 +22,7 @@ #include "FuncRequest.h" #include "FuncStatus.h" #include "Inset.h" +#include "LaTeXFeatures.h" #include "Lexer.h" #include "LyX.h" #include "output_docbook.h" @@ -340,7 +341,8 @@ void InsetBranch::forOutliner(docstring & os, size_t const maxlen, void InsetBranch::validate(LaTeXFeatures & features) const { - if (producesOutput()) + // Showing previews in a disabled branch may require stuff + if (producesOutput() || features.runparams().for_preview) InsetCollapsible::validate(features); } diff --git a/src/insets/InsetNote.cpp b/src/insets/InsetNote.cpp index a7a0dc16ab..b12b755fba 100644 --- a/src/insets/InsetNote.cpp +++ b/src/insets/InsetNote.cpp @@ -334,6 +334,9 @@ void InsetNote::validate(LaTeXFeatures & features) const InsetCollapsible::validate(features); break; case InsetNoteParams::Note: + // Showing previews in this inset may require stuff + if (features.runparams().for_preview) + InsetCollapsible::validate(features); break; } }