Re: [O] having problems exporting to Beamer
Hello, Eric Schulte schulte.e...@gmail.com 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). Regards, -- Nicolas Goaziou
Re: [O] having problems exporting to Beamer
Nicolas Goaziou n.goaz...@gmail.com writes: Hello, Eric Schulte schulte.e...@gmail.com 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 schulte.e...@gmail.com 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 schulte.e...@gmail.com 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
Re: [O] having problems exporting to Beamer
Eric Schulte schulte.e...@gmail.com writes: 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. The default value for this variable is already the empty string. After fixing the above I reached a new error. There was no beamer class defined in my `org-latex-classes'. This is already the case. You should update Org. 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}. You explicitly tell the exporter to not export sub/superscript with ^:nil. Just set it to t. Thanks for testing this. Regards, -- Nicolas Goaziou
Re: [O] having problems exporting to Beamer
Eric Schulte schulte.e...@gmail.com writes: Additionally, I ran into another nil vs. empty string problem, which was fixed by the second patch attached. I had overlooked this one. I applied it. Thank you. Regards, -- Nicolas Goaziou
Re: [O] having problems exporting to Beamer
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}. You explicitly tell the exporter to not export sub/superscript with ^:nil. Just set it to t. Oh, this must be a bug in the old exporter which I grew to depend upon. FWIW I always set ^:nil to t, so that I can use underscores w/o exporting subscript words. Previously even with ^:nil, superscripts using curly braces would be exported as superscripts. I guess I'll have to find a new mode of operation with the new exporter. Thanks, -- Eric Schulte http://cs.unm.edu/~eschulte
Re: [O] having problems exporting to Beamer
Eric Schulte schulte.e...@gmail.com writes: Oh, this must be a bug in the old exporter which I grew to depend upon. FWIW I always set ^:nil to t, so that I can use underscores w/o exporting subscript words. Previously even with ^:nil, superscripts using curly braces would be exported as superscripts. I guess I'll have to find a new mode of operation with the new exporter. What about using: ^:{} Regards, -- Nicolas Goaziou
Re: [O] having problems exporting to Beamer
Nicolas Goaziou n.goaz...@gmail.com writes: Eric Schulte schulte.e...@gmail.com writes: Oh, this must be a bug in the old exporter which I grew to depend upon. FWIW I always set ^:nil to t, so that I can use underscores w/o exporting subscript words. Previously even with ^:nil, superscripts using curly braces would be exported as superscripts. I guess I'll have to find a new mode of operation with the new exporter. What about using: ^:{} Beautiful, Thanks. Regards, -- Eric Schulte http://cs.unm.edu/~eschulte
[O] having problems exporting to Beamer
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? Thanks, Footnotes: [1] Debugger entered--Lisp error: (wrong-type-argument stringp nil) string-match(\\S- nil) (not (string-match \\S- argument)) (if (not (string-match \\S- argument)) (cond ((eql type (quote action)) (if (string-match \\`.*\\' argument) argument (format %s argument))) ((eql type (quote defaction)) (cond ((string-match \\`\\[.*\\]\\' argument) argument) ((string-match \\`.*\\' argument) (format [%s] argument)) ((string-match \\`\\[\\(.*\\)\\]\\' argument) (format [%s] (match-string 1 argument))) (t (format [%s] argument ((eql type (quote option)) (if (string-match \\`\\[.*\\]\\' argument) argument (format [%s] argument))) (t argument))) org-beamer--normalize-argument(nil option) (format \\begin{frame}%s{%s}\n (org-beamer--normalize-argument org-beamer-outline-frame-options (quote option)) org-beamer-outline-frame-title) (concat (format \\begin{frame}%s{%s}\n (org-beamer--normalize-argument org-beamer-outline-frame-options (quote option)) org-beamer-outline-frame-title) (if (wholenump depth) (progn (format \\setcounter{tocdepth}{%d}\n depth))) \\tableofcontents\n \\end{frame}\n\n) (progn (concat (format \\begin{frame}%s{%s}\n (org-beamer--normalize-argument org-beamer-outline-frame-options (quote option)) org-beamer-outline-frame-title) (if (wholenump depth) (progn (format \\setcounter{tocdepth}{%d}\n depth))) \\tableofcontents\n \\end{frame}\n\n)) (if depth (progn (concat (format \\begin{frame}%s{%s}\n (org-beamer--normalize-argument org-beamer-outline-frame-options (quote option)) org-beamer-outline-frame-title) (if (wholenump depth) (progn (format \\setcounter{tocdepth}{%d}\n depth))) \\tableofcontents\n \\end{frame}\n\n))) (let ((depth (plist-get info :with-toc))) (if depth (progn (concat (format \\begin{frame}%s{%s}\n (org-beamer--normalize-argument org-beamer-outline-frame-options (quote option)) org-beamer-outline-frame-title) (if (wholenump depth) (progn (format \\setcounter{tocdepth}{%d}\n depth))) \\tableofcontents\n \\end{frame}\n\n [...] (if async (let ((with-temp-message Initializing asynchronous export process) (current-message)) (unwind-protect (progn (if with-temp-message (progn (setq current-message (current-message)) (message %s with-temp-message))) (let ((--copy-fun (org-export--generate-copy-script ...)) (--temp-file (make-temp-file org-export-process)) (--coding buffer-file-coding-system)) (let ((temp-file --temp-file) (temp-buffer ...)) (unwind-protect (prog1 ... ...) (and ... ...))) (let* ((process-connection-type nil) (--proc-buffer ...) (--process ...)) (org-export-add-to-stack (get-buffer --proc-buffer) nil --process) (set-process-sentinel --process (let ... ...) (and with-temp-message (if current-message (message %s current-message) (message nil) (org-export-to-file (quote beamer) outfile subtreep visible-only body-only ext-plist)) (let ((outfile (org-export-output-file-name .tex subtreep))) (if async (let ((with-temp-message Initializing asynchronous export process) (current-message)) (unwind-protect (progn (if with-temp-message (progn (setq current-message ...) (message %s with-temp-message))) (let ((--copy-fun ...) (--temp-file ...) (--coding buffer-file-coding-system)) (let (... ...) (unwind-protect ... ...)) (let* (... ... ...) (org-export-add-to-stack ... nil --process) (set-process-sentinel --process ... (and with-temp-message (if current-message (message %s current-message) (message nil) (org-export-to-file (quote beamer) outfile subtreep visible-only body-only ext-plist))) org-beamer-export-to-latex(nil nil nil nil nil) (org-latex-compile (org-beamer-export-to-latex nil subtreep visible-only body-only ext-plist)) (if async (let ((outfile (org-export-output-file-name .tex subtreep))) (let ((with-temp-message Initializing asynchronous export process) (current-message)) (unwind-protect (progn (if with-temp-message (progn (setq current-message ...) (message %s with-temp-message))) (let ((--copy-fun ...) (--temp-file ...) (--coding buffer-file-coding-system)) (let (... ...) (unwind-protect ... ...)) (let* (... ... ...) (org-export-add-to-stack ... nil --process) (set-process-sentinel --process ... (and with-temp-message (if current-message (message %s current-message) (message nil)) (org-latex-compile (org-beamer-export-to-latex nil subtreep visible-only body-only ext-plist))) org-beamer-export-to-pdf(nil nil nil nil) org-export-dispatch(nil) call-interactively(org-export-dispatch nil nil) -- Eric Schulte http://cs.unm.edu/~eschulte