From 20f0299bc3e4518205dece3f8b8fa90c2a30086d Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 10 May 2020 14:43:40 +0200 Subject: [PATCH] ox-latex: Do not center images in image links * lisp/ox-latex.el (org-latex--inline-image): Do not center image when it is the description of a link. Reported-by: Arne Babenhauserheide --- lisp/ox-latex.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 05eee78a0..6535d59f8 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -2389,8 +2389,11 @@ used as a communication channel." (format "[%s]" (plist-get info :latex-default-figure-position))) (t "")))) (center - (if (plist-member attr :center) (plist-get attr :center) - (plist-get info :latex-images-centered))) + (cond + ;; If link is an image link, do not center. + ((eq 'link (org-element-type (org-export-get-parent link))) nil) + ((plist-member attr :center) (plist-get attr :center)) + (t (plist-get info :latex-images-centered)))) (comment-include (if (plist-get attr :comment-include) "%" "")) ;; It is possible to specify scale or width and height in ;; the ATTR_LATEX line, and also via default variables.