]> git.lyx.org Git - lyx.git/blobdiff - src/LaTeXFeatures.cpp
* src/LaTeXFeatures.cpp:
[lyx.git] / src / LaTeXFeatures.cpp
index 5de8a4e8a1f822552c8a73ba7dd1ad8dfad2ab64..d03f964d035744d6a7c3a600f0e26c4d5a5d7eb6 100644 (file)
@@ -491,8 +491,16 @@ string const LaTeXFeatures::getPackages() const
        // shadecolor for shaded
        if (mustProvide("framed") && mustProvide("color")) {
                RGBColor c = RGBColor(lcolor.getX11Name(Color::shadedbg));
+               //255.0 to force conversion to double
+               //NOTE As Jürgen Spitzmüller pointed out, an alternative would be
+               //to use the xcolor package instead, and then we can do
+               // \define{shadcolor}{RGB}...
+               //and not do any conversion. We'd then need to require xcolor
+               //in InsetNote::validate().
+               int const stmSize = packages.precision(2);
                packages << "\\definecolor{shadecolor}{rgb}{"
-                       << c.r/255 << ',' << c.g/255 << ',' << c.b/255 << "}\n";
+                       << c.r/255.0 << ',' << c.g/255.0 << ',' << c.b/255.0 << "}\n";
+               packages.precision(stmSize);
        }
 
        // lyxskak.sty --- newer chess support based on skak.sty
@@ -662,8 +670,8 @@ string const LaTeXFeatures::getMacros() const
                macros << "\\providecolor{lyxdeleted}{rgb}{"
                       << cdel.r/255 << ',' << cdel.g/255 << ',' << cdel.b/255 << "}\n";
 
-               macros << "\\newcommand{\\lyxadded}[3]{\\color{lyxadded}{#3}}\n"
-                      << "\\newcommand{\\lyxdeleted}[3]{\\color{lyxdeleted}{\\st{#3}}}\n";
+               macros << "\\newcommand{\\lyxadded}[3]{{\\color{lyxadded}#3}}\n"
+                      << "\\newcommand{\\lyxdeleted}[3]{{\\color{lyxdeleted}\\st{#3}}}\n";
        }
        if (mustProvide("ct-none")) {
                macros << changetracking_none_def;