Browse Source

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.
Nicolas Goaziou 12 năm trước cách đây
mục cha
commit
7b36019069
1 tập tin đã thay đổi với 6 bổ sung3 xóa
  1. 6 3
      lisp/ox-latex.el

+ 6 - 3
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