소스 검색

Merge branch 'maint'

Nicolas Goaziou 11 년 전
부모
커밋
1734eea184
1개의 변경된 파일21개의 추가작업 그리고 3개의 파일을 삭제
  1. 21 3
      lisp/ox-beamer.el

+ 21 - 3
lisp/ox-beamer.el

@@ -444,13 +444,31 @@ INFO is a plist used as a communication channel."
   "Format HEADLINE as a sectioning part.
   "Format HEADLINE as a sectioning part.
 CONTENTS holds the contents of the headline.  INFO is a plist
 CONTENTS holds the contents of the headline.  INFO is a plist
 used as a communication channel."
 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))
+  (let ((latex-headline
+	 (org-export-data-with-backend
+	  headline
+	  ;; We create a temporary export back-end which behaves the
+	  ;; same as current one, but adds "\protect" in front of the
+	  ;; output of some objects.
+	  (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)))
 	(mode-specs (org-element-property :BEAMER_ACT headline)))
     (if (and mode-specs
     (if (and mode-specs
 	     (string-match "\\`\\\\\\(.*?\\)\\(?:\\*\\|\\[.*\\]\\)?{"
 	     (string-match "\\`\\\\\\(.*?\\)\\(?:\\*\\|\\[.*\\]\\)?{"
 			   latex-headline))
 			   latex-headline))
+	;; Insert overlay specifications.
 	(replace-match (concat (match-string 1 latex-headline)
 	(replace-match (concat (match-string 1 latex-headline)
 			       (format "<%s>" mode-specs))
 			       (format "<%s>" mode-specs))
 		       nil nil latex-headline 1)
 		       nil nil latex-headline 1)