diff --git a/development/FORMAT b/development/FORMAT index d992e04a6e..bea1049b5f 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -1,5 +1,9 @@ LyX file-format changes ----------------------- +2007-06-13 Bo Peng + * format incremented to 273: add --Separator-- environment to + separate consecutive environments + 2007-06-13 Bo Peng * format incremented to 272: convert listings to ERT because earlier versions of lyx can not handle unrecognizable diff --git a/lib/doc/UserGuide.lyx b/lib/doc/UserGuide.lyx index d4df082646..c72480cb4c 100644 --- a/lib/doc/UserGuide.lyx +++ b/lib/doc/UserGuide.lyx @@ -1,5 +1,5 @@ #LyX 1.5.0svn created this file. For more info see http://www.lyx.org/ -\lyxformat 263 +\lyxformat 273 \begin_document \begin_header \textclass scrbook @@ -91,8 +91,9 @@ \paperpagestyle default \tracking_changes false \output_changes false -\author "usti" -\author "Uwe Stöhr" +\author "Bo Peng" +\author "usti" +\author "Uwe Stöhr" \end_header \begin_body @@ -9278,6 +9279,42 @@ Once again, LyX doesn't enforce this limitation. \end_layout +\begin_layout Standard +In case that you want to start a new list immediately after a list, or consecuti +ve definitions, proofs etc, you can use the +\family sans +--Separator-- +\family default + environment to separate them. + For example +\end_layout + +\begin_layout Enumerate +item1 +\end_layout + +\begin_layout --Separator-- + +\end_layout + +\begin_layout Enumerate +another item1 +\end_layout + +\begin_deeper +\begin_layout Enumerate +nested item1 +\end_layout + +\begin_layout --Separator-- + +\end_layout + +\begin_layout Enumerate +nested another item1 +\end_layout + +\end_deeper \begin_layout Subsection Some Examples \end_layout diff --git a/lib/layouts/stdlayouts.inc b/lib/layouts/stdlayouts.inc index dbc01612c6..e2ac0eb883 100644 --- a/lib/layouts/stdlayouts.inc +++ b/lib/layouts/stdlayouts.inc @@ -61,5 +61,20 @@ Style Verse End - - +Style --Separator-- + KeepEmpty 1 + Margin Dynamic + LatexType Paragraph + LatexName dummy + ParIndent MM + Align Block + AlignPossible Block + LabelType Static + LabelString "--- Separate Environment ---" + LabelFont + Family Roman + Series Medium + Size Normal + Color Blue + EndFont +End diff --git a/lib/lyx2lyx/LyX.py b/lib/lyx2lyx/LyX.py index 0fbfe1fe95..3b4e3e88f1 100644 --- a/lib/lyx2lyx/LyX.py +++ b/lib/lyx2lyx/LyX.py @@ -77,7 +77,7 @@ format_relation = [("0_06", [200], generate_minor_versions("0.6" , 4)), ("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,273), generate_minor_versions("1.5" , 0))] + ("1_5", range(246,274), generate_minor_versions("1.5" , 0))] def formats_list(): diff --git a/lib/lyx2lyx/lyx_1_5.py b/lib/lyx2lyx/lyx_1_5.py index 862f8fdff0..d24d323992 100644 --- a/lib/lyx2lyx/lyx_1_5.py +++ b/lib/lyx2lyx/lyx_1_5.py @@ -1656,6 +1656,53 @@ def convert_ext_font_sizes(document): else: del document.header[i] +def revert_separator_layout(document): + r'''Revert --Separator-- to a lyx note +From + +\begin_layout --Separator-- +something +\end_layout + +to + +\begin_layout Standard +\begin_inset Note Note +status open + +\begin_layout Standard +Separate Evironment +\end_layout + +\end_inset +something + +\end_layout + + ''' + + i = 0 + while True: + i = find_token(document.body, r'\begin_layout --Separator--', i) + if i == -1: + break + j = find_end_of_layout(document.body, i + 1) + if j == -1: + # this should not happen + break + document.body[i : j + 1] = [r'\begin_layout Standard', + r'\begin_inset Note Note', + 'status open', + '', + r'\begin_layout Standard', + 'Separate Environment', + r'\end_layout', + '', + r'\end_inset'] + \ + document.body[ i + 1 : j] + \ + ['', + r'\end_layout' + ] ## # Conversion hub @@ -1687,11 +1734,13 @@ convert = [[246, []], [268, []], [269, []], [270, []], - [271, [convert_ext_font_sizes]] + [271, [convert_ext_font_sizes]], [272, []], + [273, []], ] revert = [ + [272, [revert_separator_layout]], [271, [revert_preamble_listings_params, revert_listings_inset, revert_include_listings]], [270, [revert_ext_font_sizes]], [269, [revert_beamer_alert, revert_beamer_structure]], diff --git a/src/Buffer.cpp b/src/Buffer.cpp index d867193cde..d9c704e204 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -142,7 +142,7 @@ using std::string; namespace { -int const LYX_FORMAT = 272; +int const LYX_FORMAT = 273; } // namespace anon