Michael Gerz wrote:
Hi,
Based on Enrico's comment, here comes a shorter patch.
I need one more OK.
As Enrico mentioned, you probably want the limiting-precision bit here, too:
if (mustProvide("ct-xcolor-soul")) {
RGBColor cadd = RGBColor(lcolor.getX11Name(Color::addedtext));
+ int const stmSize = macros.precision(2);
macros << "\\providecolor{lyxadded}{rgb}{"
- << cadd.r/255 << ',' << cadd.g/255 << ',' << cadd.b/255 <<
"}\n";
+ << cadd.r / 255.0 << ',' << cadd.g / 255.0 << ',' << cadd.b / 255.0
<< "}\n";
RGBColor cdel = RGBColor(lcolor.getX11Name(Color::deletedtext));
macros << "\\providecolor{lyxdeleted}{rgb}{"
- << cdel.r/255 << ',' << cdel.g/255 << ',' << cdel.b/255 <<
"}\n";
+ << cdel.r / 255.0 << ',' << cdel.g / 255.0 << ',' << cdel.b / 255.0
<< "}\n";
+ marcos.precision(stmSize);
macros << "\\newcommand{\\lyxadded}[3]{{\\color{lyxadded}#3}}\n"
<<
"\\newcommand{\\lyxdeleted}[3]{{\\color{lyxdeleted}\\st{#3}}}\n";
With that, I say OK, too.
Richard
Michael
------------------------------------------------------------------------
--
==================================================================
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==================================================================
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto