emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Masataro Asai <guicho2.71828@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: section subtitle in latex export
Date: Thu, 02 May 2013 12:26:42 +0900	[thread overview]
Message-ID: <5181DCF2.9060808@gmail.com> (raw)
In-Reply-To: <5181C626.4040804@gmail.com>

Reply to myself:

I edebugged the ox-latex and studied what's happening.
Who wrote this code? you shouldn't do things like this...
The code is overwriting the defcustom'ed sectioning format, no one knows.

the best answer for this problem would be changing the structure of
org-latex-classes but I dont want to do that right now.
so I just gave an option for alternative-heading.



diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 2a315ef..95e96f0 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -303,6 +303,12 @@ a format string in which the section title will be
added."
                    (string :tag "Closing (unnumbered)"))
              (function :tag "Hook computing sectioning"))))))
 
+(defcustom org-latex-alternative-section-title-enabled t
+  "Output alternative section title such as
+\\section[short title]{Long long very long title}."
+  :group 'org-export-latex
+  :type 'boolean)
+
 (defcustom org-latex-inputenc-alist nil
   "Alist of inputenc coding system names, and what should really be used.
 For example, adding an entry
@@ -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
            (string-match "\\`\\\\\\(.*?[^*]\\){" section-fmt))
           (format (replace-match "\\1[%s]" nil nil section-fmt 1)
               ;; Replace square brackets with parenthesis



On 2013年05月02日 10:49, Masataro Asai wrote:
> Hi all,
>
> I am currently writing a journal thesis in org-mode and exporting it
> to a LaTeX file. It worked well until recently I have updated the
> org-mode version
> to the latest one.
>
> My problem is that the specified class file for the journal fails to
> interpret the subtitle
> of the sectioning command e.g.) \section[subtitle]{title} . Is it
> possible to turn off that subtitle?
> I looked into the source code of ox-latex.el but org-latex-section tells
> nothing about it.
> I have also checked org-latex-classes but curiously
> the sectioning format is just "\\section{%s}" and so on. no subtitle.
>
> org-mode version is the latest devel in the git repository, after 8.0.2,
> git commit hash is 00badf1
>  and the emacs version is 23.3.1
>


-- 
Masataro Asai

Department of General Systems Studies
Graduate School of Arts and Sciences, The University of Tokyo

Tel: (81)-44-856-9009
Twitter/github id: guicho271828

  reply	other threads:[~2013-05-02  3:26 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 [this message]
2013-05-02  4:46   ` Aaron Ecay
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=5181DCF2.9060808@gmail.com \
    --to=guicho2.71828@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /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).