]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.C
citation patch from Angus
[lyx.git] / src / LaTeXFeatures.C
index c7172bfa5577ea7c6d09f4bd6c8f9bfd8e5bc766..eeecf32930c83c07c6e0243ca32caa95df498f06 100644 (file)
@@ -31,7 +31,8 @@ LaTeXFeatures::LaTeXFeatures(BufferParams const & p, int n)
        // 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;
@@ -79,11 +80,8 @@ void LaTeXFeatures::require(string const & name) {
        } 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") {
@@ -151,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")
@@ -342,9 +350,10 @@ string LaTeXFeatures::getTClassPreamble()
 string LaTeXFeatures::getIncludedFiles()
 {
        string sgmlpreamble;
-
-       for(FileMap::const_iterator fi=IncludedFiles.begin(); fi != IncludedFiles.end(); ++fi)
-               sgmlpreamble += "\n<!entity " + fi->first + " system \"" + fi->second + "\">";
+       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;
 }