From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Martins Subject: Re: Re: Wow -- adding images to an org file Date: Sun, 9 May 2010 12:05:56 -0300 Message-ID: References: <4648D225-BC59-4DB3-8D5B-DD50CD0E05C5@gmail.com> <874oijhnqs.fsf@stats.ox.ac.uk> <4F5FF1A6-BE60-4CC1-9D54-6D32D0FC2EDA@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1201918893==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1OB84w-00033n-Dt for emacs-orgmode@gnu.org; Sun, 09 May 2010 11:06:02 -0400 Received: from [140.186.70.92] (port=35516 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OB84t-00033R-SA for emacs-orgmode@gnu.org; Sun, 09 May 2010 11:06:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OB84r-0002dk-K0 for emacs-orgmode@gnu.org; Sun, 09 May 2010 11:05:59 -0400 Received: from mail-pv0-f169.google.com ([74.125.83.169]:33021) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OB84r-0002dX-8F for emacs-orgmode@gnu.org; Sun, 09 May 2010 11:05:57 -0400 Received: by pvg16 with SMTP id 16so544007pvg.0 for ; Sun, 09 May 2010 08:05:56 -0700 (PDT) In-Reply-To: <4F5FF1A6-BE60-4CC1-9D54-6D32D0FC2EDA@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: Dan Davison , Chris Thompson , emacs-orgmode@gnu.org --===============1201918893== Content-Type: multipart/alternative; boundary=0016e64dd78a174cef04862aa10b --0016e64dd78a174cef04862aa10b Content-Type: text/plain; charset=ISO-8859-1 In short What I have to do (minimal code in .emacs and .org) to display an image? This image will be maintained when I export the file? iimage could be included in org distribution? Daniel 2010/5/8 Carsten Dominik > > On May 7, 2010, at 2:58 PM, Dan Davison wrote: > > Carsten Dominik writes: >> >> On May 7, 2010, at 4:16 AM, Chris Thompson wrote: >>> >>> Nathan Neff gmail.com> writes: >>>> >>>> >>>>> I just saw Andreas's screenshot here: >>>>> >>>>> http://orgmode.org/worg/org-screenshots.php >>>>> >>>>> If you zoom in to his screenshot, >>>>> http://orgmode.org/img/screenshots/org_andreas.jpg >>>>> >>>>> You can see how he adds images to his org files. >>>>> All that I had to do was put this into my emacs init file: >>>>> >>>>> (defun org-dblock-write:image (params) >>>>> (let ((file (plist-get params :file))) >>>>> (clear-image-cache file) >>>>> (insert-image (create-image file) ))) >>>>> >>>>> Then, put this in an org-file: >>>>> >>>>> #+BEGIN: image :file "~/Documents/personal/foo.png" >>>>> #+END >>>>> >>>>> And run C-c C-c (or is it C-c C-x C-u)? >>>>> >>>>> Anyway, Cool stuff! >>>>> >>>>> --Nate >>>>> >>>>> >>>> >>>> Another way to have images in org-mode documents is to use the >>>> "iimage" >>>> minor mode, which handles inline images: >>>> http://www.netlaputa.ne.jp/~kose/Emacs/iimage.html >>>> >>>> For additional documentation: >>>> http://orgmode.org/worg/org-configs/org-config-examples.php#sec-2_2 >>>> >>> >>> At that place, I find this code: >>> (add-to-list 'iimage-mode-image-regex-alist (cons (concat >>> "\\[\\[file:\ >>> \(~?" iimage-mode-image-filename-regex "\\)\\]") 1)) >>> (defun org-toggle-iimage-in-org () "display images in your org file" >>> (interactive) (if (face-underline-p 'org-link) (set-face- >>> underline-p 'org-link nil) (set-face-underline-p 'org-link t)) >>> (iimage- >>> mode)) >>> I guess I could actually add the above code to org.el, so that the >>> only thing to do for a user would be to turn on iimage-mode. >>> What is the purpose of toggling the underline property of the link face? >>> >> >> It puts a horizontal line through the middle of the displayed image >> (haven't checked if that's fixed in latest emacs). >> > > I see. > > We have now native inline image display in Org-mode, you can toggle it with > > C-c C-x C-v > > This implementation uses overlays instead of text properties and therefore > does not interfere with font-lock. > > > - Carsten > > > > _______________________________________________ > Emacs-orgmode mailing list > Please use `Reply All' to send replies to the list. > Emacs-orgmode@gnu.org > http://lists.gnu.org/mailman/listinfo/emacs-orgmode > --0016e64dd78a174cef04862aa10b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable In short

What I have to do (minimal code in .emacs and .org) to disp= lay an image?


This image will be maintained when I export the fi= le?

iimage could be included in org distribution?



Daniel


2010/5/8 Carsten Dominik <carsten.domin= ik@gmail.com>

On May 7, 2010, at 2:58 PM, Dan Davison wrote:

Carsten Dominik <carsten.dominik@gmail.com> writes:

On May 7, 2010, at 4:16 AM, Chris Thompson wrote:

Nathan Neff <nathan.neff <at> gmail.com> writes:


I just saw Andreas's screenshot here:

h= ttp://orgmode.org/worg/org-screenshots.php

If you zoom in to his screenshot,
http://orgmode.org/img/screenshots/org_andreas.jpg

You can see how he adds images to his org files.
All that I had to do was put this into my emacs init file:

(defun org-dblock-write:image (params)
(let ((file (plist-get params :file)))
=A0 (clear-image-cache file)
=A0 (insert-image (create-image file) )))

Then, put this in an org-file:

#+BEGIN: image :file "~/Documents/personal/foo.png"
#+END

And run C-c C-c (or is it C-c C-x C-u)?

Anyway, Cool stuff!

--Nate



Another way to have images in org-mode documents is to use the
"iimage"
minor mode, which handles =A0inline images:
http://www.netlaputa.ne.jp/~kose/Emacs/iimage.html

For additional documentation:
http://orgmode.org/worg/org-configs/org-config-examp= les.php#sec-2_2

At that place, I find this code:
(add-to-list 'iimage-mode-image-regex-alist (cons (concat
"\\[\\[file:\
\(~?" iimage-mode-image-filename-regex "\\)\\]") 1))
(defun org-toggle-iimage-in-org () "display images in your org file&qu= ot;
(interactive) (if (face-underline-p 'org-link) (set-face-
underline-p 'org-link nil) (set-face-underline-p 'org-link t))
(iimage-
mode))
I guess I could actually add the above code to org.el, so that the
only thing to do for a user would be to turn on iimage-mode.
What is the purpose of toggling the underline property of the link face?

It puts a horizontal line through the middle of the displayed image
(haven't checked if that's fixed in latest emacs).

I see.

We have now native inline image display in Org-mode, you can toggle it with=

C-c C-x C-v

This implementation uses overlays instead of text properties and therefore = does not interfere with font-lock.


- Carsten



_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gn= u.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

--0016e64dd78a174cef04862aa10b-- --===============1201918893== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1201918893==--