Re: [O] [PATCH] Make [fragile] work with overlay specifications.
Hi Christoph, Christoph Dittmann writes: > I noticed something unexpected in org-beamer.el when I used overlay > specifications together with optional parameters for the frame > environment and the frame contained verbatim sections. In this case the > exporter would add [fragile] to the frame options in a way that would > break the LaTeX code. > > I wrote a small patch that fixes this particular problem for me. Applied, thanks. -- Bastien
[O] [PATCH] Make [fragile] work with overlay specifications.
Hi, I noticed something unexpected in org-beamer.el when I used overlay specifications together with optional parameters for the frame environment and the frame contained verbatim sections. In this case the exporter would add [fragile] to the frame options in a way that would break the LaTeX code. I wrote a small patch that fixes this particular problem for me. The following test case generates invalid LaTeX code with org-mode revision c4b23345. With the attached patch it generates valid LaTeX code. #+LaTeX_CLASS: beamer * overlay + optional parameter :PROPERTIES: :BEAMER_envargs: [label=abc]<1> :END: #+BEGIN_LaTeX \begin{verbatim} I am [fragile] \end{verbatim} #+END_LaTeX Christoph >From a4624f52055667ed8c5220ca49f459274bfc7f45 Mon Sep 17 00:00:00 2001 From: Christoph Dittmann Date: Tue, 7 Feb 2012 14:43:26 +0100 Subject: [PATCH] Make [fragile] work with overlay specifications. If the BEAMER_envargs property contains optional parameters together with an overlay specification like [option]<1-2>, the exporter turns the start of the frame into \begin{frame}<1-2>[option]. If then [fragile] needs to be added, this becomes \begin{frame}[fragile]<1-2>[option] and causes a LaTeX error. With this patch [fragile] is added in a way such that the line becomes \begin{frame}<1-2>[fragile,option]. --- lisp/org-beamer.el |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lisp/org-beamer.el b/lisp/org-beamer.el index fae5967..1823b03 100644 --- a/lisp/org-beamer.el +++ b/lisp/org-beamer.el @@ -502,7 +502,7 @@ This function will run in the final LaTeX document." (while (re-search-forward org-beamer-fragile-re nil t) (save-excursion ;; Are we inside a frame here? - (when (and (re-search-backward "^[ \t]*\\(begin\\|end\\){frame}" + (when (and (re-search-backward "^[ \t]*\\(begin\\|end\\){frame}\\(<[^>]*>\\)?" nil t) (equal (match-string 1) "begin")) ;; yes, inside a frame, make sure "fragile" is one of the options -- 1.7.5.4
[O] [PATCH] Make [fragile] work with overlay specifications.
Hi, I noticed something unexpected in org-beamer.el when I used overlay specifications together with optional parameters for the frame environment and the frame contained verbatim sections. In this case the exporter would add [fragile] to the frame options in a way that would break the LaTeX code. I wrote a small patch that fixes this particular problem for me. The following test case generates invalid LaTeX code with org-mode revision c4b23345. With the attached patch it generates valid LaTeX code. #+LaTeX_CLASS: beamer * overlay + optional parameter :PROPERTIES: :BEAMER_envargs: [label=abc]<1> :END: #+BEGIN_LaTeX \begin{verbatim} I am [fragile] \end{verbatim} #+END_LaTeX Christoph >From a4624f52055667ed8c5220ca49f459274bfc7f45 Mon Sep 17 00:00:00 2001 From: Christoph Dittmann Date: Tue, 7 Feb 2012 14:43:26 +0100 Subject: [PATCH] Make [fragile] work with overlay specifications. If the BEAMER_envargs property contains optional parameters together with an overlay specification like [option]<1-2>, the exporter turns the start of the frame into \begin{frame}<1-2>[option]. If then [fragile] needs to be added, this becomes \begin{frame}[fragile]<1-2>[option] and causes a LaTeX error. With this patch [fragile] is added in a way such that the line becomes \begin{frame}<1-2>[fragile,option]. --- lisp/org-beamer.el |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/lisp/org-beamer.el b/lisp/org-beamer.el index fae5967..1823b03 100644 --- a/lisp/org-beamer.el +++ b/lisp/org-beamer.el @@ -502,7 +502,7 @@ This function will run in the final LaTeX document." (while (re-search-forward org-beamer-fragile-re nil t) (save-excursion ;; Are we inside a frame here? - (when (and (re-search-backward "^[ \t]*\\(begin\\|end\\){frame}" + (when (and (re-search-backward "^[ \t]*\\(begin\\|end\\){frame}\\(<[^>]*>\\)?" nil t) (equal (match-string 1) "begin")) ;; yes, inside a frame, make sure "fragile" is one of the options -- 1.7.5.4