* LATEX_CLASS_OPTIONS in SETUPFILE
@ 2011-10-20 14:01 Christophe Rhodes
2011-10-26 15:14 ` [patch] " Christophe Rhodes
0 siblings, 1 reply; 3+ messages in thread
From: Christophe Rhodes @ 2011-10-20 14:01 UTC (permalink / raw)
To: emacs-orgmode
Hi,
When using #+SETUPFILE and exporting via LaTeX, the LATEX_CLASS_OPTIONS
provided in the included file are ignored. With the following two files
in the same directory, doing C-c C-e L (org-export to a temporary LaTeX
buffer) produces a documentclass with class report (good, as expected)
and options [11pt] (not as expected). Placing the LATEX_CLASS_OPTIONS
line in top.org produces the expected options. I believe that the
reason is that LATEX_CLASS_OPTIONS is not handled within
org-infile-export-plist in org-exp.el.
--- top.org ---
#+TITLE: LaTeX Class Options
#+SETUPFILE: "include.org"
* Introduction
Here is some text.
--- end ---
--- include.org ---
#+LATEX_CLASS: report
#+LATEX_CLASS_OPTIONS: [a4paper,10pt]
--- end ---
There may be similar keywords for LaTeX or other backends that are also
not handled which maybe should be; this one is the one I noticed because
I tried to use it.
Best wishes,
Christophe
^ permalink raw reply [flat|nested] 3+ messages in thread
* [patch] Re: LATEX_CLASS_OPTIONS in SETUPFILE
2011-10-20 14:01 LATEX_CLASS_OPTIONS in SETUPFILE Christophe Rhodes
@ 2011-10-26 15:14 ` Christophe Rhodes
2011-10-26 17:27 ` Bastien
0 siblings, 1 reply; 3+ messages in thread
From: Christophe Rhodes @ 2011-10-26 15:14 UTC (permalink / raw)
To: emacs-orgmode
[-- Attachment #1: Type: text/plain, Size: 221 bytes --]
Christophe Rhodes <csr21@cantab.net> writes:
> I believe that the
> reason is that LATEX_CLASS_OPTIONS is not handled within
> org-infile-export-plist in org-exp.el.
Please find a patch attached addressing this issue.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-support-LATEX_CLASS_OPTIONS-in-SETUPFILE.patch --]
[-- Type: text/x-diff, Size: 2076 bytes --]
From 1f92aed1a882f93af78c57c67bd6f12401db877e Mon Sep 17 00:00:00 2001
From: Christophe Rhodes <csr21@cantab.net>
Date: Wed, 26 Oct 2011 16:13:20 +0100
Subject: [PATCH] support LATEX_CLASS_OPTIONS in #+SETUPFILE
* lisp/org-exp.el (org-infile-export-plist): handle LATEX_CLASS_OPTIONS
analogolusly to LATEX_CLASS
---
lisp/org-exp.el | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index 2aad322..4324d38 100644
--- a/lisp/org-exp.el
+++ b/lisp/org-exp.el
@@ -737,13 +737,13 @@ modified) list.")
'("TITLE" "AUTHOR" "DATE" "EMAIL" "TEXT" "OPTIONS" "LANGUAGE"
"MATHJAX"
"LINK_UP" "LINK_HOME" "SETUPFILE" "STYLE"
- "LATEX_HEADER" "LATEX_CLASS"
+ "LATEX_HEADER" "LATEX_CLASS" "LATEX_CLASS_OPTIONS"
"EXPORT_SELECT_TAGS" "EXPORT_EXCLUDE_TAGS"
"KEYWORDS" "DESCRIPTION" "MACRO" "BIND" "XSLT")
(mapcar 'car org-export-inbuffer-options-extra))))
(case-fold-search t)
p key val text options mathjax a pr style
- latex-header latex-class macros letbind
+ latex-header latex-class latex-class-options macros letbind
ext-setup-or-nil setup-file setup-dir setup-contents (start 0))
(while (or (and ext-setup-or-nil
(string-match re ext-setup-or-nil start)
@@ -770,6 +770,8 @@ modified) list.")
(setq latex-header (concat latex-header "\n" val)))
((string-equal key "LATEX_CLASS")
(setq latex-class val))
+ ((string-equal key "LATEX_CLASS_OPTIONS")
+ (setq latex-class-options val))
((string-equal key "TEXT")
(setq text (if text (concat text "\n" val) val)))
((string-equal key "OPTIONS")
@@ -813,6 +815,8 @@ modified) list.")
(setq p (plist-put p :latex-header-extra (substring latex-header 1))))
(when latex-class
(setq p (plist-put p :latex-class latex-class)))
+ (when latex-class-options
+ (setq p (plist-put p :latex-class-options latex-class-options)))
(when options
(setq p (org-export-add-options-to-plist p options)))
(when mathjax
--
1.7.5.4
[-- Attachment #3: Type: text/plain, Size: 308 bytes --]
I believe that this is a trivial change.
> There may be similar keywords for LaTeX or other backends that are also
> not handled which maybe should be; this one is the one I noticed because
> I tried to use it.
I have not spent time auditing backends for other similar keywords.
Best wishes,
Christophe
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-10-26 17:26 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-20 14:01 LATEX_CLASS_OPTIONS in SETUPFILE Christophe Rhodes
2011-10-26 15:14 ` [patch] " Christophe Rhodes
2011-10-26 17:27 ` Bastien
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).