From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Dittmann Subject: [PATCH] Make [fragile] work with overlay specifications. Date: Tue, 07 Feb 2012 18:34:04 +0100 Message-ID: <4F31608C.70704@christoph-d.de> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------070400090008020900020809" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:33186) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RuowS-0007Y6-Co for emacs-orgmode@gnu.org; Tue, 07 Feb 2012 12:35:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RuowG-0005Nj-Ra for emacs-orgmode@gnu.org; Tue, 07 Feb 2012 12:34:56 -0500 Received: from christoph-d.de ([85.214.213.216]:33736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RuowG-0005NU-DI for emacs-orgmode@gnu.org; Tue, 07 Feb 2012 12:34:44 -0500 Received: from turing.las.tu-berlin.de (turing.las.tu-berlin.de [130.149.59.204]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: christoph) by christoph-d.de (Postfix) with ESMTPSA id 524446F31959 for ; Tue, 7 Feb 2012 18:34:41 +0100 (CET) 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: emacs-orgmode@gnu.org This is a multi-part message in MIME format. --------------070400090008020900020809 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 --------------070400090008020900020809 Content-Type: text/x-patch; name="0001-Make-fragile-work-with-overlay-specifications.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename*0="0001-Make-fragile-work-with-overlay-specifications.patch" >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 --------------070400090008020900020809--