From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: Bug: dates in heading break beamer export Date: Thu, 03 Oct 2013 15:30:44 +0200 Message-ID: <87zjqqo517.fsf@gmail.com> References: <524801E3.7040709@toel.it> <87bo3bwug5.fsf@gmail.com> <20130929172751.4644b537@aga-netbook> <5249A0AB.7080408@toel.it> <524BC196.8000700@toel.it> <87d2nnu6pp.fsf@gmail.com> <524C3D97.60705@toel.it> <8761tfu0ov.fsf@gmail.com> <524C4591.9020804@toel.it> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55163) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRizH-0002s1-8R for emacs-orgmode@gnu.org; Thu, 03 Oct 2013 09:30:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VRizB-0003kf-Cq for emacs-orgmode@gnu.org; Thu, 03 Oct 2013 09:30:39 -0400 Received: from mail-wi0-x232.google.com ([2a00:1450:400c:c05::232]:51012) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VRizB-0003kH-2K for emacs-orgmode@gnu.org; Thu, 03 Oct 2013 09:30:33 -0400 Received: by mail-wi0-f178.google.com with SMTP id hn9so2587531wib.17 for ; Thu, 03 Oct 2013 06:30:31 -0700 (PDT) In-Reply-To: <524C4591.9020804@toel.it> (Daniele Pizzolli's message of "Wed, 02 Oct 2013 18:10:57 +0200") 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: Daniele Pizzolli Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hello, Daniele Pizzolli writes: > On 10/02/2013 05:55 PM, Nicolas Goaziou wrote: >> Daniele Pizzolli writes: >> >>> Yes, I think is fair to drop the markup. >> >> OK. >> >>> I would also think that this is safe default when nested markup is >>> bad. The following patch should protect some fragile commands in a section-like structure. It is Beamer-only since general LaTeX back-end doesn't seem to encounter these problems. Does it fix the problem? Regards, -- Nicolas Goaziou --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-ox-beamer-Protect-fragile-commands-in-sections.patch >From d8c37c9265fd6a3d45dce4ce86a12b634c9be0fd Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Thu, 3 Oct 2013 15:11:03 +0200 Subject: [PATCH] ox-beamer: Protect fragile commands in sections * lisp/ox-beamer.el (org-beamer--format-section): Protect fragile commands in sections. --- lisp/ox-beamer.el | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el index a975d24..b812a75 100644 --- a/lisp/ox-beamer.el +++ b/lisp/ox-beamer.el @@ -444,9 +444,25 @@ INFO is a plist used as a communication channel." "Format HEADLINE as a sectioning part. CONTENTS holds the contents of the headline. INFO is a plist used as a communication channel." - ;; Use `latex' back-end output, inserting overlay specifications - ;; if possible. - (let ((latex-headline (org-export-with-backend 'latex headline contents info)) + ;; Use `latex' back-end output, inserting overlay specifications if + ;; possible. Also protect fragile commands. + (let ((latex-headline + (org-export-data-with-backend + headline + (org-export-create-backend + :parent 'latex + :transcoders + (let ((protected-output + (function + (lambda (object contents info) + (let ((code (org-export-with-backend + 'beamer object contents info))) + (if (org-string-nw-p code) (concat "\\protect" code) + code)))))) + (mapcar #'(lambda (type) (cons type protected-output)) + '(bold footnote-reference italic strike-through + timestamp underline)))) + info)) (mode-specs (org-element-property :BEAMER_ACT headline))) (if (and mode-specs (string-match "\\`\\\\\\(.*?\\)\\(?:\\*\\|\\[.*\\]\\)?{" -- 1.8.4 --=-=-=--