]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.cpp
Remove undisclosed imports (from xxx import *)
[lyx.git] / src / LaTeXFeatures.cpp
index 3d7a09b35e7d711927a418904a44c87ab04d92af..e68f850d0a56106ff36fdadce0558eab5f7d331b 100644 (file)
@@ -208,8 +208,8 @@ static docstring const lyxdot_def = from_ascii(
 
 static docstring const changetracking_xcolor_ulem_base_def = from_ascii(
        "%% Change tracking with ulem and xcolor: base macros\n"
-       "\\DeclareRobustCommand{\\mklyxadded}[1]{\\bgroup\\color{lyxadded}{}#1\\egroup}\n"
-       "\\DeclareRobustCommand{\\mklyxdeleted}[1]{\\bgroup\\color{lyxdeleted}\\mklyxsout{#1}\\egroup}\n"
+       "\\DeclareRobustCommand{\\mklyxadded}[1]{\\textcolor{lyxadded}\\bgroup#1\\egroup}\n"
+       "\\DeclareRobustCommand{\\mklyxdeleted}[1]{\\textcolor{lyxdeleted}\\bgroup\\mklyxsout{#1}\\egroup}\n"
        "\\DeclareRobustCommand{\\mklyxsout}[1]{\\ifx\\\\#1\\else\\sout{#1}\\fi}\n");
 
 static docstring const changetracking_xcolor_ulem_def = from_ascii(
@@ -546,46 +546,17 @@ static docstring const lyxmintcaption_def = from_ascii(
        "}\n");
 
 
-docstring const lyxgreyedoutDef(bool const rtl, bool const ct, bool const lua, bool const babel)
+docstring const lyxgreyedoutDef(bool const ct)
 {
        odocstringstream ods;
 
-       if (rtl) {
-               ods << "%% The greyedout annotation environment (with RTL support)\n"
-                   << "\\NewEnviron{lyxgreyedout}{%\n";
-               if (lua && !babel)
-                       // luabidi uses this switch
-                       ods << "  \\if@RTL%\n";
-               else
-                       ods << "  \\if@rl%\n";
-               ods << "    \\everypar{%\n";
-               if (lua)
-                       ods << "      \\pardir TRT \\textdir TRT\\normalfont\\normalsize\\textcolor{note_fontcolor}\\ignorespaces%\n";
-               else
-                       ods << "      \\normalfont\\normalsize\\textcolor{note_fontcolor}\\beginL\\ignorespaces%\n";
-               ods << "    }%\n";
-               if (ct)
-                       ods << "    \\colorlet{lyxadded}{lyxadded!30}\\colorlet{lyxdeleted}{lyxdeleted!30}%\n";
-               if (lua)
-                       ods << "    \\BODY\\everypar{\\ignorespacesafterend}%\n";
-               else
-                       ods << "    \\BODY\\everypar{\\ignorespacesafterend\\endL}%\n";
-               ods << "  \\else%\n";
-               if (ct)
-                       ods << "    \\colorlet{lyxadded}{lyxadded!30}\\colorlet{lyxdeleted}{lyxdeleted!30}%\n";
-               ods << "    \\normalfont\\normalsize\\textcolor{note_fontcolor}\\bgroup\\ignorespaces%\n"
-                   << "    \\BODY\\ignorespacesafterend\\egroup%\n"
-                   << "  \\fi%\n"
-                   << "}\n";
-       } else {
-               ods << "%% The greyedout annotation environment\n"
-                   << "\\newenvironment{lyxgreyedout}\n"
-                   << "{";
-               if (ct)
-                       ods << "\\colorlet{lyxadded}{lyxadded!30}\\colorlet{lyxdeleted}{lyxdeleted!30}%\n ";
-               ods << "\\normalfont\\normalsize\\textcolor{note_fontcolor}\\bgroup\\ignorespaces}\n"
-                   << "{\\ignorespacesafterend\\egroup}\n";
-       }
+       ods << "%% The greyedout annotation environment\n"
+           << "\\newenvironment{lyxgreyedout}\n"
+           << "{";
+       if (ct)
+               ods << "\\colorlet{lyxadded}{lyxadded!30}\\colorlet{lyxdeleted}{lyxdeleted!30}%\n ";
+       ods << "\\normalfont\\normalsize\\textcolor{note_fontcolor}\\bgroup\\ignorespaces}\n"
+           << "{\\ignorespacesafterend\\egroup}\n";
 
        return ods.str();
 }
@@ -1166,7 +1137,6 @@ char const * simplefeatures[] = {
        "xskak",
        "pict2e",
        "drs",
-       "environ",
        "dsfont",
        "hepparticles",
        "hepnames"
@@ -1529,14 +1499,16 @@ string const LaTeXFeatures::getPackages() const
                            "\\usepackage{ulem}\n";
 
        if (mustProvide("nomencl")) {
+               packages << "\\usepackage{nomencl}\n";
                // Make it work with the new and old version of the package,
                // but don't use the compatibility option since it is
                // incompatible to other packages.
-               packages << "\\usepackage{nomencl}\n"
-                           "% the following is useful when we have the old nomencl.sty package\n"
-                           "\\providecommand{\\printnomenclature}{\\printglossary}\n"
-                           "\\providecommand{\\makenomenclature}{\\makeglossary}\n"
-                           "\\makenomenclature\n";
+               if (!LaTeXFeatures::isAvailableAtLeastFrom("nomencl", 2005, 3, 31)) {
+                       packages << "% Needed with nomencl < v4.1\n"
+                                   "\\providecommand{\\printnomenclature}{\\printglossary}\n"
+                                   "\\providecommand{\\makenomenclature}{\\makeglossary}\n";
+               }
+               packages << "\\makenomenclature\n";
        }
 
        // fixltx2e provides subscript
@@ -1738,10 +1710,8 @@ TexString LaTeXFeatures::getMacros() const
        // the color is specified in the routine
        // getColorOptions() to avoid LaTeX-package clashes
        if (mustProvide("lyxgreyedout"))
-               // We need different version for RTL (#8647), with change tracking (#12025)
-               // and for some specific engine/language package combinations
-               macros << lyxgreyedoutDef(hasRTLLanguage(), mustProvide("ct-xcolor-ulem"),
-                                         (runparams_.flavor == Flavor::LuaTeX), useBabel());
+               // We need different version with change tracking (#12025)
+               macros << lyxgreyedoutDef(mustProvide("ct-xcolor-ulem"));
 
        if (mustProvide("lyxdot"))
                macros << lyxdot_def << '\n';