]> git.lyx.org Git - lyx.git/blobdiff - src/BufferParams.cpp
Don't be so cute with VSpace: We just output it inline now for
[lyx.git] / src / BufferParams.cpp
index bcf8d6450330495a537ce0a5458bf84ceeed8a1e..d2218e073db8bab912634fb4eddc83013c6c5407 100644 (file)
@@ -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{";
@@ -2205,7 +2206,7 @@ bool BufferParams::hasClassDefaults() const
 
 DocumentClass const & BufferParams::documentClass() const
 {
-       return *doc_class_.get();
+       return *doc_class_;
 }
 
 
@@ -2973,8 +2974,8 @@ void BufferParams::writeEncodingPreamble(otexstream & os,
        // XeTeX/LuaTeX: (see also #9740)
        // With Unicode fonts we use utf8-plain without encoding package.
        // With TeX fonts, we cannot use utf8-plain, but "inputenc" fails.
-       // XeTeX must use ASCII encoding, for LuaTeX, we load
-       // "luainputenc" (see below).
+       // XeTeX must use ASCII encoding (see Buffer.cpp),
+       //  for LuaTeX, we load "luainputenc" (see below).
        if (useNonTeXFonts || features.runparams().flavor == OutputParams::XETEX)
                return;