On Thu, May 10, 2007 at 07:21:53AM +0300, Martin Vermeer wrote: > On Wed, May 09, 2007 at 09:05:23PM +0100, José Matos wrote: > > On Wednesday 09 May 2007 20:56:49 Jean-Marc Lasgouttes wrote: > > > Martin Vermeer a écrit : > > > > Then the attached patch will do. > > > > > > > > OK to commit? > > > > > > Are we supposed to do something wrt lyx2lyx? > > > > To support lyx 1.4. Have I said how much I hate to support previous > > versions > > with lyx2lyx? ;-) > > > > Jean-Marc is right. :-) > > > > > JMarc > > This will take a while... not before next week. > > So we need a new doc format number for this? That would be 268. > > I propose to implement \structure and \example at the same time. OK?
OK, I did this under breakfast ;-) Leaving for a foreign trip (Belgium, here we come ;-) Back next Monday. Somebody polish this -- it is only semi-working --, add \structure (blue) and \example (green) (if appropriate) and put it in. Please? - Martin
Index: src/Buffer.cpp =================================================================== --- src/Buffer.cpp (revision 18204) +++ src/Buffer.cpp (working copy) @@ -141,7 +141,7 @@ namespace { -int const LYX_FORMAT = 267; +int const LYX_FORMAT = 268; } // namespace anon Index: lib/lyx2lyx/LyX.py =================================================================== --- lib/lyx2lyx/LyX.py (revision 18204) +++ lib/lyx2lyx/LyX.py (working copy) @@ -74,7 +74,7 @@ ("1_2", [220], generate_minor_versions("1.2" , 4)), ("1_3", [221], generate_minor_versions("1.3" , 7)), ("1_4", range(222,246), generate_minor_versions("1.4" , 4)), - ("1_5", range(246,268), generate_minor_versions("1.5" , 0))] + ("1_5", range(246,269), generate_minor_versions("1.5" , 0))] def formats_list(): Index: lib/lyx2lyx/lyx_1_5.py =================================================================== --- lib/lyx2lyx/lyx_1_5.py (revision 18204) +++ lib/lyx2lyx/lyx_1_5.py (working copy) @@ -1210,6 +1210,27 @@ document.inputencoding = get_value(document.header, "\\inputencoding", 0) +def revert_beamer_alert(document): + " Revert beamer's \\alert etc insets back to ERT. " + i = 0 + while 1: + i = find_token(document.body, "\\begin_inset CharStyle Alert", i) + if i == -1: + return + document.body[i] = "\\begin_inset ERT" + # Seach for a line starting 'begin_layout' + # If it is not there, break with a warning message + i = i + 1 + while 1: + if (document.body[i][:13] == "\\begin_layout"): + # Insert the \alert command + document.body[i + 1] = "\\alert{" + document.body[i + 1] + '}' + break + i = i + 1 + + i = i + 1 + + def convert_changes(document): " Switch output_changes off if tracking_changes is off. " i = find_token(document.header, '\\tracking_changes', 0) @@ -1351,9 +1372,11 @@ [264, [convert_cv_textclass]], [265, [convert_tableborder]], [266, []], - [267, []]] + [267, []], + [268, []]] -revert = [[266, [revert_utf8plain]], +revert = [[267, [revert_beamer_alert]], + [266, [revert_utf8plain]], [265, [revert_armenian]], [264, [revert_tableborder]], [263, [revert_cv_textclass]], Index: lib/layouts/beamer.layout =================================================================== --- lib/layouts/beamer.layout (revision 18204) +++ lib/layouts/beamer.layout (working copy) @@ -1056,8 +1056,17 @@ End +# Charstyles: +CharStyle Alert + LatexType Command + LatexName alert + Font + Color red + EndFont +End + # Input lyxmacros.inc Float