Martin Vermeer wrote: > If this is verified to work, could you prepare a patch (including the > validate -> newenvironment thing I suppose is needed)? I think it's a > good idea.
Here is the patch. It works as far as I can tell. Perhaps you test a little bit and apply if it's o.k. (I have too much stuff in my tree ATM). Juergen.
Index: src/LaTeXFeatures.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/LaTeXFeatures.C,v retrieving revision 1.83 diff -u -r1.83 LaTeXFeatures.C --- src/LaTeXFeatures.C 30 Jun 2003 23:55:49 -0000 1.83 +++ src/LaTeXFeatures.C 28 Jul 2003 18:51:03 -0000 @@ -350,6 +350,10 @@ if (isRequired("NeedTabularnewline")) macros << tabularnewline_def; + // greyedout environment (note inset) + if (isRequired("lyxgreyedout")) + macros << lyxgreyedout_def; + // floats getFloatDefinitions(macros); Index: src/lyx_sty.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_sty.C,v retrieving revision 1.12 diff -u -r1.12 lyx_sty.C --- src/lyx_sty.C 27 Nov 2002 10:30:09 -0000 1.12 +++ src/lyx_sty.C 28 Jul 2003 18:51:03 -0000 @@ -122,3 +122,7 @@ string const tabularnewline_def = "%% Because html converters don't know tabularnewline\n" "\\providecommand{\\tabularnewline}{\\\\}\n"; + +string const lyxgreyedout_def = + "%% The greyedout annotation environment\n" + "\\newenvironment{lyxgreyedout}{\\color[gray]{0.8}}{}\n"; Index: src/lyx_sty.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/lyx_sty.h,v retrieving revision 1.12 diff -u -r1.12 lyx_sty.h --- src/lyx_sty.h 6 Sep 2002 13:41:19 -0000 1.12 +++ src/lyx_sty.h 28 Jul 2003 18:51:03 -0000 @@ -51,5 +51,7 @@ extern string const mathcircumflex_def; /// extern string const tabularnewline_def; +/// +extern string const lyxgreyedout_def; #endif // LYX_STY_H Index: src/insets/insetnote.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/insets/insetnote.C,v retrieving revision 1.34 diff -u -r1.34 insetnote.C --- src/insets/insetnote.C 28 Jul 2003 09:02:58 -0000 1.34 +++ src/insets/insetnote.C 28 Jul 2003 18:51:09 -0000 @@ -151,9 +151,11 @@ int i = 0; if (pt == "Comment") - os << "%\n\\begin{comment}\n"; // remember to validate + // verbatim + os << "%\n\\begin{comment}\n"; else if (pt == "Greyedout") - os << "%\n\\color[gray]{0.8}"; + // we roll our own macro + os << "%\n\\begin{lyxgreyedout}\n"; if (pt != "Note") i = inset.latex(buf, os, runparams); @@ -162,7 +164,7 @@ os << "%\n\\end{comment}\n"; i += 3; } else if (pt == "Greyedout") { - os << "\\normalcolor%\n"; + os << "%\n\\end{lyxgreyedout}\n"; i += 2; } return i; @@ -224,8 +226,10 @@ { if (params_.type == "Comment") features.require("verbatim"); - if (params_.type == "Greyedout") + if (params_.type == "Greyedout") { features.require("color"); + features.require("lyxgreyedout"); + } inset.validate(features); }