Re: [O] Beamer export: How to handle overlayarea

2013-10-24 Thread Suvayu Ali
Hi James,

On Thu, Oct 24, 2013 at 08:43:59AM +0800, James Harkins wrote:
 On Oct 24, 2013 12:58 AM, Nicolas Goaziou n.goaz...@gmail.com wrote:
 Headlines also support 'BEAMER_ACT' and 'BEAMER_OPT' properties. The
  former is translated as an overlay/action specification, or a default
  overlay specification when enclosed within square brackets.  The latter
  specifies options for the current frame or block, and will automatically
  be enclosed within square brackets.
 
 That would help.
 
 I'd still like to see something more like a for-dummies explanation of
 passing options and arguments to LaTeX entities. I'm not saying the
 documentation is woefully inadequate (hardly that -- Suvayu's page got me
 rather far, and I got stuck on a couple of details). My experience was: it
 never would have occurred to me on my own to use the headline text for
 LaTeX code, and if there was a hint anywhere in the docs to suggest that
 this would be the way to go, I didn't find it. That's a conceptual leap
 that passed me by.

I think I agree with you on this.  It is a conceptual leap.  I'll add a
TODO item on that Worg page about these kind of tricks.

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Beamer export: How to handle overlayarea

2013-10-23 Thread Nicolas Goaziou
Hello,

James Harkins jamshar...@gmail.com writes:

 Under Block environments and overlay specifications, where it discusses
 custom environments, I would add:

 ~~
 - Environment options may be given using the BEAMER_opt property. They will
 be enclosed in square brackets and inserted where %o appears in the
 environment definition.
 (with an example, but I can't think of one now)

 - Additional arguments may be written into the environment's headline, and
 inserted into the LaTeX string using %r (raw headline text, no processing).
 ~~

There are two things to consider: what belongs to the manual, and what
belongs to `org-beamer-environments-extra' docstring.

I think it is reasonable for the manual not to talk about %o, %r... but,
instead, simply point to the variable name.

 I think it's important to mention it in the section where it can be used.
 My faulty conclusion was based on the fact that the only mention of _opt is
 in a section about frames.

Then what about changing

 Headlines also support 'BEAMER_ACT' and 'BEAMER_OPT' properties.  The
  former is translated as an overlay/action specification, or a default
  overlay specification when enclosed within square brackets.  The latter
  specifies options for the current frame.

into something like

   Headlines also support 'BEAMER_ACT' and 'BEAMER_OPT' properties. The
former is translated as an overlay/action specification, or a default
overlay specification when enclosed within square brackets.  The latter
specifies options for the current frame or block, and will automatically
be enclosed within square brackets.


Regards,

-- 
Nicolas Goaziou



Re: [O] Beamer export: How to handle overlayarea

2013-10-23 Thread James Harkins
On Oct 24, 2013 12:58 AM, Nicolas Goaziou n.goaz...@gmail.com wrote:
 There are two things to consider: what belongs to the manual, and what
 belongs to `org-beamer-environments-extra' docstring.

 I think it is reasonable for the manual not to talk about %o, %r... but,
 instead, simply point to the variable name.

OK.

Headlines also support 'BEAMER_ACT' and 'BEAMER_OPT' properties. The
 former is translated as an overlay/action specification, or a default
 overlay specification when enclosed within square brackets.  The latter
 specifies options for the current frame or block, and will automatically
 be enclosed within square brackets.

That would help.

I'd still like to see something more like a for-dummies explanation of
passing options and arguments to LaTeX entities. I'm not saying the
documentation is woefully inadequate (hardly that -- Suvayu's page got me
rather far, and I got stuck on a couple of details). My experience was: it
never would have occurred to me on my own to use the headline text for
LaTeX code, and if there was a hint anywhere in the docs to suggest that
this would be the way to go, I didn't find it. That's a conceptual leap
that passed me by.

FWIW, I often raise a similar point among SuperCollider devs, noting that
we generally do a decent job of documenting class interfaces, but not such
a great job of explaining to people who don't eat, breathe and sleep SC how
to put the pieces together. That leads to questions such as [1] on the
mailing list. Really basic use case, but this competent user is confused...
meaning, the collective docs aren't doing a thorough job.

This sort of doc would be appropriate for worg, but probably not the
manual. If I have time while traveling, I'll draft up a few paragraphs --
but I don't know all the implementation details so I'd certainly need
another pair of eyes.

hjh

[1] http://article.gmane.org/gmane.comp.audio.supercollider.user/102850


[O] Beamer export: How to handle overlayarea

2013-10-21 Thread James Harkins

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



Re: [O] Beamer export: How to handle overlayarea

2013-10-21 Thread Sebastien Vauban
Hello James,

James Harkins wrote:
 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.

Have a look at
http://lists.gnu.org/archive/html/emacs-orgmode/2013-06/msg00922.html.

You see you could use :options. HTH.

Best regards,
  Seb

-- 
Sebastien Vauban




Re: [O] Beamer export: How to handle overlayarea

2013-10-21 Thread Suvayu Ali
On Mon, Oct 21, 2013 at 03:52:14PM +0800, James Harkins wrote:
 
 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
 

This page has not been updated in a long time.  It was written before
there was a section on the new beamer exporter in the manual.  I don't
have the time at the moment, I won't have time in the coming months
either.  So if you have ideas about how to improve the article, please
feel free to add.

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] Beamer export: How to handle overlayarea

2013-10-21 Thread Nicolas Goaziou
Hello,

James Harkins jamshar...@gmail.com writes:

 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.

Optional arguments are in square brackets in LaTeX. Try %r instead, so
you can write:

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

 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 :-|

Options without brackets are not options anymore, but random arguments.

 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.

Would you mind suggesting a better phrasing?


Regards,

-- 
Nicolas Goaziou



Re: [O] Beamer export: How to handle overlayarea

2013-10-21 Thread James Harkins
On Oct 21, 2013 6:12 PM, Nicolas Goaziou n.goaz...@gmail.com wrote:
 Optional arguments are in square brackets in LaTeX. Try %r instead, so
 you can write:

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

Ah, OK, that's better.

It's not easy to grasp the correct terminology and structure from the
available documentation. I do appreciate the excellent help from the list
in such cases!

This part of the documentation might benefit from some examples of
generating different types of beamer syntax -- when to use properties, when
to use headline text, etc. I wouldn't have guessed to use the headline text
because I was thinking of parameters or arguments.

  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.

 Would you mind suggesting a better phrasing?

Under Block environments and overlay specifications, where it discusses
custom environments, I would add:

~~
- Environment options may be given using the BEAMER_opt property. They will
be enclosed in square brackets and inserted where %o appears in the
environment definition.
(with an example, but I can't think of one now)

- Additional arguments may be written into the environment's headline, and
inserted into the LaTeX string using %r (raw headline text, no processing).
~~

I think it's important to mention it in the section where it can be used.
My faulty conclusion was based on the fact that the only mention of _opt is
in a section about frames.

hjh
hjh