Explorar el Código

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 hace 12 años
padre
commit
7b36019069
Se han modificado 1 ficheros con 6 adiciones y 3 borrados
  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