emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: James Harkins <jamshark70@gmail.com>
To: orgmode <emacs-orgmode@gnu.org>
Subject: Beamer export: How to handle overlayarea
Date: Mon, 21 Oct 2013 15:52:14 +0800	[thread overview]
Message-ID: <e69914d5-d5e1-456f-8983-9660f283b252@dewdrop-world.net> (raw)

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	other threads:[~2013-10-21  7:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-21  7:52 James Harkins [this message]
2013-10-21  8:49 ` Beamer export: How to handle overlayarea Sebastien Vauban
2013-10-21 10:02 ` Suvayu Ali
2013-10-21 10:12 ` Nicolas Goaziou
2013-10-21 10:52   ` James Harkins
2013-10-23 16:59     ` Nicolas Goaziou
2013-10-24  0:43       ` James Harkins
2013-10-24 10:53         ` Suvayu Ali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e69914d5-d5e1-456f-8983-9660f283b252@dewdrop-world.net \
    --to=jamshark70@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).