# \DeclareCategory{Presentations}
# PowerDot textclass definition file.
# Created: 29-Aug-05 by Mael Hilléreau
-# Last modified: 20-May-06 by Uwe Stöhr
+# Modified: 20-May-06 by Uwe Stöhr, 18-Mar-2013 Jürgen Spitzmüller
Format 45
# Title style definition
###
Style Title
- Category FrontMatter
+ Category TitleSlide
Margin Static
LatexType Command
InTitle 1
# Author style definition
###
Style Author
- Category FrontMatter
+ Category TitleSlide
Margin Static
LatexType Command
InTitle 1
# Date style definition
###
Style Date
+ Category TitleSlide
Margin Dynamic
LatexType Command
InTitle 1
# Slide styles definition
###
Style Slide
+ Category Slides
TocLevel 3
Margin Static
LatexType Command
End
Style EndSlide
+ Category Slides
KeepEmpty 1
LatexType Command
LatexName lyxend
# Note style definition
###
Style Note
+ Category Slides
Margin Static
LatexType Command
LatexName lyxend\lyxnote
Color Blue
EndFont
LabelStringAppendix "\Alph{section}"
+ Argument 1
+ LabelString "Section Option"
+ Tooltip "Optional arguments to the section command (see powerdot manual)"
+ EndArgument
End
###
# Itemize styles definition
###
Style Itemize
- Category List
+ Category Lists
Margin Static
LatexType Item_Environment
LatexName itemize
Align Block
AlignPossible Block, Left
LabelType Itemize
+ Argument 1
+ LabelString "Itemize Type"
+ Tooltip "Itemize type spezification (see powerdot manual)"
+ EndArgument
+ Argument 2
+ LabelString "Itemize Options"
+ Tooltip "Optional arguments for this list (see enumitem manual)"
+ EndArgument
+ Argument item:1
+ LabelString "Custom Item|s"
+ Tooltip "A customized item string"
+ EndArgument
+ Argument item:2
+ MenuString "Item Overlay Specifications"
+ LabelString "On Slide"
+ Tooltip "Overlay specifications for this item"
+ LeftDelim <
+ RightDelim >
+ EndArgument
End
Style ItemizeType1
CopyStyle Itemize
- LatexParam [type=1]
+ Argument 1
+ LabelString "Itemize Type"
+ Tooltip "Itemize type spezification (see powerdot manual)"
+ DefaultArg "type=1"
+ EndArgument
End
###
# Enumerate styles definition
###
Style Enumerate
- Category List
+ Category Lists
Margin Static
LatexType Item_Environment
LatexName enumerate
AlignPossible Block, Left
LabelType Enumerate
RefPrefix enu
+ Argument 1
+ LabelString "Enumerate Type"
+ Tooltip "Enumerate type spezification (see powerdot manual)"
+ EndArgument
+ Argument 2
+ LabelString "Enumerate Options"
+ Tooltip "Optional arguments for this list (see enumitem manual)"
+ EndArgument
+ Argument item:1
+ LabelString "Custom Item|s"
+ Tooltip "A customized item string"
+ EndArgument
+ Argument item:2
+ MenuString "Item Overlay Specifications"
+ LabelString "On Slide"
+ Tooltip "Overlay specifications for this item"
+ LeftDelim <
+ RightDelim >
+ EndArgument
End
Style EnumerateType1
- CopyStyle Enumerate
- LatexParam [type=1]
+ CopyStyle Enumerate
+ Argument 1
+ LabelString "Enumerate Type"
+ Tooltip "Enumerate type spezification (see powerdot manual)"
+ DefaultArg "type=1"
+ EndArgument
End
###
# Quotation style definition
###
Style Quotation
+ Category MainText
Margin Static
LatexType Environment
LatexName quotation
# Quote style definition
###
Style Quote
+ Category MainText
Margin Static
LatexType Environment
LatexName quote
Style Verse
# LaTeX type is first dynamic because of LaTeX implementation.
# In LyX this does not make sense.
+ Category MainText
LatexType Environment
LatexName verse
Margin First_Dynamic
LabelType No_Label
End
+###
+# Twocolumn style definition
+###
+Style Twocolumn
+ Category MainText
+ LatexType command
+ LatexName twocolumn
+ Margin First_Dynamic
+ NextNoIndent 1
+ ParSkip 0.4
+ TopSep 0.7
+ BottomSep 0.7
+ ParSep 0.5
+ Align Block
+ AlignPossible Block, Left, Right, Center
+ LabelType No_Label
+ Argument 1
+ LabelString "Column Options"
+ Tooltip "Twocolumn options (see powerdot manual)"
+ EndArgument
+ Argument 2
+ LabelString "Left Column"
+ Tooltip "Enter the text of the left column here (right column in main paragraph)"
+ Mandatory 1
+ AutoInsert 1
+ EndArgument
+End
+
+###
+# Overlay style definitions
+###
+Style Pause
+ Category Overlays
+ KeepEmpty 1
+ LatexType Command
+ LatexName pause
+ Margin First_Dynamic
+ Argument 1
+ LabelString "Pause number"
+ Tooltip "Number of slide where the context below the pause gets visible"
+ EndArgument
+ NextNoIndent 1
+ ParSkip 0
+ TopSep 0
+ BottomSep 0.25
+ ParSep 0
+ Align Center
+ LabelType Static
+ LabelBottomSep 0
+ LeftMargin MMMMM
+ LabelString "_ _ _ _ _ _ _ _ _ _ _ _ _ _"
+ LabelFont
+ Family typewriter
+ Series Medium
+ Size Normal
+ Color latex
+ EndFont
+End
+
###
# Caption style definition
###
Counter algorithm
End
+
+###
+# Charstyle definitions
+###
+
+InsetLayout Flex:onslide
+ LyXType charstyle
+ LabelString "Visible"
+ LatexType command
+ LatexName onslide
+ Argument 1
+ LabelString "On Slides"
+ MenuString "Overlay Specification|S"
+ Tooltip "Specify the overlay settings (see powerdot manual)"
+ Mandatory 1
+ DefaultArg "1-"
+ EndArgument
+End
+
+InsetLayout Flex:onslide+
+ CopyStyle Flex:onslide
+ LatexName onslide+
+ LabelString "Uncover"
+End
+
+InsetLayout Flex:onslide*
+ CopyStyle Flex:onslide
+ LatexName onslide*
+ LabelString "Only"
+End
del document.body[i : j + 1]
+def revert_powerdot_flexes(document):
+ " Reverts powerdot flex insets "
+
+ if document.textclass != "powerdot":
+ return
+
+ flexes = {"onslide" : "\\onslide",
+ "onslide*" : "\\onslide*",
+ "onslide+" : "\\onslide+"}
+ rx = re.compile(r'^\\begin_inset Flex (.+)$')
+
+ i = 0
+ while True:
+ i = find_token(document.body, "\\begin_inset Flex", i)
+ if i == -1:
+ return
+ m = rx.match(document.body[i])
+ if m:
+ flextype = m.group(1)
+ z = find_end_of_inset(document.body, i)
+ if z == -1:
+ document.warning("Can't find end of Flex " + flextype + " inset.")
+ i += 1
+ continue
+ if flextype in flexes:
+ pre = put_cmd_in_ert(flexes[flextype])
+ arg = find_token(document.body, "\\begin_inset Argument 1", i, z)
+ if arg != -1:
+ argend = find_end_of_inset(document.body, arg)
+ if argend == -1:
+ document.warning("Can't find end of Argument!")
+ i += 1
+ continue
+ # Find containing paragraph layout
+ beginPlain = find_token(document.body, "\\begin_layout Plain Layout", arg)
+ endPlain = find_end_of_layout(document.body, beginPlain)
+ argcontent = document.body[beginPlain + 1 : endPlain]
+ # Adjust range end
+ z = z - len(document.body[arg : argend + 1])
+ # Remove arg inset
+ del document.body[arg : argend + 1]
+ pre += put_cmd_in_ert("{") + argcontent + put_cmd_in_ert("}")
+ pre += put_cmd_in_ert("{")
+ beginPlain = find_token(document.body, "\\begin_layout Plain Layout", i)
+ endPlain = find_end_of_layout(document.body, beginPlain)
+ # Adjust range end
+ z = z - len(document.body[i : beginPlain + 1])
+ z += len(pre)
+ document.body[i : beginPlain + 1] = pre
+ post = put_cmd_in_ert("}")
+ document.body[z - 2 : z + 1] = post
+ i += 1
+
+
+def revert_powerdot_pause(document):
+ " Reverts powerdot pause layout to ERT "
+
+ if document.textclass != "powerdot":
+ return
+
+ i = 0
+ while True:
+ i = find_token(document.body, "\\begin_layout Pause", i)
+ if i == -1:
+ return
+ j = find_end_of_layout(document.body, i)
+ if j == -1:
+ document.warning("Malformed lyx document: Can't find end of Pause layout")
+ i = i + 1
+ continue
+ endlay = j
+ subst = ["\\begin_layout Standard"] + put_cmd_in_ert("\\pause")
+ for p in range(i, j):
+ if p >= endlay:
+ break
+ arg = find_token(document.body, "\\begin_inset Argument 1", i, j)
+ if arg != -1:
+ beginPlain = find_token(document.body, "\\begin_layout Plain Layout", p)
+ endPlain = find_end_of_layout(document.body, beginPlain)
+ endInset = find_end_of_inset(document.body, p)
+ content = document.body[beginPlain + 1 : endPlain]
+ # Adjust range end
+ endlay = endlay - len(document.body[p : endInset + 1])
+ # Remove arg inset
+ del document.body[p : endInset + 1]
+ subst += put_cmd_in_ert("[") + content + put_cmd_in_ert("]")
+
+ document.body[i : i + 1] = subst
+ i = endlay
+
+
+def revert_powerdot_itemargs(document):
+ " Reverts powerdot item arguments to ERT "
+
+ if document.textclass != "powerdot":
+ return
+
+ i = 0
+ list_layouts = ["Itemize", "ItemizeType1", "Enumerate", "EnumerateType1"]
+ rx = re.compile(r'^\\begin_inset Argument (\S+)$')
+
+ while True:
+ i = find_token(document.body, "\\begin_inset Argument", i)
+ if i == -1:
+ return
+ # Find containing paragraph layout
+ parent = get_containing_layout(document.body, i)
+ if parent == False:
+ document.warning("Malformed lyx document: Can't find parent paragraph layout")
+ i = i + 1
+ continue
+ parbeg = parent[1]
+ parend = parent[2]
+ realparbeg = parent[3]
+ layoutname = parent[0]
+ realparend = parend
+ for p in range(parbeg, parend):
+ if p >= realparend:
+ i = realparend
+ break
+ if layoutname in list_layouts:
+ m = rx.match(document.body[p])
+ if m:
+ argnr = m.group(1)
+ if argnr == "item:1":
+ j = find_end_of_inset(document.body, i)
+ # Find containing paragraph layout
+ beginPlain = find_token(document.body, "\\begin_layout Plain Layout", i)
+ endPlain = find_end_of_layout(document.body, beginPlain)
+ content = document.body[beginPlain + 1 : endPlain]
+ del document.body[i:j+1]
+ subst = put_cmd_in_ert("[") + content + put_cmd_in_ert("]")
+ document.body[realparbeg : realparbeg] = subst
+ elif argnr == "item:2":
+ j = find_end_of_inset(document.body, i)
+ # Find containing paragraph layout
+ beginPlain = find_token(document.body, "\\begin_layout Plain Layout", i)
+ endPlain = find_end_of_layout(document.body, beginPlain)
+ content = document.body[beginPlain + 1 : endPlain]
+ del document.body[i:j+1]
+ subst = put_cmd_in_ert("<") + content + put_cmd_in_ert(">")
+ document.body[realparbeg : realparbeg] = subst
+
+ i = realparend
+
+
+def revert_powerdot_columns(document):
+ " Reverts powerdot twocolumn to TeX-code "
+ if document.textclass != "powerdot":
+ return
+
+ rx = re.compile(r'^\\begin_inset Argument (\S+)$')
+ i = 0
+ while True:
+ i = find_token(document.body, "\\begin_layout Twocolumn", i)
+ if i == -1:
+ return
+ j = find_end_of_layout(document.body, i)
+ if j == -1:
+ document.warning("Malformed lyx document: Can't find end of Twocolumn layout")
+ i = i + 1
+ continue
+ endlay = j
+ document.body[j : j] = put_cmd_in_ert("}") + document.body[j : j]
+ endlay += len(put_cmd_in_ert("}"))
+ subst = ["\\begin_layout Standard"] + put_cmd_in_ert("\\twocolumn")
+ for p in range(i, j):
+ if p >= endlay:
+ break
+ m = rx.match(document.body[p])
+ if m:
+ argnr = m.group(1)
+ if argnr == "1":
+ beginPlain = find_token(document.body, "\\begin_layout Plain Layout", p)
+ endPlain = find_end_of_layout(document.body, beginPlain)
+ endInset = find_end_of_inset(document.body, p)
+ content = document.body[beginPlain + 1 : endPlain]
+ # Adjust range end
+ endlay = endlay - len(document.body[p : endInset + 1])
+ # Remove arg inset
+ del document.body[p : endInset + 1]
+ subst += put_cmd_in_ert("[") + content + put_cmd_in_ert("]")
+ elif argnr == "2":
+ beginPlain = find_token(document.body, "\\begin_layout Plain Layout", p)
+ endPlain = find_end_of_layout(document.body, beginPlain)
+ endInset = find_end_of_inset(document.body, p)
+ content = document.body[beginPlain + 1 : endPlain]
+ # Adjust range end
+ endlay = endlay - len(document.body[p : endInset + 1])
+ # Remove arg inset
+ del document.body[p : endInset + 1]
+ subst += put_cmd_in_ert("{") + content + put_cmd_in_ert("}")
+
+ subst += put_cmd_in_ert("{")
+ document.body[i : i + 1] = subst
+ i = endlay
+
+
##
# Conversion hub
#
[462, []],
[463, [convert_encodings]],
[464, [convert_use_cancel]],
- [465, [convert_lyxframes, remove_endframes]]
+ [465, [convert_lyxframes, remove_endframes]],
+ [466, []]
]
revert = [
+ [465, [revert_powerdot_flexes, revert_powerdot_pause, revert_powerdot_itemargs, revert_powerdot_columns]],
[464, []],
[463, [revert_use_cancel]],
[462, [revert_encodings]],