Add charstyles Alert and Structure to beamer

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18322 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Martin Vermeer 2007-05-14 19:56:05 +00:00
parent 5849954507
commit fd70aabcc8
4 changed files with 60 additions and 6 deletions

View File

@ -1055,11 +1055,28 @@ Style Uncover
EndFont EndFont
End End
# Input lyxmacros.inc # Input lyxmacros.inc
# Charstyles:
CharStyle Alert
LatexType Command
LatexName alert
Font
Color red
EndFont
End
CharStyle Structure
LatexType Command
LatexName structure
Font
Color blue
EndFont
End
Float Float
Type table Type table
GuiName Table GuiName Table

View File

@ -74,7 +74,7 @@ format_relation = [("0_06", [200], generate_minor_versions("0.6" , 4)),
("1_2", [220], generate_minor_versions("1.2" , 4)), ("1_2", [220], generate_minor_versions("1.2" , 4)),
("1_3", [221], generate_minor_versions("1.3" , 7)), ("1_3", [221], generate_minor_versions("1.3" , 7)),
("1_4", range(222,246), generate_minor_versions("1.4" , 4)), ("1_4", range(222,246), generate_minor_versions("1.4" , 4)),
("1_5", range(246,270), generate_minor_versions("1.5" , 0))] ("1_5", range(246,271), generate_minor_versions("1.5" , 0))]
def formats_list(): def formats_list():

View File

@ -1210,6 +1210,43 @@ def revert_utf8plain(document):
document.inputencoding = get_value(document.header, "\\inputencoding", 0) document.inputencoding = get_value(document.header, "\\inputencoding", 0)
def revert_beamer_alert(document):
" Revert beamer's \\alert inset 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"
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 revert_beamer_structure(document):
" Revert beamer's \\structure inset back to ERT. "
i = 0
while 1:
i = find_token(document.body, "\\begin_inset CharStyle Structure", i)
if i == -1:
return
document.body[i] = "\\begin_inset ERT"
i = i + 1
while 1:
if (document.body[i][:13] == "\\begin_layout"):
document.body[i + 1] = "\\structure{" + document.body[i + 1] + '}'
break
i = i + 1
i = i + 1
def convert_changes(document): def convert_changes(document):
" Switch output_changes off if tracking_changes is off. " " Switch output_changes off if tracking_changes is off. "
i = find_token(document.header, '\\tracking_changes', 0) i = find_token(document.header, '\\tracking_changes', 0)
@ -1529,7 +1566,7 @@ convert = [[246, []],
[268, []], [268, []],
[269, []]] [269, []]]
revert = [ revert = [[269, [revert_beamer_alert, revert_beamer_structure]],
[268, [revert_preamble_listings_params, revert_listings_inset, revert_include_listings]], [268, [revert_preamble_listings_params, revert_listings_inset, revert_include_listings]],
[267, [revert_CJK]], [267, [revert_CJK]],
[266, [revert_utf8plain]], [266, [revert_utf8plain]],

View File

@ -141,7 +141,7 @@ using std::string;
namespace { namespace {
int const LYX_FORMAT = 269; int const LYX_FORMAT = 270;
} // namespace anon } // namespace anon