[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Export attached image files
From: |
Rick Frankel |
Subject: |
Re: [O] Export attached image files |
Date: |
Tue, 20 Aug 2013 14:37:04 -0400 |
User-agent: |
Roundcube Webmail/0.9.0 |
On 2013-08-20 11:41, Charles Berry wrote:
Johan Ekh <ekh.johan <at> gmail.com> writes:
[snip]
I would like
to take a series of screenshots, quickly incorporate them into an org
file together with some text without having to rename
the screenshots with suitable names and organize them on my disk etc.
I'd
like org-mode to store the images somewhere
in a data directory as an attachment, but of course I'd like the
screenshots to be incorporated in the pdf-file when I export it.
Is this possible?
It's a bit less automated than you might like, but if you define this
library of babel method:
#+name: insert-attached-images
#+BEGIN_SRC emacs-lisp :var where=(point)
(save-excursion
(goto-char where)
(mapcar
(lambda (file)
(format "[[%s]]" (org-attach-expand file)))
(org-entry-get-multivalued-property
where org-attach-file-list-property)))
#+END_SRC
use it like:
#+call: insert-attached-images() :results list
e.g:
#+BEGIN_ORG
** Heading with attachments :ATTACH:
:PROPERTIES:
:Attachments: t.png t2.png
:ID: 528b68ed-c896-4a4b-aa3f-b3d292b693bf
:END:
#+RESULTS:
#+call: insert-attached-images() :results list
#+RESULTS:
-
[[/export/home/ut0598/tmp/data/52/8b68ed-c896-4a4b-aa3f-b3d292b693bf/t.png]]
-
[[/export/home/ut0598/tmp/data/52/8b68ed-c896-4a4b-aa3f-b3d292b693bf/t2.png]]
#+END_ORG
in a heading with ad-hoc attachments, it will do what you want...
rick