From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aaron Ecay Subject: Re: section subtitle in latex export Date: Thu, 02 May 2013 00:46:46 -0400 Message-ID: <878v3ykmyx.fsf@gmail.com> References: <5181C626.4040804@gmail.com> <5181DCF2.9060808@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([208.118.235.92]:36294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXlPu-0002Gx-1L for emacs-orgmode@gnu.org; Thu, 02 May 2013 00:46:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UXlPs-0002VG-Ue for emacs-orgmode@gnu.org; Thu, 02 May 2013 00:46:49 -0400 Received: from mail-qa0-x235.google.com ([2607:f8b0:400d:c00::235]:37148) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UXlPs-0002V3-Qg for emacs-orgmode@gnu.org; Thu, 02 May 2013 00:46:48 -0400 Received: by mail-qa0-f53.google.com with SMTP id p6so116106qad.5 for ; Wed, 01 May 2013 21:46:48 -0700 (PDT) In-Reply-To: <5181DCF2.9060808@gmail.com> 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: Masataro Asai Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Masataro, I agree that it is weird for org to insert the alternate header when it is identical to the regular header. I think it is unnecessary complication to introduce a new option to control this, though =E2=80=93 it= can be automatic. Try the patch attached to this email. It simply avoids inserting the alternate heading whenever it is identical to the standard one. (Nicolas, I=E2=80=99m waiting to see if you have any thoughts before pushing this patch to the org repo.) 2013ko maiatzak 1an, Masataro Asai-ek idatzi zuen: [...] > @@ -1442,7 +1448,7 @@ holding contextual information." > (org-export-data > (org-export-get-alt-title headline info) info) > (and (eq (plist-get info :with-tags) t) tags)))) > - (if (and numberedp opt-title > + (if (and numberedp opt-title > org-latex-alternative-section-title-enabled It looks like your patch got line-wrapped here. Better to send patches as attachments to avoid this. --=-=-= Content-Type: text/x-patch; charset=utf-8 Content-Disposition: attachment; filename=0001-ox-latex.el-org-latex-headline-Don-t-insert-alternat.patch Content-Transfer-Encoding: quoted-printable >From f84800fb82d432112a06918bbe389a00968773bc Mon Sep 17 00:00:00 2001 From: Aaron Ecay Date: Thu, 2 May 2013 00:36:44 -0400 Subject: [PATCH] =3D?UTF-8?q?ox-latex.el=3D20(org-latex-headline):=3D20Don?= =3D =3D?UTF-8?q?=3DE2=3D80=3D99t=3D20insert=3D20alternate=3D20title=3D20if=3D2= 0identical=3D20to?=3D =3D?UTF-8?q?=3D20regular=3D20one?=3D MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit * lisp/ox-latex.el (org-latex-headline): Don=E2=80=99t insert alternate tit= le 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 --=20 1.8.2.2 --=-=-= Content-Type: text/plain -- Aaron Ecay --=-=-=--