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.
This commit is contained in:
parent
d293492f09
commit
311146aa21
|
@ -1271,7 +1271,7 @@ value of `org-export-odt-fontify-srcblocks."
|
||||||
(and latex-frag
|
(and latex-frag
|
||||||
(org-find-text-property-in-string
|
(org-find-text-property-in-string
|
||||||
'org-latex-src-embed-type src))
|
'org-latex-src-embed-type src))
|
||||||
'paragraph))
|
(if (or caption label) 'paragraph 'character)))
|
||||||
width height)
|
width height)
|
||||||
(when latex-frag
|
(when latex-frag
|
||||||
(setq href (org-propertize href :title "LaTeX Fragment"
|
(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
|
(org-odt-create-manifest-file-entry
|
||||||
"application/vnd.oasis.opendocument.formula" target-dir "1.2")
|
"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))
|
(org-odt-create-manifest-file-entry "text/xml" target-file))
|
||||||
target-file))
|
target-file))
|
||||||
|
|
||||||
|
@ -1323,7 +1330,11 @@ value of `org-export-odt-fontify-srcblocks."
|
||||||
|
|
||||||
(defun org-odt-is-formula-link-p (file)
|
(defun org-odt-is-formula-link-p (file)
|
||||||
(let ((case-fold-search nil))
|
(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
|
(defun org-odt-format-org-link (opt-plist type-1 path fragment desc attr
|
||||||
descp)
|
descp)
|
||||||
|
|
Loading…
Reference in New Issue