]> git.lyx.org Git - features.git/blobdiff - src/LaTeXFeatures.cpp
Allow literate documents other than noweb to work out of the box. Currently
[features.git] / src / LaTeXFeatures.cpp
index 79ef3e45204cfe44888c802c9f1ff76145bad930..cf26ea719b3c9efcc8109c2ab6ac26e42d3abafb 100644 (file)
@@ -19,6 +19,7 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "ColorSet.h"
+#include "Converter.h"
 #include "Encoding.h"
 #include "Floating.h"
 #include "FloatList.h"
@@ -370,6 +371,14 @@ bool LaTeXFeatures::mustProvide(string const & name) const
 
 bool LaTeXFeatures::isAvailable(string const & name)
 {
+       string::size_type const i = name.find("->");
+       if (i != string::npos) {
+               string const from = name.substr(0,i);
+               string const to = name.substr(i+2);
+               LYXERR0("from=[" << from << "] to=[" << to << "]");
+               return theConverters().isReachable(from, to);
+       }
+
        if (packages_.empty())
                getAvailable();
        string n = name;
@@ -619,9 +628,11 @@ string const LaTeXFeatures::getPackages() const
        // [x]color and pdfcolmk are handled in getColorOptions() above
        
        // makeidx.sty
-       if (isRequired("makeidx")) {
-               if (!tclass.provides("makeidx"))
+       if (isRequired("makeidx") || isRequired("splitidx")) {
+               if (!tclass.provides("makeidx") && !isRequired("splitidx"))
                        packages << "\\usepackage{makeidx}\n";
+               if (!tclass.provides("splitidx") && isRequired("splitidx"))
+                       packages << "\\usepackage{splitidx}\n";
                packages << "\\makeindex\n";
        }