From 7b36019069490e30084cd6d9cb72965a956d5564 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 17 Mar 2013 22:01:36 +0100 Subject: [PATCH] ox-latex: Fix error with inline image with no option provided * lisp/ox-latex.el (org-latex--inline-image): Fix error when no default width, height and option are provided and no attribute is set for the inline image. --- lisp/ox-latex.el | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index fa66bb477..fd28df49b 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1853,9 +1853,12 @@ used as a communication channel." (setq options (concat options ",width=" width))) (when (org-string-nw-p height) (setq options (concat options ",height=" height))) - (when (= (aref options 0) ?,) - (setq options (substring options 1))) - (setq image-code (format "\\includegraphics[%s]{%s}" options path))) + (setq image-code + (format "\\includegraphics%s{%s}" + (cond ((not (org-string-nw-p options)) "") + ((= (aref options 0) ?,) (substring options 1)) + (t options)) + path))) ;; Return proper string, depending on FLOAT. (case float (wrap (format "\\begin{wrapfigure}%s -- 2.11.4.GIT