emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Daniele Pizzolli <dan@toel.it>
Cc: emacs-orgmode@gnu.org
Subject: Re: Bug: dates in heading break beamer export
Date: Thu, 03 Oct 2013 15:30:44 +0200	[thread overview]
Message-ID: <87zjqqo517.fsf@gmail.com> (raw)
In-Reply-To: <524C4591.9020804@toel.it> (Daniele Pizzolli's message of "Wed, 02 Oct 2013 18:10:57 +0200")

[-- Attachment #1: Type: text/plain, Size: 500 bytes --]

Hello,

Daniele Pizzolli <dan@toel.it> 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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-beamer-Protect-fragile-commands-in-sections.patch --]
[-- Type: text/x-diff, Size: 1743 bytes --]

From d8c37c9265fd6a3d45dce4ce86a12b634c9be0fd Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@gmail.com>
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


  parent reply	other threads:[~2013-10-03 13:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-29 10:33 Bug: dates in heading break beamer export Daniele Pizzolli
2013-09-29 14:53 ` Nicolas Goaziou
2013-09-29 15:27   ` Marcin Borkowski
2013-09-30 16:02     ` Daniele Pizzolli
2013-09-30 17:05       ` Marcin Borkowski
2013-10-01 16:01         ` Nicolas Goaziou
2013-10-01 16:33           ` Marcin Borkowski
2013-10-02  6:50         ` Bug: code and footnotes (was Bug: dates in heading break beamer export) Daniele Pizzolli
2013-10-01  8:09       ` Bug: dates in heading break beamer export Eric S Fraga
2013-10-02  6:47       ` Daniele Pizzolli
2013-10-02 13:45         ` Nicolas Goaziou
2013-10-02 15:36           ` Daniele Pizzolli
2013-10-02 15:55             ` Nicolas Goaziou
2013-10-02 16:10               ` Daniele Pizzolli
2013-10-02 20:47                 ` Marcin Borkowski
2013-10-03 13:30                 ` Nicolas Goaziou [this message]
2013-10-03 15:59                   ` Daniele Pizzolli
2013-10-04 19:17                     ` Nicolas Goaziou
2013-10-02 22:12               ` Suvayu Ali

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zjqqo517.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=dan@toel.it \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).