summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJambunathan K <kjambunathan@gmail.com>2011-10-19 23:12:43 +0530
committerJambunathan K <kjambunathan@gmail.com>2011-10-19 23:12:43 +0530
commit757453b98e942fc13c4d80d9c7ab4948591cccba (patch)
tree05b032fd591efe7abccd36fed01aa6445a1718c2
parentce6f67c1ef62d77358059403587677fc6314705f (diff)
downloadorg-mode-757453b98e942fc13c4d80d9c7ab4948591cccba.tar.gz
Add a new option #+ODT_STYLES_FILE:...
* contrib/lisp/org-odt.el: Introduce a new option "#+ODT_STYLES_FILE: ..." for per-file setting of `org-export-odt-styles-file'. (org-export-odt-styles-file): Mention above option in docstring. (org-odt-save-as-outfile): Honor above option.
-rw-r--r--contrib/lisp/org-odt.el16
1 files changed, 14 insertions, 2 deletions
diff --git a/contrib/lisp/org-odt.el b/contrib/lisp/org-odt.el
index a14c827..9ec99c3 100644
--- a/contrib/lisp/org-odt.el
+++ b/contrib/lisp/org-odt.el
@@ -184,7 +184,13 @@ FILE-MEMBERS.
Use options 1, 2 or 3 only if styles.xml alone suffices for
achieving the desired formatting. Use option 4, if the styles.xml
references additional files like header and footer images for
-achieving the desired formattting."
+achieving the desired formattting.
+
+Use \"#+ODT_STYLES_FILE: ...\" directive to set this variable on
+a per-file basis. For example,
+
+#+ODT_STYLES_FILE: \"/path/to/styles.xml\" or
+#+ODT_STYLES_FILE: (\"/path/to/file.ott\" (\"styles.xml\" \"image/hdr.png\"))."
:group 'org-export-odt
:type
'(choice
@@ -197,6 +203,10 @@ achieving the desired formattting."
(file :tag " Member" "styles.xml")
(repeat (file :tag "Member"))))))
+(eval-after-load 'org-exp
+ '(add-to-list 'org-export-inbuffer-options-extra
+ '("ODT_STYLES_FILE" :odt-styles-file)))
+
(defconst org-export-odt-tmpdir-prefix "odt-")
(defconst org-export-odt-bookmark-prefix "OrgXref.")
(defcustom org-export-odt-use-bookmarks-for-internal-links t
@@ -1751,7 +1761,9 @@ visually."
(org-odt-update-meta-file opt-plist)
;; write styles file
- (org-odt-copy-styles-file)
+ (let ((styles-file (plist-get opt-plist :odt-styles-file)))
+ (org-odt-copy-styles-file (and styles-file
+ (read (org-trim styles-file)))))
;; Update styles.xml - take care of outline numbering
(with-current-buffer