summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJambunathan K <kjambunathan@gmail.com>2011-11-08 05:07:00 +0530
committerJambunathan K <kjambunathan@gmail.com>2011-11-08 05:08:26 +0530
commit311146aa2122f3bd64ec71cba0155bdfa0378c66 (patch)
treeab96ac090f05485ff14408f2eddb8f7fae1be92c
parentd293492f094cf563873ba4b362a3ce9d538964ef (diff)
downloadorg-mode-311146aa2122f3bd64ec71cba0155bdfa0378c66.tar.gz
Add support for embedding an equation via a link to its *.odf file
* contrib/lisp/org-odt.el (org-odt-is-formula-link-p): Recognize *.mml and *.mathml as mathml files. Recognize *.odf files as OpenDocument formula file. (org-odt-copy-formula-file): Use `org-odt-zip-extract-one' to handle ODF formula files. (org-export-odt-format-formula): If a ODF formula link has no caption or label, embed it inline. Otherwise embed it as displayed.
-rw-r--r--contrib/lisp/org-odt.el17
1 files changed, 14 insertions, 3 deletions
diff --git a/contrib/lisp/org-odt.el b/contrib/lisp/org-odt.el
index 2d4b4fc..0d53efd 100644
--- a/contrib/lisp/org-odt.el
+++ b/contrib/lisp/org-odt.el
@@ -1271,7 +1271,7 @@ value of `org-export-odt-fontify-srcblocks."
(and latex-frag
(org-find-text-property-in-string
'org-latex-src-embed-type src))
- 'paragraph))
+ (if (or caption label) 'paragraph 'character)))
width height)
(when latex-frag
(setq href (org-propertize href :title "LaTeX Fragment"
@@ -1306,7 +1306,14 @@ value of `org-export-odt-fontify-srcblocks."
(org-odt-create-manifest-file-entry
"application/vnd.oasis.opendocument.formula" target-dir "1.2")
- (copy-file src-file target-file 'overwrite)
+ (case (org-odt-is-formula-link-p src-file)
+ (mathml
+ (copy-file src-file target-file 'overwrite))
+ (odf
+ (org-odt-zip-extract-one src-file "content.xml" target-dir))
+ (t
+ (error "%s is not a formula file" src-file)))
+
(org-odt-create-manifest-file-entry "text/xml" target-file))
target-file))
@@ -1323,7 +1330,11 @@ value of `org-export-odt-fontify-srcblocks."
(defun org-odt-is-formula-link-p (file)
(let ((case-fold-search nil))
- (string-match "\\.mathml\\'" file)))
+ (cond
+ ((string-match "\\.\\(mathml\\|mml\\)\\'" file)
+ 'mathml)
+ ((string-match "\\.odf\\'" file)
+ 'odf))))
(defun org-odt-format-org-link (opt-plist type-1 path fragment desc attr
descp)