From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcin Borkowski Subject: Re: org-latex question Date: Sun, 12 Apr 2015 11:39:30 +0200 Message-ID: <87fv85fzxp.fsf@wmi.amu.edu.pl> References: <3A6F6CD4-C7F2-4796-8D16-007AFC0BEC91@agrarianresearch.org> <87bnitde2a.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:38348) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhEMi-0004Su-77 for emacs-orgmode@gnu.org; Sun, 12 Apr 2015 05:39:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YhEMf-00011z-0F for emacs-orgmode@gnu.org; Sun, 12 Apr 2015 05:39:44 -0400 Received: from msg.wmi.amu.edu.pl ([2001:808:114:2::50]:55646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhEMe-00011X-Q7 for emacs-orgmode@gnu.org; Sun, 12 Apr 2015 05:39:40 -0400 In-reply-to: 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: Nicolas Goaziou , org-mode mailing list On 2015-04-12, at 10:59, Vikas Rawal wrote: >>> How do I get a headline to be exported like this? >>> >>> >>> \section[Effect on staff turnover]{An analysis of the >>> effect of the revised recruitment policies on staff >>> turnover at divisional headquarters} >>> >>> >>> That is, with an extra short-title to be used in Table of Contents and >>> other running heads? >> >> See :ALT_TITLE: property. >> > > ALT_TITLE seems to work only for those headlines that appear in the Table of Contents. While that is the main purpose, this does not have to be necessarily the case. In the present case, I need it because LaTeX would not accept a footnote to a heading without it. True. This is because org-latex-headline is written this way: ,---- | (if (and numberedp opt-title | ;; ^^^ ^^^^^^^^^ why this? Maybe there's a good reason... | (not (equal opt-title full-text)) | (string-match "\\`\\\\\\(.*?[^*]\\){" section-fmt)) | (...) | ;; Impossible to add an alternative heading. Fallback to | ;; regular sectioning format string. | (format section-fmt full-text | (concat headline-label pre-blanks contents))) `---- However, it need not be this way: LaTeX itself (or more precisely: the default classes) seem to support the alt-title even for starred sectioning commands. Also, another way to circumvent this (/if/ there is some deep reason for the above code which I don't see, which is quite probable) is to hack into this part of the let form in org-latex-headline: ,---- | (section-back-end | (org-export-create-backend | :parent 'latex | :transcoders | '((underline . (lambda (o c i) (format "\\underline{%s}" c)))))) `---- and apply a (smart enough) filter in the (auxiliary) section-back-end, something like removing a match for \\footnote{.*?} (this would be easy to break; in general, regexen are not a suitable tool for this, because they can't "count" and match braces; however, writing a suitable filter should not be extremely difficult). > Vikas Hth, -- Marcin Borkowski http://octd.wmi.amu.edu.pl/en/Marcin_Borkowski Faculty of Mathematics and Computer Science Adam Mickiewicz University