mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 10:00:33 +00:00
Add --Separator-- environment
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18764 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
6551f0afa8
commit
dad101c2e3
@ -1,5 +1,9 @@
|
||||
LyX file-format changes
|
||||
-----------------------
|
||||
2007-06-13 Bo Peng <ben.bob@gmail.com>
|
||||
* format incremented to 273: add --Separator-- environment to
|
||||
separate consecutive environments
|
||||
|
||||
2007-06-13 Bo Peng <bpeng@lyx.org>
|
||||
* format incremented to 272: convert listings to ERT because
|
||||
earlier versions of lyx can not handle unrecognizable
|
||||
|
@ -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,6 +91,7 @@
|
||||
\paperpagestyle default
|
||||
\tracking_changes false
|
||||
\output_changes false
|
||||
\author "Bo Peng"
|
||||
\author "usti"
|
||||
\author "Uwe Stöhr"
|
||||
\end_header
|
||||
@ -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
|
||||
|
@ -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
|
||||
|
@ -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():
|
||||
|
@ -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]],
|
||||
|
@ -142,7 +142,7 @@ using std::string;
|
||||
|
||||
namespace {
|
||||
|
||||
int const LYX_FORMAT = 272;
|
||||
int const LYX_FORMAT = 273;
|
||||
|
||||
} // namespace anon
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user