org-download

a fork of abo-abo's org-download
git clone https://git.trogloxene.org/org-download.git
Log | Files | Refs | README

commit f99f884c47586ac8689b11c20eb95b2976c74d7c
parent 37d323034b09fe17029985aa556999acb2f9a0e5
Author: Yevgnen Koh <wherejoystarts@gmail.com>
Date:   Wed, 28 Dec 2016 22:33:20 +0800

Add attr_latex customization.

Diffstat:
Morg-download.el | 21++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/org-download.el b/org-download.el @@ -136,11 +136,16 @@ will be used." (const :tag "screencapture" "screencapture -i %s")) :group 'org-download) -(defcustom org-download-image-width 0 +(defcustom org-download-image-html-width 0 "When non-zero add #+attr_html: :width tag to the image." :type 'integer :group 'org-download) +(defcustom org-download-image-latex-width 0 + "When non-zero add #+attr_latex: :width tag to the image." + :type 'integer + :group 'org-download) + (defun org-download-get-heading (lvl) "Return the heading of the current entry's LVL level parent." (save-excursion @@ -317,12 +322,14 @@ It's inserted before the image link and is used to annotate it.") (insert (concat (funcall org-download-annotate-function link) - (format "\n%s[[file:%s]]" - (if (= org-download-image-width 0) - "" - (format - "#+attr_html: :width %dpx\n" org-download-image-width)) - (file-relative-name filename (file-name-directory (buffer-name)))))) + "\n" + (if (= org-download-image-html-width 0) + "" + (format "#+attr_html: :width %dpx\n" org-download-image-html-width)) + (if (= org-download-image-latex-width 0) + "" + (format "#+attr_latex: :width %dcm\n" org-download-image-latex-width)) + (format "[[file:%s]]" (file-relative-name filename (file-name-directory (buffer-name)))))) (org-display-inline-images)) (defun org-download--at-comment-p ()