emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] Beamer export: How to handle overlayarea


From: James Harkins
Subject: [O] Beamer export: How to handle overlayarea
Date: Mon, 21 Oct 2013 15:52:14 +0800
User-agent: Trojita/v0.3.96-git; Qt/4.8.1; X11; Linux; Ubuntu 12.04.3 LTS

Per the beamer user guide, the syntax of the overlayarea environment is:

\begin{overlayarea}{area width}{area height}
        environment contents
\end{overlayarea}

I can't figure out how to get the width and height in properly.

From the customize interface, I added overlayarea as follows:

'(org-beamer-environments-extra (quote (("CJK" "Z" "\\begin{CJK}%a%H" "\\end{CJK}") ("onlyenv" "O" "\\begin{onlyenv}%a" "\\end{onlyenv}") ("overlayarea" "Y" "\\begin{overlayarea}%o%a" "\\end{overlayarea}"))))

And I can plug text into %o using the BEAMER_OPT property:

*** Overlays                                                  :B_overlayarea:
   :PROPERTIES:
   :BEAMER_env: overlayarea
   :BEAMER_OPT: {0.9\textwidth}{0.7\textheight}
   :END:

-->

\begin{overlayarea}[{0.9\textwidth}{0.7\textheight}]

Oh, hello, BEAMER_OPT automatically adds square brackets, how charming.

I guess I can hack up a filter to remove the brackets after overlayarea.

.. 45 minutes after I started writing this email...

I copied someone else's ignoreheading filter and modified it for this purpose:

(defun hjh-overlayarea (contents backend info)
 "Remove brackets from options for overlayarea."
 (when (and (org-export-derived-backend-p backend 'latex 'html 'ascii)
         (string-match "\\\\begin{overlayarea}\\[\\(.*\\)\\]"
               (downcase contents)))
   (replace-match "\\\\begin{overlayarea}\\1" nil nil contents)))

Replace-match's handling of backslashes threw me at first, but this appears to work.

Still, I wonder if there shouldn't be, e.g., %O for options-without-brackets. Because that was 45 minutes I spent NOT writing my slides :-|

Also, side note, [1] seems not to document BEAMER_OPT for environments within a frame. Reading this page, you would think you could only use it for frames. I had to dig into the source code to find how to populate %o.

hjh

[1] http://orgmode.org/worg/exporters/beamer/ox-beamer.html



reply via email to

[Prev in Thread] Current Thread [Next in Thread]