From 93ea6f14a06c5c47e719b34a5b7b473358334a9d Mon Sep 17 00:00:00 2001 From: Martin Vermeer Date: Tue, 29 Jul 2003 12:20:04 +0000 Subject: [PATCH] =?UTF-8?q?Implement=20a=20newenvironment=20in=20preamble?= =?UTF-8?q?=20for=20greyedout.=20Patch=20provided=20by=20J=EF=BF=BDrgen=20?= =?UTF-8?q?Spitzm=EF=BF=BDller.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7442 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 6 ++++++ src/LaTeXFeatures.C | 4 ++++ src/insets/ChangeLog | 5 +++++ src/insets/insetnote.C | 12 ++++++++---- src/lyx_sty.C | 4 ++++ src/lyx_sty.h | 2 ++ 6 files changed, 29 insertions(+), 4 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index a27cb2fd89..571694f494 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2003-07-29 Martin Vermeer + + * LaTeXFeatures.C: + * lay_sty.[Ch]:h: Implement a newenvironment in preamble for + greyedout. Patch provided by Jürgen Spitzmüller. + 2003-07-29 Jean-Marc Lasgouttes * kbmap.C (read): fix error message when reading bind files diff --git a/src/LaTeXFeatures.C b/src/LaTeXFeatures.C index 5380932443..0652983faa 100644 --- a/src/LaTeXFeatures.C +++ b/src/LaTeXFeatures.C @@ -350,6 +350,10 @@ string const LaTeXFeatures::getMacros() const if (isRequired("NeedTabularnewline")) macros << tabularnewline_def; + // greyedout environment (note inset) + if (isRequired("lyxgreyedout")) + macros << lyxgreyedout_def; + // floats getFloatDefinitions(macros); diff --git a/src/insets/ChangeLog b/src/insets/ChangeLog index 4613ff14f0..072e271c87 100644 --- a/src/insets/ChangeLog +++ b/src/insets/ChangeLog @@ -1,3 +1,8 @@ +2003-07-29 Martin Vermeer + + * insetnote.C: Implement a newenvironment in preamble for + greyedout. Patch provided by Jürgen Spitzmüller. + 2003-07-29 Angus Leeming * insetcommand.C (localDispatch): default to diff --git a/src/insets/insetnote.C b/src/insets/insetnote.C index 6898b75d1e..adc7c99629 100644 --- a/src/insets/insetnote.C +++ b/src/insets/insetnote.C @@ -151,9 +151,11 @@ int InsetNote::latex(Buffer const * buf, ostream & os, 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 @@ int InsetNote::latex(Buffer const * buf, ostream & os, 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 @@ void InsetNote::validate(LaTeXFeatures & features) const { if (params_.type == "Comment") features.require("verbatim"); - if (params_.type == "Greyedout") + if (params_.type == "Greyedout") { features.require("color"); + features.require("lyxgreyedout"); + } inset.validate(features); } diff --git a/src/lyx_sty.C b/src/lyx_sty.C index 9319529246..cc6bf47e73 100644 --- a/src/lyx_sty.C +++ b/src/lyx_sty.C @@ -122,3 +122,7 @@ string const mathcircumflex_def = 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"; diff --git a/src/lyx_sty.h b/src/lyx_sty.h index b7461115be..4d22ea1b02 100644 --- a/src/lyx_sty.h +++ b/src/lyx_sty.h @@ -51,5 +51,7 @@ extern string const binom_def; extern string const mathcircumflex_def; /// extern string const tabularnewline_def; +/// +extern string const lyxgreyedout_def; #endif // LYX_STY_H