From f84800fb82d432112a06918bbe389a00968773bc Mon Sep 17 00:00:00 2001 From: Aaron Ecay Date: Thu, 2 May 2013 00:36:44 -0400 Subject: [PATCH] =?UTF-8?q?ox-latex.el=20(org-latex-headline):=20Don?= =?UTF-8?q?=E2=80=99t=20insert=20alternate=20title=20if=20identical=20to?= =?UTF-8?q?=20regular=20one?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lisp/ox-latex.el (org-latex-headline): Don’t insert alternate title if identical to regular one. --- lisp/ox-latex.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 2a315ef..66eefa1 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1435,7 +1435,8 @@ holding contextual information." (format "\n\\\\end{%s}" (if numberedp 'enumerate 'itemize)) low-level-body))) ;; This is a standard headline. Export it as a section. Add - ;; an alternative heading when possible. + ;; an alternative heading when possible, and when this is not + ;; identical to the usual heading. (let ((opt-title (funcall org-latex-format-headline-function todo todo-type priority @@ -1443,6 +1444,7 @@ holding contextual information." (org-export-get-alt-title headline info) info) (and (eq (plist-get info :with-tags) t) tags)))) (if (and numberedp opt-title + (not (equal opt-title full-text)) (string-match "\\`\\\\\\(.*?[^*]\\){" section-fmt)) (format (replace-match "\\1[%s]" nil nil section-fmt 1) ;; Replace square brackets with parenthesis -- 1.8.2.2