]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.cpp
adjust
[lyx.git] / src / LaTeXFeatures.cpp
index a9ff651aa879c832c97df02625573bc603e80253..25be2c1866f151e24906f6dc61875d846780519a 100644 (file)
@@ -23,6 +23,7 @@
 #include "Floating.h"
 #include "FloatList.h"
 #include "Language.h"
+#include "Layout.h"
 #include "Lexer.h"
 #include "LyXRC.h"
 
@@ -185,6 +186,20 @@ static string const changetracking_none_def =
        "\\newcommand{\\lyxadded}[3]{#3}\n"
        "\\newcommand{\\lyxdeleted}[3]{}\n";
 
+static string const textgreek_def =
+       "\\DeclareRobustCommand{\\greektext}{%\n"
+       " \\fontencoding{LGR}\\selectfont\n"
+       " \\def\\encodingdefault{LGR}}\n"
+       "\\DeclareRobustCommand{\\textgreek}[1]{\\leavevmode{\\greektext #1}}\n"
+       "\\DeclareFontEncoding{LGR}{}{}\n";
+
+static string const textcyr_def =
+       "\\DeclareRobustCommand{\\cyrtext}{%\n"
+       " \\fontencoding{T2A}\\selectfont\n"
+       " \\def\\encodingdefault{T2A}}\n"
+       "\\DeclareRobustCommand{\\textcyr}[1]{\\leavevmode{\\cyrtext #1}}\n"
+       "\\DeclareFontEncoding{T2A}{}{}\n";
+
 
 /////////////////////////////////////////////////////////////////////
 //
@@ -395,10 +410,14 @@ char const * simplefeatures[] = {
        "latexsym",
        "pifont",
        "subfigure",
-       "wrapfig",
        "varioref",
        "prettyref",
+       /*For a successful cooperation of the `wrapfig' package with the
+         `float' package you should load the `wrapfig' package *after*
+         the `float' package. See the caption package documentation
+         for explanation.*/
        "float",
+       "wrapfig",
        "booktabs",
        "dvipost",
        "fancybox",
@@ -417,6 +436,7 @@ char const * simplefeatures[] = {
        "txfonts",
        "mathrsfs",
        "ascii",
+       "url",
 };
 
 int const nb_simplefeatures = sizeof(simplefeatures) / sizeof(char const *);
@@ -545,11 +565,6 @@ string const LaTeXFeatures::getPackages() const
            params_.use_esint != BufferParams::package_off)
                packages << "\\usepackage{esint}\n";
 
-       // url.sty
-       if (mustProvide("url"))
-               packages << "\\IfFileExists{url.sty}{\\usepackage{url}}\n"
-                           "                      {\\newcommand{\\url}{\\texttt}}\n";
-
        // natbib.sty
        if (mustProvide("natbib")) {
                packages << "\\usepackage[";
@@ -617,6 +632,12 @@ string const LaTeXFeatures::getMacros() const
        if (mustProvide("lyxarrow"))
                macros << lyxarrow_def << '\n';
 
+       if (mustProvide("textgreek"))
+               macros << textgreek_def << '\n';
+
+       if (mustProvide("textcyr"))
+               macros << textcyr_def << '\n';
+
        // quotes.
        if (mustProvide("quotesinglbase"))
                macros << quotesinglbase_def << '\n';