all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Carsten's Interview relates questions, esay insert images, attachemnt locations etc..
@ 2013-03-27  0:47 zeltak
  2013-03-27  3:52 ` Charles Berry
  2013-03-27 13:18 ` Memnon Anon
  0 siblings, 2 replies; 7+ messages in thread
From: zeltak @ 2013-03-27  0:47 UTC (permalink / raw)
  To: emacs-orgmode

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

Hya all

just finished listening to Carsten's Interview fantastic interview (hes a
great speaker :)). one thing that i really found needing in my (very) short
time using orgmode is an easy way to insert images into orgmode (i use that
alot in academia). are there any long term plans to implement this?
Also relates, how do you guys recommend currently to store the
images/attachment used in org files as link? pile them all in one big
folder, separate folder per org file, other method? any ideas would be
greatly appreciated :)

best

Z

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

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

* Re: Carsten's Interview relates questions, esay insert images, attachemnt locations etc..
  2013-03-27  0:47 Carsten's Interview relates questions, esay insert images, attachemnt locations etc zeltak
@ 2013-03-27  3:52 ` Charles Berry
  2013-03-27  6:33   ` Carsten Dominik
  2013-03-27 13:18 ` Memnon Anon
  1 sibling, 1 reply; 7+ messages in thread
From: Charles Berry @ 2013-03-27  3:52 UTC (permalink / raw)
  To: emacs-orgmode

zeltak <zeltak <at> gmail.com> writes:

[snip]
> one thing that i really found needing in my (very) short time using orgmode is
> an easy way to insert images into orgmode 
[snip]

> Also relates, how do you guys recommend currently to store the 
> images/attachment used in org files as link? pile them all in one big folder, 
> separate folder per org file, other method? any ideas would be greatly
> appreciated :)


Here is what I have done when needing to cut-and-paste a lot of images:

,----
| #+BEGIN_SRC emacs-lisp
|   (defun paste-clipboard-to-file (&optional filename temp-dir)
|     "Take a screenshot using the crosshairs and saveit to FILENAME,
|     if it is given or to a temp file in the TEMP-DIR
|     directory. Then add an orgmode style link at point."
|     (interactive)
|     (let* ((temporary-file-directory (or temp-dir "images"))
|            (fname (or filename (make-temp-file "img" nil ".jpg"))))
|       (call-process-shell-command (concat 
|                                     "/usr/sbin/screencapture -s " fname))
|       (insert "\n[[file:" fname "]]")
|       (org-display-inline-images)))  
|   ;;
|   (global-set-key (kbd "C-c p") 'paste-clipboard-to-file)
|   
| #+END_SRC
`----

After running that block, I move to my *.org buffer, make sure there is an 
'images' directory in M-x pwd RET, make sure I have an image somewhere on my 
desktop, then move my cursor to where I want a link to an image. C-c p launches 
the screenshot utility on my Mac ("/usr/sbin/screencapture -s " --- other OS'es
will have something similar) and I make a selection. It displays in my org
buffer, but I can toggle that off with M-x org-toggle-inline-images.

It really helps in reviewing an article with lots of equations to just clip
them out as I read and add a few notes.

===

You might try

C-h i org RET C-s image C-s C-s ...

to look thru the manual and see what it says about images.

And/Or google 'worg image orgmode'


HTH,

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

* Re: Carsten's Interview relates questions, esay insert images, attachemnt locations etc..
  2013-03-27  3:52 ` Charles Berry
@ 2013-03-27  6:33   ` Carsten Dominik
  2013-03-29 20:39     ` Stephen
  0 siblings, 1 reply; 7+ messages in thread
From: Carsten Dominik @ 2013-03-27  6:33 UTC (permalink / raw)
  To: Charles Berry; +Cc: emacs-orgmode


On 27.3.2013, at 04:52, Charles Berry <ccberry@ucsd.edu> wrote:

> zeltak <zeltak <at> gmail.com> writes:
> 
> [snip]
>> one thing that i really found needing in my (very) short time using orgmode is
>> an easy way to insert images into orgmode 
> [snip]
> 
>> Also relates, how do you guys recommend currently to store the 
>> images/attachment used in org files as link? pile them all in one big folder, 
>> separate folder per org file, other method? any ideas would be greatly
>> appreciated :)
> 
> 
> Here is what I have done when needing to cut-and-paste a lot of images:
> 
> ,----
> | #+BEGIN_SRC emacs-lisp
> |   (defun paste-clipboard-to-file (&optional filename temp-dir)
> |     "Take a screenshot using the crosshairs and saveit to FILENAME,
> |     if it is given or to a temp file in the TEMP-DIR
> |     directory. Then add an orgmode style link at point."
> |     (interactive)
> |     (let* ((temporary-file-directory (or temp-dir "images"))
> |            (fname (or filename (make-temp-file "img" nil ".jpg"))))
> |       (call-process-shell-command (concat 
> |                                     "/usr/sbin/screencapture -s " fname))
> |       (insert "\n[[file:" fname "]]")
> |       (org-display-inline-images)))  
> |   ;;
> |   (global-set-key (kbd "C-c p") 'paste-clipboard-to-file)
> |   
> | #+END_SRC
> `----
> 
> After running that block, I move to my *.org buffer, make sure there is an 
> 'images' directory in M-x pwd RET, make sure I have an image somewhere on my 
> desktop, then move my cursor to where I want a link to an image. C-c p launches 
> the screenshot utility on my Mac ("/usr/sbin/screencapture -s " --- other OS'es
> will have something similar) and I make a selection. It displays in my org
> buffer, but I can toggle that off with M-x org-toggle-inline-images.
> 
> It really helps in reviewing an article with lots of equations to just clip
> them out as I read and add a few notes.


This looks pretty nice, gives me a lot to think about.  Thank you!

- Carsten

> 
> ===
> 
> You might try
> 
> C-h i org RET C-s image C-s C-s ...
> 
> to look thru the manual and see what it says about images.
> 
> And/Or google 'worg image orgmode'
> 
> 
> HTH,
> 
> 
> 
> 
> 
> 
> 

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

* Re: Carsten's Interview relates questions, esay insert images, attachemnt locations etc..
  2013-03-27  0:47 Carsten's Interview relates questions, esay insert images, attachemnt locations etc zeltak
  2013-03-27  3:52 ` Charles Berry
@ 2013-03-27 13:18 ` Memnon Anon
  1 sibling, 0 replies; 7+ messages in thread
From: Memnon Anon @ 2013-03-27 13:18 UTC (permalink / raw)
  To: emacs-orgmode

zeltak <zeltak@gmail.com> writes:

> one thing that i really found needing in my
> (very) short time using orgmode is an easy way to insert images into
> orgmode (i use that alot in academia). are there any long term plans
> to implement this?

It would help to clarify the usecase you are thinking of.
I am happy with dired and org-store-link so far.

Memnon

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

* Re: Carsten's Interview relates questions, esay insert images, attachemnt locations etc..
  2013-03-27  6:33   ` Carsten Dominik
@ 2013-03-29 20:39     ` Stephen
  0 siblings, 0 replies; 7+ messages in thread
From: Stephen @ 2013-03-29 20:39 UTC (permalink / raw)
  To: emacs-orgmode

On Wed, Mar 27, 2013 at 6:33 AM, Carsten Dominik
<carsten.dominik@gmail.com> wrote:
>
> On 27.3.2013, at 04:52, Charles Berry <ccberry@ucsd.edu> wrote:
>
>> After running that block, I move to my *.org buffer, make sure there is an
>> 'images' directory in M-x pwd RET, make sure I have an image somewhere on my
>> desktop, then move my cursor to where I want a link to an image. C-c p launches
>> the screenshot utility on my Mac ("/usr/sbin/screencapture -s " --- other OS'es
>> will have something similar) and I make a selection. It displays in my org
>> buffer, but I can toggle that off with M-x org-toggle-inline-images.
>>
>> It really helps in reviewing an article with lots of equations to just clip
>> them out as I read and add a few notes.
>
>
> This looks pretty nice, gives me a lot to think about.  Thank you!


To add diagrams while taking notes, how about making babel understand SVG?

- It's just text/xml so it can be embedded right in the org document
- The output of executing svg can be the image, which is natively
supported by emacs
- HTML also natively supports embedded svg

Of course you don't want to doodle by hand-writing xml, so the output
image could be made clickable, which would dump the xml to a tmp file,
open inkscape on it, then re-import it when inkscape exits. The export
defaults for babel svg could be that the src is not exported, but the
result output is.

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

* Re: Carsten's Interview relates questions, esay insert images, attachemnt locations etc..
@ 2013-04-19 17:53 zeltak
  2013-04-20  3:15 ` Charles Berry
  0 siblings, 1 reply; 7+ messages in thread
From: zeltak @ 2013-04-19 17:53 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi Charles and Carsten

sorry for the belated repsonse but i have been tied up at work with other
projects.

So going back to the original question, i have used your example code
Charles and modified it to work on my linux box, though i have zero lisp
(or any other programming) knowledge so im not sure its correct:

;;org screenshot
   (defun paste-clipboard-to-file (&optional filename temp-dir)
     "Take a screenshot using the crosshairs and saveit to FILENAME,if it
is given or to a temp file in the TEMP-DIR
     directory. Then add an orgmode style link at point."
     (interactive)
     (let* ((temporary-file-directory (or temp-dir "images"))
            (fname (or filename (make-temp-file "img" nil ".jpg"))))
       (call-process-shell-command (concat
                                     "/usr/bin/scrot -s -d 2 " fname))
       (insert "\n[[file:" fname "]]")
       (org-display-inline-images)))
   ;;
   (global-set-key (kbd "C-c p") 'paste-clipboard-to-file)


there are still some question i have. the little function seems to work and
i do get an inline image inside org bit it seems to me it only work on the
current window/workspace, is that correct? how can i modify it catch a
screenshot from a web browser, PDF, other workspace etc?

-also can one insert a delete mechanism for files deleted from the inline
buffer (with a confirmation ofc). the reason i ask is because alot of the
times the first 'take' isnt correct and that leaves alot of junk in these
folders that are hard to trace manually

best wishes and thank you all for your help

best

Z

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

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

* Re: Carsten's Interview relates questions, esay insert images, attachemnt locations etc..
  2013-04-19 17:53 zeltak
@ 2013-04-20  3:15 ` Charles Berry
  0 siblings, 0 replies; 7+ messages in thread
From: Charles Berry @ 2013-04-20  3:15 UTC (permalink / raw)
  To: emacs-orgmode

zeltak <zeltak <at> gmail.com> writes:

> 
> Hi Charles and Carsten
> sorry for the belated repsonse but i have been tied up at work with other
projects. 
> 
> So going back to the original question, i have used your example code
Charles and modified it to work on my linux box, though i have zero lisp (or
any other programming) knowledge so im not sure its correct:

[snip code]

If it captures a screenshot in a file and puts a link in your org file,
then it is correct.


> there are still some question i have. the little function seems to work
and i do get an inline image inside org bit it seems to me it only work on
the current window/workspace, is that correct? how can i modify it catch a
screenshot from a web browser, PDF, other workspace etc?
>

This depends on how you navigate your window system, I think.

On Mac OS X Clover-Tab lets me move between open applications without
touching the mouse. When I get to the image I want to capture, I use
the mouse to get the screenshot.

IIRC, on KDE (linux) alt-tab cycles through open applications. I use this
to select text from a terminal window and paste it into emacs (under X11).

If you need the mouse to get to the view you want to capture, I think you
will need some help from outside emacs. You need an application that lets
you navigate a bit to get to the screen you need before setting off the
screenshot. Maybe you can create a shell script that will allow you to 
navigate first, then capture the screenshot before exiting. I do not
know of a way to do this purely within emacs. If you know how to put
that script together, then call the script rather than 'scrot'.


> 
> -also can one insert a delete mechanism for files deleted from the inline
buffer (with a confirmation ofc). the reason i ask is because alot of the
times the first 'take' isnt correct and that leaves alot of junk in these
folders that are hard to trace manually

In principal, you could put a confirmation query in the function, then 
unlink the file if you do not confirm it.

But if elisp is a hurdle, a keyboard macro could do the trick. Figure out 
the keystrokes to navigate to the newest image file, then delete it, then
get back to org. Then capture those keystrokes in a macro, save it, and 
you are good to go. See

http://www.gnu.org/software/emacs/manual/html_node/emacs/
Keyboard-Macros.html
 

HTH,

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

end of thread, other threads:[~2013-04-20  3:15 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-27  0:47 Carsten's Interview relates questions, esay insert images, attachemnt locations etc zeltak
2013-03-27  3:52 ` Charles Berry
2013-03-27  6:33   ` Carsten Dominik
2013-03-29 20:39     ` Stephen
2013-03-27 13:18 ` Memnon Anon
  -- strict thread matches above, loose matches on Subject: below --
2013-04-19 17:53 zeltak
2013-04-20  3:15 ` Charles Berry

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.