]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.C
citation patch from Angus
[lyx.git] / src / LaTeXFeatures.C
index 67341747bdaf5ce14ff24c14e606e469fe709e29..eeecf32930c83c07c6e0243ca32caa95df498f06 100644 (file)
@@ -29,8 +29,10 @@ LaTeXFeatures::LaTeXFeatures(BufferParams const & p, int n)
        : layout(n, false), params(p)
 {
        // packages
+       array = false;
        color = false;
-       graphics = false;
+       graphics = false; // INSET_GRAPHICS: remove this when InsetFig is thrown.
+    graphicx = false;
        setspace = false;
        makeidx = false;
        verbatim = false;
@@ -73,14 +75,13 @@ LaTeXFeatures::LaTeXFeatures(BufferParams const & p, int n)
 }
 
 void LaTeXFeatures::require(string const & name) {
-       if (name == "color") {
+       if (name == "array") {
+               array = true;
+       } else if (name == "color") {
                color = true;
        } else if (name == "graphics") {
-#ifdef USE_GRAPHICX
                graphicx = true;
-#else
-               graphics = true;
-#endif
+               graphics = true;// INSET_GRAPHICS: remove this when InsetFig is thrown.
        } else if (name == "setspace") {
                setspace = true;
        } else if (name == "makeidx") {
@@ -126,6 +127,10 @@ string LaTeXFeatures::getPackages()
        LyXTextClass const & tclass =
                textclasslist.TextClass(params.textclass);
 
+       // array-package
+       if (array)
+               packages += "\\usepackage{array}\n";
+
        // color.sty
        if (color) {
                if (params.graphicsDriver == "default")
@@ -144,6 +149,16 @@ string LaTeXFeatures::getPackages()
                packages += "\\makeindex\n";
        }
 
+       // graphicx.sty
+       if (graphicx && params.graphicsDriver != "none") {
+               if (params.graphicsDriver == "default")
+                       packages += "\\usepackage{graphicx}\n";
+               else
+                       packages += "\\usepackage[" 
+                               + params.graphicsDriver + "]{graphicx}\n";
+       }
+
+    // INSET_GRAPHICS: remove this when InsetFig is thrown.
        // graphics.sty
        if (graphics && params.graphicsDriver != "none") {
                if (params.graphicsDriver == "default")
@@ -332,6 +347,18 @@ string LaTeXFeatures::getTClassPreamble()
 }      
 
 
+string LaTeXFeatures::getIncludedFiles()
+{
+       string sgmlpreamble;
+       FileMap::const_iterator end = IncludedFiles.end();
+       for(FileMap::const_iterator fi=IncludedFiles.begin(); fi != end; ++fi)
+               sgmlpreamble += "\n<!entity " + fi->first
+                       + " system \"" + fi->second + "\">";
+
+       return sgmlpreamble;
+}
+
+
 void LaTeXFeatures::showStruct() {
        lyxerr << "LyX needs the following commands when LaTeXing:"
               << "\n***** Packages:" << getPackages()