From f46a52d97ff5528445c8d68d70478379f55774d9 Mon Sep 17 00:00:00 2001 From: Richard Heck Date: Tue, 21 Jun 2016 10:50:42 -0400 Subject: [PATCH] Let "provides [fontspec|listings|subfig] 1" work. --- src/BufferParams.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp index 373eee5dd0..d2218e073d 100644 --- a/src/BufferParams.cpp +++ b/src/BufferParams.cpp @@ -1589,7 +1589,8 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features, os << from_ascii(ams); if (useNonTeXFonts) { - os << "\\usepackage{fontspec}\n"; + if (!features.isProvided("fontspec")) + os << "\\usepackage{fontspec}\n"; if (features.mustProvide("unicode-math") && features.isAvailable("unicode-math")) os << "\\usepackage{unicode-math}\n"; @@ -2054,7 +2055,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features, // koma's own caption commands are used instead of caption. We // use \PassOptionsToPackage here because the user could have // already loaded subfig in the preamble. - if (features.isRequired("subfig")) { + if (features.mustProvide("subfig")) { atlyxpreamble += "\\@ifundefined{showcaptionsetup}{}{%\n" " \\PassOptionsToPackage{caption=false}{subfig}}\n" "\\usepackage{subfig}\n"; @@ -2115,7 +2116,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features, } if (features.isRequired("bicaption")) lyxpreamble += "\\usepackage{bicaption}\n"; - if (!listings_params.empty() || features.isRequired("listings")) + if (!listings_params.empty() || features.mustProvide("listings")) lyxpreamble += "\\usepackage{listings}\n"; if (!listings_params.empty()) { lyxpreamble += "\\lstset{";