Let "provides [fontspec|listings|subfig] 1" work.

This commit is contained in:
Richard Heck 2016-06-21 10:50:42 -04:00
parent 7d456a93e4
commit f46a52d97f

View File

@ -1589,6 +1589,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
os << from_ascii(ams); os << from_ascii(ams);
if (useNonTeXFonts) { if (useNonTeXFonts) {
if (!features.isProvided("fontspec"))
os << "\\usepackage{fontspec}\n"; os << "\\usepackage{fontspec}\n";
if (features.mustProvide("unicode-math") if (features.mustProvide("unicode-math")
&& features.isAvailable("unicode-math")) && features.isAvailable("unicode-math"))
@ -2054,7 +2055,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
// koma's own caption commands are used instead of caption. We // koma's own caption commands are used instead of caption. We
// use \PassOptionsToPackage here because the user could have // use \PassOptionsToPackage here because the user could have
// already loaded subfig in the preamble. // already loaded subfig in the preamble.
if (features.isRequired("subfig")) { if (features.mustProvide("subfig")) {
atlyxpreamble += "\\@ifundefined{showcaptionsetup}{}{%\n" atlyxpreamble += "\\@ifundefined{showcaptionsetup}{}{%\n"
" \\PassOptionsToPackage{caption=false}{subfig}}\n" " \\PassOptionsToPackage{caption=false}{subfig}}\n"
"\\usepackage{subfig}\n"; "\\usepackage{subfig}\n";
@ -2115,7 +2116,7 @@ bool BufferParams::writeLaTeX(otexstream & os, LaTeXFeatures & features,
} }
if (features.isRequired("bicaption")) if (features.isRequired("bicaption"))
lyxpreamble += "\\usepackage{bicaption}\n"; lyxpreamble += "\\usepackage{bicaption}\n";
if (!listings_params.empty() || features.isRequired("listings")) if (!listings_params.empty() || features.mustProvide("listings"))
lyxpreamble += "\\usepackage{listings}\n"; lyxpreamble += "\\usepackage{listings}\n";
if (!listings_params.empty()) { if (!listings_params.empty()) {
lyxpreamble += "\\lstset{"; lyxpreamble += "\\lstset{";