Function: org-odt--copy-formula-file
org-odt--copy-formula-file is a byte-compiled function defined in
ox-odt.el.gz.
Signature
(org-odt--copy-formula-file SRC-FILE)
Documentation
Return the internal name of the file.
Source Code
;; Defined in /usr/src/emacs/lisp/org/ox-odt.el.gz
(defun org-odt--copy-formula-file (src-file)
"Return the internal name of the file."
(let* ((target-dir (format "Formula-%04d/"
(cl-incf org-odt-embedded-formulas-count)))
(target-file (concat target-dir "content.xml")))
;; Create a directory for holding formula file. Also enter it in
;; to manifest.
(make-directory (concat org-odt-zip-dir target-dir))
(org-odt-create-manifest-file-entry
"application/vnd.oasis.opendocument.formula" target-dir "1.2")
;; Copy over the formula file from user directory to zip
;; directory.
(message "Embedding %s as %s..." src-file target-file)
(let ((ext (file-name-extension src-file)))
(cond
;; Case 1: Mathml.
((member ext '("mathml" "mml"))
(copy-file src-file (concat org-odt-zip-dir target-file) 'overwrite))
;; Case 2: OpenDocument formula.
((string= ext "odf")
(org-odt--zip-extract src-file "content.xml"
(concat org-odt-zip-dir target-dir)))
(t (error "%s is not a formula file" src-file))))
;; Enter the formula file in to manifest.
(org-odt-create-manifest-file-entry "text/xml" target-file)
target-file))