summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Ecay <aaronecay@gmail.com>2013-07-27 06:24:38 (GMT)
committer Aaron Ecay <aaronecay@gmail.com>2013-07-27 06:24:38 (GMT)
commit0cef5b63eb67b9665221df77929fe154e0343253 (patch)
tree15114f6862399580dfd5240c997d63d98896f67a
parent46d05e4d08823614e702178353444e23a513b24d (diff)
downloadorg-mode-0cef5b63eb67b9665221df77929fe154e0343253.zip
org-mode-0cef5b63eb67b9665221df77929fe154e0343253.tar.gz
ox-latex: support SVG images
* lisp/ox-latex.el (org-latex-inline-image-rules): add "svg" to supported filetypes. (org-latex--inline-image): implement the appropriate code for including SVG files. This relies on the "svg" LaTeX package (http://www.ctan.org/pkg/svg)
-rw-r--r--lisp/ox-latex.el13
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index cc741bf..943ea95 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -426,7 +426,7 @@ environment."
:type 'string)
(defcustom org-latex-inline-image-rules
- '(("file" . "\\.\\(pdf\\|jpeg\\|jpg\\|png\\|ps\\|eps\\|tikz\\|pgf\\)\\'"))
+ '(("file" . "\\.\\(pdf\\|jpeg\\|jpg\\|png\\|ps\\|eps\\|tikz\\|pgf\\|svg\\)\\'"))
"Rules characterizing image files that can be inlined into LaTeX.
A rule consists in an association whose key is the type of link
@@ -1725,7 +1725,16 @@ used as a communication channel."
((= (aref options 0) ?,)
(format "[%s]"(substring options 1)))
(t (format "[%s]" options)))
- path)))
+ path))
+ (when (equal filetype "svg")
+ (setq image-code (replace-regexp-in-string "^\\\\includegraphics"
+ "\\includesvg"
+ image-code
+ nil t))
+ (setq image-code (replace-regexp-in-string "\\.svg}"
+ "}"
+ image-code
+ nil t))))
;; Return proper string, depending on FLOAT.
(case float
(wrap (format "\\begin{wrapfigure}%s