Category Sectioning
Margin First_Dynamic
LatexType Command
- LatexName lyxframeend{}\section
+ LatexName section
NeedProtect 1
NextNoIndent 1
LabelSep xx
CopyStyle Section
Category Unnumbered
Margin Static
- LatexName lyxframeend{}\section
+ LatexName section
LabelType No_Label
ResetArgs 1
Argument 1
Category Sectioning
Margin First_Dynamic
LatexType Command
- LatexName lyxframeend{}\subsection
+ LatexName subsection
NeedProtect 1
NextNoIndent 1
LabelSep xx
CopyStyle Subsection
Category Unnumbered
Margin Static
- LatexName lyxframeend{}\subsection
+ LatexName subsection
LabelType No_Label
ResetArgs 1
Argument 1
Category Sectioning
Margin First_Dynamic
LatexType Command
- LatexName lyxframeend{}\subsubsection
+ LatexName subsubsection
NeedProtect 1
NextNoIndent 1
LabelSep xx
CopyStyle Subsubsection
Category Unnumbered
Margin Static
- LatexName lyxframeend{}\subsubsection
+ LatexName subsubsection
LabelType No_Label
ResetArgs 1
Argument 1
# FRAMES
#
-Style BeginFrame
+Style Frame
Category Frames
+ Margin Dynamic
+ LatexType Environment
+ LatexName frame
+ LabelString "Frame"
TocLevel 4
KeepEmpty 1
- LatexType Command
- LatexName lyxframeend{}\lyxframe
- Argument 1
- LabelString "Frame Options"
- Tooltip "Frame options (see beamer manual)"
- EndArgument
- Margin First_Dynamic
NextNoIndent 1
- ParSkip 0
- TopSep 2.5
- BottomSep 0.5
- ParSep 0
- Align Center
+ Align Left
LabelType Static
- LabelBottomSep 0
- LeftMargin M
LabelSep xx
- LabelString "Frame"
- Font
- Series Bold
- Size Largest
- Color Blue
- EndFont
- LabelFont
+ ParSkip 0.5
+ TopSep 1
+ BottomSep 1
+ ParSep 0
+ LabelFont
+ Size largest
Family Roman
Color latex
EndFont
- Preamble
- \long\def\lyxframe#1{\@lyxframe#1\@lyxframestop}%
- \def\@lyxframe{\@ifnextchar<{\@@lyxframe}{\@@lyxframe<*>}}%
- \def\@@lyxframe<#1>{\@ifnextchar[{\@@@lyxframe<#1>}{\@@@lyxframe<#1>[]}}
- \def\@@@lyxframe<#1>[{\@ifnextchar<{\@@@@@lyxframe<#1>[}{\@@@@lyxframe<#1>[<*>][}}
- \def\@@@@@lyxframe<#1>[#2]{\@ifnextchar[{\@@@@lyxframe<#1>[#2]}{\@@@@lyxframe<#1>[#2][]}}
- \long\def\@@@@lyxframe<#1>[#2][#3]#4\@lyxframestop#5\lyxframeend{%
- \frame<#1>[#2][#3]{\frametitle{#4}#5}}
- EndPreamble
+ Argument 1
+ LabelString "Action"
+ MenuString "Overlay Specifications|S"
+ Tooltip "Overlay specifications for this frame"
+ LeftDelim <
+ RightDelim >
+ EndArgument
+ Argument 2
+ LabelString "Default Overlay Specifications"
+ Tooltip "Default overlay specifications within this frame"
+ LeftDelim [<
+ RightDelim >]
+ EndArgument
+ Argument 3
+ MenuString "Frame Options"
+ LabelString "Options"
+ Tooltip "Frame options (see beamer manual)"
+ EndArgument
+ Argument 4
+ LabelString "Frame Title"
+ Tooltip "Enter the block title here"
+ LeftDelim {
+ RightDelim }
+ Decoration conglomerate
+ Font
+ Color blue
+ Size largest
+ EndFont
+ AutoInsert 1
+ EndArgument
End
-Style BeginPlainFrame
- Category Frames
- TocLevel 4
- KeepEmpty 1
- LatexType Command
- LatexName lyxframeend{}\lyxplainframe
- Margin First_Dynamic
- NextNoIndent 1
- ParSkip 0
- TopSep 2.5
- BottomSep 0.5
- ParSep 0
- Align Center
- LabelType Static
- LabelBottomSep 0
- LeftMargin M
- LabelSep xx
- LabelString "Frame (no head/foot/sidebars)"
- Font
- Series Bold
- Size Largest
- Color Blue
- EndFont
- LabelFont
- Family Roman
- Color latex
- EndFont
- Preamble
- \long\def\lyxplainframe#1{\@lyxplainframe#1\@lyxframestop}%
- \def\@lyxplainframe{\@ifnextchar<{\@@lyxplainframe}{\@@lyxplainframe<*>}}%
- \long\def\@@lyxplainframe<#1>#2\@lyxframestop#3\lyxframeend{%
- \frame<#1>[plain]{\frametitle{#2}#3}}
- EndPreamble
+Style PlainFrame
+ CopyStyle Frame
+ LabelString "Frame (plain)"
+ Argument 3
+ MenuString "Frame Options"
+ LabelString "Options"
+ Tooltip "Frame options (see beamer manual)"
+ PresetArg "plain"
+ EndArgument
+End
+
+Style FragileFrame
+ CopyStyle Frame
+ LabelString "Frame (fragile)"
+ Argument 3
+ MenuString "Frame Options"
+ LabelString "Options"
+ Tooltip "Frame options (see beamer manual)"
+ PresetArg "fragile"
+ EndArgument
End
Style AgainFrame
Category Frames
KeepEmpty 0
LatexType Command
- LatexName lyxframeend{}\againframe
+ LatexName againframe
Argument 1
- LabelString "On Slide"
+ LabelString "Slide"
MenuString "Overlay Specifications|S"
Tooltip "Overlay specifications for this frame"
LeftDelim <
TopSep 3
BottomSep 3
ParSep 0
- Align Center
LabelType Static
LabelBottomSep 0
LeftMargin M
LabelFont
Family Roman
Color latex
- Series Bold
Size Largest
EndFont
End
-Style EndFrame
- Category Frames
- KeepEmpty 1
- LatexType Command
- LatexName lyxframeend
- Margin First_Dynamic
- ParSkip 0
- TopSep 0
- BottomSep 3
- ParSep 0
- Align Center
- LabelType Static
- LabelBottomSep 0
- LeftMargin MMMMM
- LabelString "________________________________"
- LabelFont
- Family typewriter
- Series Medium
- Size Normal
- Color latex
- EndFont
- Preamble
- \def\lyxframeend{} % In case there is a superfluous frame end
- EndPreamble
-End
-
Style FrameTitle
Category Frames
Margin Static
TopSep 0
BottomSep 1
ParSep 1
- Align Center
+ Align Block
LabelType No_Label
Font
- Series Bold
Color Blue
Size Largest
EndFont
TopSep 0
BottomSep 1
ParSep 1
- Align Center
+ Align Block
LabelType No_Label
Font
- Series Bold
Color Blue
EndFont
Argument 1
Input theorems-refprefix.inc
+
+
+##########################################
+# OBSOLETE STUFF
+# Everything below should be removed
+# (but this is a file format change)
+#
+# TODO:
+# * conversion of old frame
+# and plain frame to new layout
+##########################################
+
+#
+# Backwards compatible definitions
+#
+
+AddToPreamble
+\providecommand\lyxframeend{}
+EndPreamble
+
+IfStyle Section
+ LatexName lyxframeend{}\section
+End
+
+IfStyle Section*
+ LatexName lyxframeend{}\section
+End
+
+IfStyle Subsection
+ LatexName lyxframeend{}\subsection
+End
+
+IfStyle Subsection*
+ LatexName lyxframeend{}\subsection
+End
+
+IfStyle Subsubsection
+ LatexName lyxframeend{}\subsubsection
+End
+
+IfStyle Subsubsection*
+ LatexName lyxframeend{}\subsubsection
+End
+
+IfStyle AgainFrame
+ LatexName lyxframeend{}\againframe
+End
+
+
+#
+# Deprecated Styles
+#
+
+Style BeginFrame
+ Category "Deprecated Styles"
+ TocLevel 4
+ KeepEmpty 1
+ LatexType Command
+ LatexName lyxframeend{}\lyxframe
+ Argument 1
+ LabelString "Frame Options"
+ Tooltip "Frame options (see beamer manual)"
+ EndArgument
+ Margin First_Dynamic
+ NextNoIndent 1
+ ParSkip 0
+ TopSep 2.5
+ BottomSep 0.5
+ ParSep 0
+ Align Center
+ LabelType Static
+ LabelBottomSep 0
+ LeftMargin M
+ LabelSep xx
+ LabelString "Frame"
+ Font
+ Series Bold
+ Size Largest
+ Color Blue
+ EndFont
+ LabelFont
+ Family Roman
+ Color latex
+ EndFont
+ Preamble
+ \long\def\lyxframe#1{\@lyxframe#1\@lyxframestop}%
+ \def\@lyxframe{\@ifnextchar<{\@@lyxframe}{\@@lyxframe<*>}}%
+ \def\@@lyxframe<#1>{\@ifnextchar[{\@@@lyxframe<#1>}{\@@@lyxframe<#1>[]}}
+ \def\@@@lyxframe<#1>[{\@ifnextchar<{\@@@@@lyxframe<#1>[}{\@@@@lyxframe<#1>[<*>][}}
+ \def\@@@@@lyxframe<#1>[#2]{\@ifnextchar[{\@@@@lyxframe<#1>[#2]}{\@@@@lyxframe<#1>[#2][]}}
+ \long\def\@@@@lyxframe<#1>[#2][#3]#4\@lyxframestop#5\lyxframeend{%
+ \frame<#1>[#2][#3]{\frametitle{#4}#5}}
+ EndPreamble
+End
+
+Style BeginPlainFrame
+ Category "Deprecated Styles"
+ TocLevel 4
+ KeepEmpty 1
+ LatexType Command
+ LatexName lyxframeend{}\lyxplainframe
+ Margin First_Dynamic
+ NextNoIndent 1
+ ParSkip 0
+ TopSep 2.5
+ BottomSep 0.5
+ ParSep 0
+ Align Center
+ LabelType Static
+ LabelBottomSep 0
+ LeftMargin M
+ LabelSep xx
+ LabelString "Frame (no head/foot/sidebars)"
+ Font
+ Series Bold
+ Size Largest
+ Color Blue
+ EndFont
+ LabelFont
+ Family Roman
+ Color latex
+ EndFont
+ Preamble
+ \long\def\lyxplainframe#1{\@lyxplainframe#1\@lyxframestop}%
+ \def\@lyxplainframe{\@ifnextchar<{\@@lyxplainframe}{\@@lyxplainframe<*>}}%
+ \long\def\@@lyxplainframe<#1>#2\@lyxframestop#3\lyxframeend{%
+ \frame<#1>[plain]{\frametitle{#2}#3}}
+ EndPreamble
+End
+
+Style EndFrame
+ Category "Deprecated Styles"
+ KeepEmpty 1
+ LatexType Command
+ LatexName lyxframeend
+ Margin First_Dynamic
+ ParSkip 0
+ TopSep 0
+ BottomSep 3
+ ParSep 0
+ Align Center
+ LabelType Static
+ LabelBottomSep 0
+ LeftMargin MMMMM
+ LabelString "________________________________"
+ LabelFont
+ Family typewriter
+ Series Medium
+ Size Normal
+ Color latex
+ EndFont
+ Preamble
+ \def\lyxframeend{} % In case there is a superfluous frame end
+ EndPreamble
+End
i = i + 1
+def revert_fragileframe(document):
+ " Reverts beamer FragileFrame layout to ERT "
+
+ beamer_classes = ["beamer", "article-beamer", "scrarticle-beamer"]
+ if document.textclass not in beamer_classes:
+ return
+
+ i = 0
+ while True:
+ i = find_token(document.body, "\\begin_layout FragileFrame", i)
+ if i == -1:
+ return
+ # Find end of sequence
+ j = find_end_of_sequence(document.body, i)
+ if j == -1:
+ document.warning("Malformed lyx document. Cannot find end of FragileFrame sequence!")
+ i = i + 1
+ continue
+ endseq = j
+ subst = ["\\begin_layout Standard"] + put_cmd_in_ert("\\begin{frame}")
+ esubst = ["\\end_layout", "", "\\begin_layout Standard"] + put_cmd_in_ert("\\end{frame}")
+ endseq = endseq + len(esubst) - len(document.body[j : j])
+ if document.body[j] == "\\end_deeper":
+ document.body[j : j] = ["\\end_deeper", ""] + esubst
+ else:
+ document.body[j : j] = esubst
+ for q in range(i, j):
+ if document.body[q] == "\\begin_layout FragileFrame":
+ document.body[q] = "\\begin_layout %s" % document.default_layout
+ r = i
+ while r < j:
+ if document.body[r] == "\\begin_deeper":
+ s = find_end_of(document.body, r, "\\begin_deeper", "\\end_deeper")
+ if s != -1:
+ document.body[r] = ""
+ document.body[s] = ""
+ r = s
+ continue
+ r = r + 1
+ for p in range(1, 5):
+ arg = find_token(document.body, "\\begin_inset Argument %d" % p, i, j)
+ if arg != -1:
+ if p == 1:
+ beginPlain = find_token(document.body, "\\begin_layout Plain Layout", arg)
+ endPlain = find_end_of_layout(document.body, beginPlain)
+ endInset = find_end_of_inset(document.body, arg)
+ content = document.body[beginPlain + 1 : endPlain]
+ # Adjust range end
+ j = j - len(document.body[arg : endInset + 1])
+ # Remove arg inset
+ del document.body[arg : endInset + 1]
+ subst += put_cmd_in_ert("<") + content + put_cmd_in_ert(">")
+ elif p == 2:
+ beginPlain = find_token(document.body, "\\begin_layout Plain Layout", arg)
+ endPlain = find_end_of_layout(document.body, beginPlain)
+ endInset = find_end_of_inset(document.body, arg)
+ content = document.body[beginPlain + 1 : endPlain]
+ # Adjust range end
+ j = j - len(document.body[arg : endInset + 1])
+ # Remove arg inset
+ del document.body[arg : endInset + 1]
+ subst += put_cmd_in_ert("[<") + content + put_cmd_in_ert(">]")
+ elif p == 3:
+ beginPlain = find_token(document.body, "\\begin_layout Plain Layout", arg)
+ endPlain = find_end_of_layout(document.body, beginPlain)
+ endInset = find_end_of_inset(document.body, arg)
+ content = document.body[beginPlain + 1 : endPlain]
+ # Adjust range end
+ j = j - len(document.body[arg : endInset + 1])
+ # Remove arg inset
+ del document.body[arg : endInset + 1]
+ subst += put_cmd_in_ert("[fragile,") + content + put_cmd_in_ert("]")
+ elif p == 4:
+ beginPlain = find_token(document.body, "\\begin_layout Plain Layout", arg)
+ endPlain = find_end_of_layout(document.body, beginPlain)
+ endInset = find_end_of_inset(document.body, arg)
+ content = document.body[beginPlain + 1 : endPlain]
+ # Adjust range end
+ j = j - len(document.body[arg : endInset + 1])
+ # Remove arg inset
+ del document.body[arg : endInset + 1]
+ subst += put_cmd_in_ert("{") + content + put_cmd_in_ert("}")
+ elif p == 3:
+ subst += put_cmd_in_ert("[fragile]")
+
+ document.body[i : i + 1] = subst
+ i = j
+
+
+def revert_newframes(document):
+ " Reverts beamer Frame and PlainFrame layouts to old forms "
+
+ beamer_classes = ["beamer", "article-beamer", "scrarticle-beamer"]
+ if document.textclass not in beamer_classes:
+ return
+
+ frame_dict = {
+ "Frame" : "BeginFrame",
+ "PlainFrame" : "BeginPlainFrame",
+ }
+
+ rx = re.compile(r'^\\begin_layout (\S+)$')
+ i = 0
+ while True:
+ i = find_token(document.body, "\\begin_layout", i)
+ if i == -1:
+ return
+
+ m = rx.match(document.body[i])
+ val = ""
+ if m:
+ val = m.group(1)
+ if val not in frame_dict.keys():
+ i = i + 1
+ continue
+ # Find end of sequence
+ j = find_end_of_sequence(document.body, i)
+ if j == -1:
+ document.warning("Malformed lyx document. Cannot find end of Frame sequence!")
+ i = i + 1
+ continue
+ endseq = j
+ subst = ["\\begin_layout %s" % frame_dict[val]]
+ esubst = ["\\end_layout", "", "\\begin_layout EndFrame", "", "\\end_layout"]
+ endseq = endseq + len(esubst) - len(document.body[j : j])
+ if document.body[j] == "\\end_deeper":
+ document.body[j : j] = ["\\end_deeper", ""] + esubst
+ else:
+ document.body[j : j] = esubst
+ for q in range(i, j):
+ if document.body[q] == "\\begin_layout %s" % val:
+ document.body[q] = "\\begin_layout %s" % document.default_layout
+ r = i
+ while r < j:
+ if document.body[r] == "\\begin_deeper":
+ s = find_end_of(document.body, r, "\\begin_deeper", "\\end_deeper")
+ if s != -1:
+ document.body[r] = ""
+ document.body[s] = ""
+ r = s
+ continue
+ r = r + 1
+ l = find_end_of_layout(document.body, i)
+ for p in range(1, 5):
+ arg = find_token(document.body, "\\begin_inset Argument %d" % p, i, l)
+ if arg != -1:
+ if p == 1:
+ beginPlain = find_token(document.body, "\\begin_layout Plain Layout", arg)
+ endPlain = find_end_of_layout(document.body, beginPlain)
+ endInset = find_end_of_inset(document.body, arg)
+ content = document.body[beginPlain + 1 : endPlain]
+ # Adjust range end
+ l = l - len(document.body[arg : endInset + 1])
+ # Remove arg inset
+ del document.body[arg : endInset + 1]
+ subst += put_cmd_in_ert("<") + content + put_cmd_in_ert(">")
+ elif p == 2:
+ beginPlain = find_token(document.body, "\\begin_layout Plain Layout", arg)
+ endPlain = find_end_of_layout(document.body, beginPlain)
+ endInset = find_end_of_inset(document.body, arg)
+ content = document.body[beginPlain + 1 : endPlain]
+ # Adjust range end
+ l = l - len(document.body[arg : endInset + 1])
+ # Remove arg inset
+ del document.body[arg : endInset + 1]
+ subst += put_cmd_in_ert("[<") + content + put_cmd_in_ert(">]")
+ elif p == 3:
+ beginPlain = find_token(document.body, "\\begin_layout Plain Layout", arg)
+ endPlain = find_end_of_layout(document.body, beginPlain)
+ endInset = find_end_of_inset(document.body, arg)
+ content = document.body[beginPlain + 1 : endPlain]
+ # Adjust range end
+ l = l - len(document.body[arg : endInset + 1])
+ # Remove arg inset
+ del document.body[arg : endInset + 1]
+ subst += put_cmd_in_ert("[") + content + put_cmd_in_ert("]")
+ elif p == 4:
+ beginPlain = find_token(document.body, "\\begin_layout Plain Layout", arg)
+ endPlain = find_end_of_layout(document.body, beginPlain)
+ endInset = find_end_of_inset(document.body, arg)
+ content = document.body[beginPlain + 1 : endPlain]
+ # Adjust range end
+ l = l - len(document.body[arg : endInset + 1])
+ # Remove arg inset
+ del document.body[arg : endInset + 1]
+ subst += content
+
+ document.body[i : i + 1] = subst
+ i = j
+
+
##
# Conversion hub
#
[455, []],
[456, [convert_epigraph]],
[457, [convert_use_stackrel]],
- [458, [convert_captioninsets, convert_captionlayouts]]
+ [458, [convert_captioninsets, convert_captionlayouts]],
+ [459, []]
]
revert = [
+ [458, [revert_fragileframe, revert_newframes]],
[457, [revert_captioninsets, revert_captionlayouts]],
[456, [revert_use_stackrel]],
[455, [revert_epigraph]],