emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: Masataro Asai <guicho2.71828@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: section subtitle in latex export
Date: Thu, 02 May 2013 00:46:46 -0400	[thread overview]
Message-ID: <878v3ykmyx.fsf@gmail.com> (raw)
In-Reply-To: <5181DCF2.9060808@gmail.com>

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

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 – 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’m 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.


[-- Attachment #2: 0001-ox-latex.el-org-latex-headline-Don-t-insert-alternat.patch --]
[-- Type: text/x-patch, Size: 1643 bytes --]

From f84800fb82d432112a06918bbe389a00968773bc Mon Sep 17 00:00:00 2001
From: Aaron Ecay <aaronecay@gmail.com>
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


[-- Attachment #3: Type: text/plain, Size: 16 bytes --]


-- 
Aaron Ecay

  reply	other threads:[~2013-05-02  4:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-02  1:49 section subtitle in latex export Masataro Asai
2013-05-02  3:26 ` Masataro Asai
2013-05-02  4:46   ` Aaron Ecay [this message]
2013-05-02  8:06     ` Rasmus
2013-05-02  8:29     ` Nicolas Goaziou
2013-05-03  8:18       ` Aaron Ecay
2013-05-02  8:26   ` Nicolas Goaziou
2013-05-02 11:05     ` Masataro Asai
2013-05-02 14:00       ` Nicolas Goaziou

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=878v3ykmyx.fsf@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=guicho2.71828@gmail.com \
    /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).