How can I repeat a beamer frame with Org-mode?
Asked Answered
W

2

5

With Beamer frames can be repeated by labeling the frame that should be repeated such as

\begin{frame}[label=framelabel]
...
\end{frame}

and then using \againframe{framelabel} at the place where that frame is to be repeated.

How can this method be used with Org-mode's Beamer export? The label can obviously be added by putting it in BEAMER_envargs such as:

* Org-mode section
:PROPERTIES:
:BEAMER_envargs: [label=questions]
:END:

But there are two problems in using \againframe via Org-mode:

  1. \againframe is placed badly both if it is placed under an Org-mode section and if it is put directly in an Org-mode section. The problem is that in the former case is that is is placed inside a frame when it should be placed between. The problem in the latter case is that it is placed inside \frametitle.
  2. \againframe is either swallowed by Org-mode sections or it is marked as one. Both are poor logical representations of its function.

So is there some effective way of using \againframe with Beamer or is there some other way to repeat frames with Org-mode that I have overlooked?

I have already looked at http://lists.gnu.org/archive/html/emacs-orgmode/2011-05/msg00954.html in trying to work this out.

I am running Org-mode 7.6 in Emacs 23.3.1 and I use Beamer 3.13.

Word answered 8/3, 2012 at 16:37 Comment(4)
It is not an optimal solution, but in the past I have simply collapsed the section and then killed and yanked the region corresponding to the section. Another yank, and you have another copy of the section. Alternatively, would using a Beamer only<> construct work for what you want?Snaffle
@Snaffle Thanks for suggestions. If I understand your suggestions correctly both are fragile in different ways. You mean using C-c C-x C-w to simply make two copies of the section and place them as you want? That would be fragile in that if one section is changed its copy will not be automatically changed. If I understand the \only approach correctly it will require to count to the correct slide that it should be repeated on and, thus, it will break if slides are inserted in between, right?Word
Yes, both are fragile. The \only suggestion was if you wanted to repeat a slide with only some small change - as one might do if incrementally revealing parts of a slide. Indeed, if you want to fully repeat the slide at a later point in the presentation, \only will not work.Snaffle
@Snaffle A full repeat is what I am after.Word
H
2

I don't think this is currently possible. The limitation lies in the tree structure of an org document. As far as I understood from your question, the \againframe{...} command basically repeats a slide as is. In org terms, that means the original tree used to generate the slide is repeated. Since the org document format doesn't let you have any content which is not part of a tree (other than the frontmatter/header at the top of a file), I believe this is not possible. This has been discussed on the mailing list a few times, from what I understood there are no plans to implement something like this.

Hairbrush answered 9/3, 2012 at 17:51 Comment(2)
It is possible to pass arguments to frames as I write in my answer. You simple add :BEAMER_envargs: [label=questions] to the properties of a section to add the argument [label=questions] to \begin{frame}. If you read my question you see the problem is rather how to use the \againframe macro with Org-mode.Word
@Word Sorry, I misunderstood your question completely. Now that I understand, I still think its not possible. At least not trivially. I will edit my original answer to explain.Hairbrush
C
12

The current org-mode has support for againframe. Just create a frame and add the beamer option BEAMER_env = againframe to the corresponding section. Or use C-c C-b a to insert it if you initialized the beamer mode on org-startup.

More information can be found in the org-mode documentation.

An example is available in the original proposal of the syntax:

* section
** My frame title                     :B_frame:
:PROPERTIES:
:BEAMER_env: frame
:END:

Some text. Some text.  Some text. Some text.
Some text. Some text.  Some text. Some text.

** section                                         :B_againframe:
  :PROPERTIES:
  :BEAMER_env: againframe
  :BEAMER_act: 2
  :BEAMER_ref: *My frame title
  :END:

  This section will create "\againframe<2>{sec-1-2}".

** Following frame
etc.
Cartridge answered 5/2, 2015 at 16:59 Comment(0)
H
2

I don't think this is currently possible. The limitation lies in the tree structure of an org document. As far as I understood from your question, the \againframe{...} command basically repeats a slide as is. In org terms, that means the original tree used to generate the slide is repeated. Since the org document format doesn't let you have any content which is not part of a tree (other than the frontmatter/header at the top of a file), I believe this is not possible. This has been discussed on the mailing list a few times, from what I understood there are no plans to implement something like this.

Hairbrush answered 9/3, 2012 at 17:51 Comment(2)
It is possible to pass arguments to frames as I write in my answer. You simple add :BEAMER_envargs: [label=questions] to the properties of a section to add the argument [label=questions] to \begin{frame}. If you read my question you see the problem is rather how to use the \againframe macro with Org-mode.Word
@Word Sorry, I misunderstood your question completely. Now that I understand, I still think its not possible. At least not trivially. I will edit my original answer to explain.Hairbrush

© 2022 - 2024 — McMap. All rights reserved.