emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] having problems exporting to Beamer


From: Eric Schulte
Subject: Re: [O] having problems exporting to Beamer
Date: Sun, 14 Apr 2013 11:08:12 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Nicolas Goaziou <address@hidden> writes:

> Hello,
>
> Eric Schulte <address@hidden> writes:
>
>> When I attempt to export a .org file to Beamer (with "C-c C-e l b" after
>> requiring ox-beamer) I get the following error [1].  From the info page
>> (info "(org)Beamer export") it looks like I shouldn't have to do any
>> special buffer preparation.
>>
>> What am I doing wrong?
>
> It looks like `org-beamer-outline-frame-options' is nil, but it must be
> a string (possibly empty).
>

Thanks, with this variable set to an empty string I am making it further
in the export process.  I would suggest that either the initial value of
this variable be set to an empty string, or a nil value should be
handled gracefully.

After fixing the above I reached a new error.  There was no "beamer"
class defined in my `org-latex-classes'.  The attached patch ensures
that when ox-beamer is loaded a beamer entry is added to
`org-latex-classes' if none already exists.

>From 540bcddb50b746f4f2de910a199e4d13e8ddad11 Mon Sep 17 00:00:00 2001
From: Eric Schulte <address@hidden>
Date: Sun, 14 Apr 2013 09:16:24 -0600
Subject: [PATCH 1/2] ensure a "beamer" entry exists in org-latex-classes

This ensures that whenever ox-beamer is required it is possible to
export to beamer.  Otherwise it is required to find the
org-latex-classes variable and add a beamer entry, something which is
not mentioned in the beamer page of the manual and will be confusing to
users just getting going with Beamer export.

* lisp/ox-beamer.el (assoc): Ensure a "beamer" entry exists in
  org-latex-classes.
---
 lisp/ox-beamer.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 63dad5c..87458f0 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -126,6 +126,15 @@
   :group 'org-export
   :version "24.2")
 
+(unless (assoc "beamer" org-latex-classes)
+  (add-to-list 'org-latex-classes
+              '("article" "\\documentclass[bigger]{beamer}"
+                ("\\section{%s}" . "\\section*{%s}")
+                ("\\subsection{%s}" . "\\subsection*{%s}")
+                ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
+                ("\\paragraph{%s}" . "\\paragraph*{%s}")
+                ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))))
+
 (defcustom org-beamer-frame-level 1
   "The level at which headlines become frames.
 
-- 
1.8.2.1

I leave it to you to apply or not, but I think it makes things much
clearer for new users.  I think this patch is especially useful because
it is no longer required to place

  #+LaTeX_Class: beamer

at the top of the Org-mode file for beamer export.  At least the
"beamer" class and `org-latex-classes' should be mentioned in the beamer
section of the manual.

Additionally, I ran into another nil vs. empty string problem, which was
fixed by the second patch attached.

>From ae7f4de7a04c9fac9fa36836370711cdb7f12fa7 Mon Sep 17 00:00:00 2001
From: Eric Schulte <address@hidden>
Date: Sun, 14 Apr 2013 10:28:27 -0600
Subject: [PATCH 2/2] Ensure nil is not passed to regexp function

* lisp/ox-beamer.el (org-beamer--format-frame): If contents is nil, then
  replace it with an empty string.
---
 lisp/ox-beamer.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 87458f0..d1cfbfd 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -513,7 +513,7 @@ used as a communication channel."
            ;; remove the first word from the contents in the PDF
            ;; output.
            (if (not fragilep) contents
-             (replace-regexp-in-string "\\`\n*" "\\& " contents))
+             (replace-regexp-in-string "\\`\n*" "\\& " (or contents "")))
            "\\end{frame}")))
 
 (defun org-beamer--format-block (headline contents info)
-- 
1.8.2.1

Finally, I ran into a third and even more minor problem.  Illustrated by
the following example.

#+TITLE: Example Presentation
#+Options: ^:nil toc:nil

* Breeders Equation
\begin{equation*}
  R = h^{2}S
\end{equation*}

- R :: response
- h^{2} :: heritability
- S :: selective distance
When exported to a beamer presentation, what should be h squared is
instead exported as h^{2}.

Thanks,

>
>
> Regards,

-- 
Eric Schulte
http://cs.unm.edu/~eschulte

reply via email to

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