The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 483b99193fdd0f3e903361fb6a39bd7e89afbc6e
Author: Juergen Spitzmueller <[email protected]>
Date:   Sat Dec 22 16:28:43 2012 +0100

    Support for beamer \frametitle
    
    The \frametitle command is less convenient to use than the \frame argument, 
but it provides more options (overlay/action and short title). We thus provide 
this additionally to the option, like beamer itself does.

diff --git a/development/FORMAT b/development/FORMAT
index d33bd97..1f8d9e1 100644
--- a/development/FORMAT
+++ b/development/FORMAT
@@ -11,6 +11,10 @@ adjustments are made to tex2lyx and bugs are fixed in 
lyx2lyx.
 
 -----------------------
 
+2012-12-22 Jürgen Spitzmüller <[email protected]>
+       * Format incremented to 455: Support for beamer \frametitle
+         \frametitle<overlay>[short]{title} > begin_layout FrameTitle
+
 2012-12-19 Jürgen Spitzmüller <[email protected]>
        * Format incremented to 454:
          Real support for beamer overprint environment. This environment has a
diff --git a/lib/layouts/beamer.layout b/lib/layouts/beamer.layout
index a550a03..a9e14ec 100644
--- a/lib/layouts/beamer.layout
+++ b/lib/layouts/beamer.layout
@@ -554,6 +554,36 @@ Style EndFrame
   EndPreamble
 End
 
+Style FrameTitle
+  Category         Frames
+  Margin           Static
+  LatexType        Command
+  LatexName        frametitle
+  ParSkip          0.4
+  ItemSep          0
+  TopSep           0
+  BottomSep        1
+  ParSep           1
+  Align            Center
+  LabelType        No_Label
+  Font 
+    Series         Bold
+    Color          Blue
+    Size           Largest
+  EndFont
+  Argument 1
+    LabelString    "On Slide"
+    MenuString     "Overlay Specifications|S"
+    Tooltip        "Specify the overlay settings (see beamer manual)"
+    LeftDelim      <
+    RightDelim     >
+  EndArgument
+  Argument 2
+    LabelString    "Short Frame Title|S"
+    Tooltip        "A short form of the frame title used in some themes"
+  EndArgument
+End
+
 Style FrameSubtitle
   Category         Frames
   Margin           Static
diff --git a/lib/lyx2lyx/lyx_2_1.py b/lib/lyx2lyx/lyx_2_1.py
index db7e391..684f5c8 100644
--- a/lib/lyx2lyx/lyx_2_1.py
+++ b/lib/lyx2lyx/lyx_2_1.py
@@ -2843,6 +2843,61 @@ def revert_overprint(document):
         i = endseq
 
 
+def revert_frametitle(document):
+    " Reverts beamer frametitle layout to ERT "
+    
+    beamer_classes = ["beamer", "article-beamer", "scrarticle-beamer"]
+    if document.textclass not in beamer_classes:
+        return
+
+    rx = re.compile(r'^\\begin_inset Argument (\S+)$')
+    i = 0
+    while True:
+        i = find_token(document.body, "\\begin_layout FrameTitle", 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 
FrameTitle 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("\\frametitle")
+        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
 #
@@ -2889,10 +2944,12 @@ convert = [
            [451, [convert_beamerargs, convert_againframe_args, 
convert_corollary_args, convert_quote_args]],
            [452, [convert_beamerblocks]],
            [453, [convert_use_stmaryrd]],
-           [454, [convert_overprint]]
+           [454, [convert_overprint]],
+           [455, []]
           ]
 
 revert =  [
+           [454, [revert_frametitle]],
            [453, [revert_overprint]],
            [452, [revert_use_stmaryrd]],
            [451, [revert_beamerblocks]],
diff --git a/src/tex2lyx/TODO.txt b/src/tex2lyx/TODO.txt
index cd0b0ed..fec204a 100644
--- a/src/tex2lyx/TODO.txt
+++ b/src/tex2lyx/TODO.txt
@@ -94,6 +94,8 @@ Format LaTeX feature                        LyX feature
        \begin{overprint}[maxlength]
        \onslide<slide> text ...
        \end{overprint}
+455    beamer frametitle command            \begin_layout FrameTitle
+       \frametitle<overlay>[short}{long}
 
 
 General
diff --git a/src/version.h b/src/version.h
index f7b72db..255c47e 100644
--- a/src/version.h
+++ b/src/version.h
@@ -30,8 +30,8 @@ extern char const * const lyx_version_info;
 
 // Do not remove the comment below, so we get merge conflict in
 // independent branches. Instead add your own.
-#define LYX_FORMAT_LYX 454 // spitz: support for beamer overprint
-#define LYX_FORMAT_TEX2LYX 454 // spitz: support for beamer overprint
+#define LYX_FORMAT_LYX 455 // spitz: support for beamer FrameTitle layout
+#define LYX_FORMAT_TEX2LYX 455 // spitz: support for beamer FrameTitle layout
 
 #if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
 #ifndef _MSC_VER

-----------------------------------------------------------------------

Summary of changes:
 development/FORMAT        |    4 +++
 lib/layouts/beamer.layout |   30 +++++++++++++++++++++++
 lib/lyx2lyx/lyx_2_1.py    |   59 ++++++++++++++++++++++++++++++++++++++++++++-
 src/tex2lyx/TODO.txt      |    2 +
 src/version.h             |    4 +-
 5 files changed, 96 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to