From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: make new links show as figures? Date: Thu, 24 Oct 2013 17:48:38 -0400 Message-ID: References: <20c923d8f003b0f570dad32bfb8adcbd@mail.rickster.com> <57E3D773-303E-4E29-AACE-A0D7C78C7F01@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8ff1c372b07f7004e983988b Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41164) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZSlm-0005Qw-Cn for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 17:48:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VZSlk-00070f-L2 for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 17:48:42 -0400 Received: from mail-pb0-x235.google.com ([2607:f8b0:400e:c01::235]:58127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VZSlk-000704-2P for emacs-orgmode@gnu.org; Thu, 24 Oct 2013 17:48:40 -0400 Received: by mail-pb0-f53.google.com with SMTP id up7so2641259pbc.40 for ; Thu, 24 Oct 2013 14:48:38 -0700 (PDT) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Rick Frankel Cc: Alan Schmitt , "emacs-orgmode@gnu.org" , Carsten Dominik --e89a8ff1c372b07f7004e983988b Content-Type: text/plain; charset=ISO-8859-1 I don't think making chemdraw a babel language is the answer here. The way I know chemdraw is as a standalone binary executable that is all gui. there is no scripting. maybe you could build an xml file by hand, but i would never dream of that! maybe I am missing how you would use it. [[chemdraw:file.cdxml][file:file.png]] Is pretty close to what I had in mind. I would define the link click function to just strip off the png, and open the file.cdxml for example, then you do not need both of those pieces. I suppose this means you would have had to export the file as a new png after editing it to make a change though. The real examples I had in mind were some clean way to integrate emacs with my tablet and drawing pictures that are inline in a buffer. Clicking on the link would open the image in my tablet drawing program, where I would draw on it with a pen, and then save the figure. this is not all images though, just some. Hence the differentiation by a different link. In my course notes, I often have hand-drawn pictures in them. Right now I go through a somewhat annoying process of drawing in powerpoint, selecting the drawing and right clicking to save as an image, which I then put in as a link. I havent had time to find a much better solution. A link could save me some of that hassle, except that the link doesn't show in the buffer as an inline image. I also wanted a "figure" link that would export different ways. For example in html export it would export as html, for latex as eps, and for pdflatex as pdf, but it would show inline in some supported format. I know I can use filters to do that on export to replace or remove extensions, but I haven't had time to write one, and I thought a link would be a nice alternative. We typically make all three versions (png, eps, pdf) of figures, and put the png files in org so they show inline, but we often have to switch them out to one of the other formats at the end for manuscript submission. A link like figure:filename that would somehow show inline if a filename.png existed would solve this problem. Those are what I was thinking about for using other links as images. j John ----------------------------------- John Kitchin Associate Professor Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 http://kitchingroup.cheme.cmu.edu On Thu, Oct 24, 2013 at 9:45 AM, Rick Frankel wrote: > On 2013-10-24 06:08, Carsten Dominik wrote: > >> On 24.10.2013, at 09:28, Alan Schmitt > >> wrote: >> >> Hi Rick and John, >> >> rick@rickster.com writes: >> >> On 2013-10-22 21:53, John Kitchin wrote: >> Is it possible to define new links that would be rendered as inline >> images? >> >> I am imagining something like >> >> chemdraw:benzene.png >> >> which would show the benzene.png file inline, but when I click on it >> would open a chemdraw file for editing. >> >> unfortunately, it seems that `org-display-inline-images' has a >> hardcoded regex which searches only for =file:= links. >> >> This may be related to a question I had a couple weeks ago (see >> http://article.gmane.org/**gmane.emacs.orgmode/77567). >> The current logic >> seems to be to display inline images when the link points to an image, >> it would be great to extend it when the description, or part of the >> link, points to an image. >> >> Indeed, currently this is not possible. I would be interested to get >> a patch to this effect. >> > > Carsten- > > In terms of inlining images in the description portion per the linked > posting, do you think that it should depended on the value if the > =include-linked= argument? (IMHO no, since the default usage of > `org-display-inline-images' doesn't set this argument). I would be > glad to take a stab at this enhancement. > > John- > In reviewing `org-display-inline-images', and the handling of org > links in general, i see no safe (and not overly complex) way of making > added link types expand inline images. In the case mentioned, i still > feel that adding chemdraw as a babel language is the correct approach. > However, if we add the expansion of images in the description, would > that work: > > [[chemdraw:file.cdxml][file:**file.png]] > > rick > --e89a8ff1c372b07f7004e983988b Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I don't think making chemdraw a ba= bel language is the answer here. The way I know chemdraw is as a standalone= binary executable that is all gui. there is no scripting. maybe you could = build an xml file by hand, but i would never dream of that! maybe I am miss= ing how you would use it.

[[chemdraw:file.cdxml][file:file.png]]

Is pretty close to what= I had in mind. I would define the link click function to just strip off th= e png, and open the file.cdxml for example, then you do not need both of th= ose pieces. I suppose this means you would have had to export the file as a= new png after editing it to make a change though.

The real examples I had in mind were some clean way to integrate = emacs with my tablet and drawing pictures that are inline in a buffer. Clic= king on the link would open the image in my tablet drawing program, where I= would draw on it with a pen, and then save the figure. this is not all ima= ges though, just some. Hence the differentiation by a different link. In my= course notes, I often have hand-drawn pictures in them. Right now I go thr= ough a somewhat annoying process of drawing in powerpoint, selecting the dr= awing and right clicking to save as an image, which I then put in as a link= . I havent had time to find a much better solution. A link could save me so= me of that hassle, except that the link doesn't show in the buffer as a= n inline image.

I also wanted a "figure" link that would export differe= nt ways. For example in html export it would export as html, for latex as e= ps, and for pdflatex as pdf, but it would show inline in some supported for= mat. I know I can use filters to do that on export to replace or remove ext= ensions, but I haven't had time to write one, and I thought a link woul= d be a nice alternative. We typically make all three versions (png, eps, pd= f) of figures, and put the png files in org so they show inline, but we oft= en have to switch them out to one of the other formats at the end for manus= cript submission. A link like figure:filename=A0 that would somehow show in= line if a filename.png existed would solve this problem.

Those are what I was thinking about for using other links as imag= es.

j


John

-----------------------------------
John Kitch= in
Associate Professor
Doherty Hall A207F
Department of Chemical Enginee= ring
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803<= br>http://k= itchingroup.cheme.cmu.edu



On Thu, Oct 24, 2013 at 9:45 AM, Rick Fr= ankel <rick@rickster.com> wrote:
On 2013-10-24 06:08, Carsten Dominik wrote:
This may be related to a question I had a couple weeks ago (see
http://article.gmane.org/gmane.emacs.orgmode/77567). The c= urrent logic
seems to be to display inline images when the link points to an image,
it would be great to extend it when the description, or part of the
link, points to an image.

Indeed, currently this is not possible. =A0I would be interested to get
a patch to this effect.

Carsten-

In terms of inlining images in the description portion per the linked
posting, do you think that it should depended on the value if the
=3Dinclude-linked=3D argument? (IMHO no, since the default usage of
`org-display-inline-images' doesn't set this argument). I would be<= br> glad to take a stab at this enhancement.

John-
In reviewing `org-display-inline-images', and the handling of org
links in general, i see no safe (and not overly complex) way of making
added link types expand inline images. In the case mentioned, i still
feel that adding chemdraw as a babel language is the correct approach.
However, if we add the expansion of images in the description, would
that work:

[[chemdraw:file.cdxml][file:file.png]]

rick

--e89a8ff1c372b07f7004e983988b--