From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: having problems exporting to Beamer Date: Sun, 14 Apr 2013 11:08:12 -0600 Message-ID: <87vc7pdoox.fsf@gmail.com> References: <87a9p2vxc7.fsf@gmail.com> <871uada6t2.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:47988) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URQRL-00067g-Nx for emacs-orgmode@gnu.org; Sun, 14 Apr 2013 13:10:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1URQRK-0004OW-DH for emacs-orgmode@gnu.org; Sun, 14 Apr 2013 13:10:07 -0400 Received: from mail-pd0-f179.google.com ([209.85.192.179]:64447) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1URQRK-0004N6-35 for emacs-orgmode@gnu.org; Sun, 14 Apr 2013 13:10:06 -0400 Received: by mail-pd0-f179.google.com with SMTP id x11so2118456pdj.38 for ; Sun, 14 Apr 2013 10:10:05 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Nicolas Goaziou Cc: Org Mode Mailing List --=-=-= Content-Type: text/plain Nicolas Goaziou writes: > Hello, > > Eric Schulte 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. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-ensure-a-beamer-entry-exists-in-org-latex-classes.patch >From 540bcddb50b746f4f2de910a199e4d13e8ddad11 Mon Sep 17 00:00:00 2001 From: Eric Schulte 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 --=-=-= Content-Type: text/plain 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. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0002-Ensure-nil-is-not-passed-to-regexp-function.patch >From ae7f4de7a04c9fac9fa36836370711cdb7f12fa7 Mon Sep 17 00:00:00 2001 From: Eric Schulte 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 --=-=-= Content-Type: text/plain Finally, I ran into a third and even more minor problem. Illustrated by the following example. --=-=-= Content-Type: text/x-org Content-Disposition: inline; filename=beamer-example.org #+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 --=-=-= Content-Type: text/plain 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 --=-=-=--