diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 58c1f123e..d2fb5e711 100755 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2009-11-24 Carsten Dominik + + * org-latex.el (org-export-latex-format-image): Preserve the + original-indentation property. + 2009-11-23 Carsten Dominik * org-clock.el (org-clock-insert-selection-line): Catch error when diff --git a/lisp/org-latex.el b/lisp/org-latex.el index 6e1356d39..aa8687b29 100644 --- a/lisp/org-latex.el +++ b/lisp/org-latex.el @@ -1601,8 +1601,9 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (defun org-export-latex-format-image (path caption label attr) "Format the image element, depending on user settings." - (let (floatp wrapp placement figenv) + (let (ind floatp wrapp placement figenv) (setq floatp (or caption label)) + (setq ind (org-get-text-property-any 0 'original-indentation path)) (when (and attr (stringp attr)) (if (string-match "[ \t]*\\" attr) (setq wrapp t floatp nil attr (replace-match "" t t attr))) @@ -1647,17 +1648,19 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER." (if (and (not label) (not caption) (string-match "^\\\\caption{.*\n" figenv)) (setq figenv (replace-match "" t t figenv))) - (org-fill-template - figenv - (list (cons "path" - (if (file-name-absolute-p path) - (expand-file-name path) - path)) - (cons "attr" attr) - (cons "labelcmd" (if label (format "\\label{%s}" - label)"")) - (cons "caption" (or caption "")) - (cons "placement" (or placement "")))))) + (org-add-props + (org-fill-template + figenv + (list (cons "path" + (if (file-name-absolute-p path) + (expand-file-name path) + path)) + (cons "attr" attr) + (cons "labelcmd" (if label (format "\\label{%s}" + label)"")) + (cons "caption" (or caption "")) + (cons "placement" (or placement "")))) + nil 'original-indentation ind))) (defun org-export-latex-protect-amp (s) (while (string-match "\\([^\\\\]\\)\\(&\\)" s)