commit 46133b26bebf1795709fd40696084df83e87c9e6
Author: Richard Heck <[email protected]>
Date: Tue Jun 21 10:50:42 2016 -0400
Let "provides [fontspec|listings|subfig] 1" work.
(cherry picked from commit f46a52d97ff5528445c8d68d70478379f55774d9)
---
src/BufferParams.cpp | 7 ++++---
status.22x | 3 +++
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index 9d121cb..6b56037 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -1582,7 +1582,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";
@@ -2047,7 +2048,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";
@@ -2108,7 +2109,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{";
diff --git a/status.22x b/status.22x
index eff4c0f..788f460 100644
--- a/status.22x
+++ b/status.22x
@@ -28,6 +28,9 @@ What's new
- Changed the display of buttons for collapsed branches. We now display the
same thing as if the branches were open (bug 10213).
+- "Provides <package> 1" now works with fontspec, subfig, and listings (bug
+ 10257).
+
- Added a new module "Title and Preamble Hacks".