emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Marcin Borkowski <mbork@wmi.amu.edu.pl>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>,
	org-mode mailing list <emacs-orgmode@gnu.org>
Subject: Re: org-latex question
Date: Sun, 12 Apr 2015 11:39:30 +0200	[thread overview]
Message-ID: <87fv85fzxp.fsf@wmi.amu.edu.pl> (raw)
In-Reply-To: <A6CACDD4-497A-401E-8453-ED0B8D2931C7@agrarianresearch.org>


On 2015-04-12, at 10:59, Vikas Rawal <vikaslists@agrarianresearch.org> 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

  reply	other threads:[~2015-04-12  9:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-12  1:03 org-latex question Vikas Rawal
2015-04-12  7:02 ` Nicolas Goaziou
2015-04-12  8:59   ` Vikas Rawal
2015-04-12  9:39     ` Marcin Borkowski [this message]
2015-04-12 18:15       ` Nicolas Goaziou
2015-04-27  4:05         ` Vikas Rawal
2015-04-27  6:37           ` Marcin Borkowski
2015-04-27 14:06             ` Vikas Rawal
2015-04-27 15:45               ` Nicolas Goaziou
2015-04-28  5:53                 ` Vikas Rawal
2015-04-28  7:46                   ` Nicolas Goaziou
2015-04-28  7:47                     ` Vikas Rawal
2015-04-28  7:53                       ` Vikas Rawal
2015-04-27 15:45               ` Nick Dokos
2015-04-28  5:55                 ` Vikas Rawal
2015-04-28 15:18                   ` Nick Dokos
2015-04-28 16:36                     ` Thomas S. Dye
2015-04-29 13:22                       ` Vikas Rawal
2015-04-12 12:15     ` Rasmus
2015-04-12 13:22       ` Vikas Rawal

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=87fv85fzxp.fsf@wmi.amu.edu.pl \
    --to=mbork@wmi.amu.edu.pl \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /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).