emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Export attached image files
@ 2013-08-19 10:05 Johan Ekh
  2013-08-19 11:03 ` Suvayu Ali
  0 siblings, 1 reply; 7+ messages in thread
From: Johan Ekh @ 2013-08-19 10:05 UTC (permalink / raw)
  To: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

Hi all,
How can I include attached image files in my pdf-file which is generated by
the latex exporter. I know how to work with links but what if I want to
quickly attach files and then delete the files from my hard disk and only
have them as attachments in my org-file?

BR / Johan

[-- Attachment #2: Type: text/html, Size: 342 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Export attached image files
  2013-08-19 10:05 Export attached image files Johan Ekh
@ 2013-08-19 11:03 ` Suvayu Ali
  2013-08-20  8:34   ` Johan Ekh
  0 siblings, 1 reply; 7+ messages in thread
From: Suvayu Ali @ 2013-08-19 11:03 UTC (permalink / raw)
  To: emacs-orgmode

Hi Johan,

On Mon, Aug 19, 2013 at 12:05:53PM +0200, Johan Ekh wrote:
> Hi all,
> How can I include attached image files in my pdf-file which is generated by
> the latex exporter.

Short answer: not possible.

> I know how to work with links but what if I want to
> quickly attach files and then delete the files from my hard disk and only
> have them as attachments in my org-file?

If you delete a file from the disk, attaching it won't help either.  Org
files are plain text, attachments are also stored as references.  It
would help us understand better if you could elaborate a bit on what is
your eventual goal?

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Export attached image files
  2013-08-19 11:03 ` Suvayu Ali
@ 2013-08-20  8:34   ` Johan Ekh
  2013-08-20  9:51     ` Suvayu Ali
                       ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Johan Ekh @ 2013-08-20  8:34 UTC (permalink / raw)
  To: Suvayu Ali; +Cc: emacs-orgmode@gnu.org

[-- Attachment #1: Type: text/plain, Size: 1702 bytes --]

Thanks for your answer Suvayu!

Sorry for being unclear. What I mean is that when I write reports or papers
using org-mode and latex exporter it is natural
to take care in storing my image files in a structured way on my disk and
use links in org-mode to incorporate the images
in my latex document. These image files will live on my disk more or less
forever.

But if I write a note or some guide for myself regarding usage of some
software, or the settings in my router, 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?

BR / Johan


On Mon, Aug 19, 2013 at 1:03 PM, Suvayu Ali <fatkasuvayu+linux@gmail.com>wrote:

> Hi Johan,
>
> On Mon, Aug 19, 2013 at 12:05:53PM +0200, Johan Ekh wrote:
> > Hi all,
> > How can I include attached image files in my pdf-file which is generated
> by
> > the latex exporter.
>
> Short answer: not possible.
>
> > I know how to work with links but what if I want to
> > quickly attach files and then delete the files from my hard disk and only
> > have them as attachments in my org-file?
>
> If you delete a file from the disk, attaching it won't help either.  Org
> files are plain text, attachments are also stored as references.  It
> would help us understand better if you could elaborate a bit on what is
> your eventual goal?
>
> Cheers,
>
> --
> Suvayu
>
> Open source is the future. It sets us free.
>
>

[-- Attachment #2: Type: text/html, Size: 2350 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Export attached image files
  2013-08-20  8:34   ` Johan Ekh
@ 2013-08-20  9:51     ` Suvayu Ali
  2013-08-20 12:42     ` Dieter Wilhelm
  2013-08-20 15:41     ` Charles Berry
  2 siblings, 0 replies; 7+ messages in thread
From: Suvayu Ali @ 2013-08-20  9:51 UTC (permalink / raw)
  To: Johan Ekh; +Cc: emacs-orgmode@gnu.org

Hi Johan,

On Tue, Aug 20, 2013 at 10:34:06AM +0200, Johan Ekh wrote:
> Thanks for your answer Suvayu!
> 
> Sorry for being unclear. What I mean is that when I write reports or papers
> using org-mode and latex exporter it is natural
> to take care in storing my image files in a structured way on my disk and
> use links in org-mode to incorporate the images
> in my latex document. These image files will live on my disk more or less
> forever.
> 
> But if I write a note or some guide for myself regarding usage of some
> software, or the settings in my router, 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.

That is a valid use case, but I do not think that is possible.
Attachments are an Org only feature, meaning it is not meant for export.
That said, it should be possible to use a custom function to "get" the
attachments and add it to the end of the exported document using a hook;
try this one: `org-export-before-parsing-hook'.

To get an idea how to get the files, take a look at org-attach-open in
org-attach.el.  Once you have the filenames, just insert inline links at
the end of the buffer:

* Attachments
[[./path/to/attachment1]]
[[./path/to/attachment2]]

This should solve your request.

Hope this helps,

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Export attached image files
  2013-08-20  8:34   ` Johan Ekh
  2013-08-20  9:51     ` Suvayu Ali
@ 2013-08-20 12:42     ` Dieter Wilhelm
  2013-08-20 15:41     ` Charles Berry
  2 siblings, 0 replies; 7+ messages in thread
From: Dieter Wilhelm @ 2013-08-20 12:42 UTC (permalink / raw)
  To: Johan Ekh; +Cc: emacs-orgmode@gnu.org

Johan Ekh <ekh.johan@gmail.com> writes:

> Thanks for your answer Suvayu!
>
> Sorry for being unclear. What I mean is that when I write reports or
> papers using org-mode and latex exporter it is natural 
> to take care in storing my image files in a structured way on my disk
> and use links in org-mode to incorporate the images
> in my latex document. These image files will live on my disk more or
> less forever.
>
> But if I write a note or some guide for myself regarding usage of some
> software, or the settings in my router, 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. 

I don't understand why org-attachments are not good enough for your use
case? (info "(org)Attachments")

Especially if you're using

(setq org-link-abbrev-alist '(("att" . org-attach-expand-link)))

for conveniently accessing your data...

    Dieter

> Is this possible?
>
> BR / Johan
>
> On Mon, Aug 19, 2013 at 1:03 PM, Suvayu Ali
> <fatkasuvayu+linux@gmail.com> wrote:
>
>     Hi Johan,
>     
>     
>     On Mon, Aug 19, 2013 at 12:05:53PM +0200, Johan Ekh wrote:
>     > Hi all,
>     > How can I include attached image files in my pdf-file which is
>     generated by
>     > the latex exporter.
>     
>     
>     Short answer: not possible.
>     
>     
>     > I know how to work with links but what if I want to
>     > quickly attach files and then delete the files from my hard disk
>     and only
>     > have them as attachments in my org-file?
>     
>     
>     If you delete a file from the disk, attaching it won't help
>     either. Org
>     files are plain text, attachments are also stored as references.
>     It
>     would help us understand better if you could elaborate a bit on
>     what is
>     your eventual goal?
>     
>     Cheers,
>     
>     --
>     Suvayu
>     
>     Open source is the future. It sets us free.
>     
>
>

-- 
Best wishes

H. Dieter Wilhelm
Darmstadt
Germany

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Export attached image files
  2013-08-20  8:34   ` Johan Ekh
  2013-08-20  9:51     ` Suvayu Ali
  2013-08-20 12:42     ` Dieter Wilhelm
@ 2013-08-20 15:41     ` Charles Berry
  2013-08-20 18:37       ` Rick Frankel
  2 siblings, 1 reply; 7+ messages in thread
From: Charles Berry @ 2013-08-20 15:41 UTC (permalink / raw)
  To: emacs-orgmode

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?


IIUC what you want, yes.

There is contrib/lisp/org-screenshot.el for taking screenshots. It needs scrot.

Also, some posts showing how to roll your own screenshot during the last 
six months or so, some of which do not use scrot. If you are on MAC OS X
and do not want to install scrot, this might be good enough:

http://lists.gnu.org/archive/html/emacs-orgmode//2013-03/msg01843.html

If you have

* headline

text text text

[[file:path-to/my-file.jpg]]


Then the image gets rolled into your pdf.

You might need to mess with the width if you do not want full width
for an image.



[rest deleted]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Export attached image files
  2013-08-20 15:41     ` Charles Berry
@ 2013-08-20 18:37       ` Rick Frankel
  0 siblings, 0 replies; 7+ messages in thread
From: Rick Frankel @ 2013-08-20 18:37 UTC (permalink / raw)
  To: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2013-08-20 18:37 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-19 10:05 Export attached image files Johan Ekh
2013-08-19 11:03 ` Suvayu Ali
2013-08-20  8:34   ` Johan Ekh
2013-08-20  9:51     ` Suvayu Ali
2013-08-20 12:42     ` Dieter Wilhelm
2013-08-20 15:41     ` Charles Berry
2013-08-20 18:37       ` Rick Frankel

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).