* make new links show as figures?
@ 2013-10-23 1:53 John Kitchin
2013-10-23 13:54 ` Rick Frankel
0 siblings, 1 reply; 16+ messages in thread
From: John Kitchin @ 2013-10-23 1:53 UTC (permalink / raw)
To: emacs-orgmode@gnu.org
[-- Attachment #1: Type: text/plain, Size: 464 bytes --]
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.
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
[-- Attachment #2: Type: text/html, Size: 720 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make new links show as figures?
2013-10-23 1:53 make new links show as figures? John Kitchin
@ 2013-10-23 13:54 ` Rick Frankel
2013-10-24 7:28 ` Alan Schmitt
0 siblings, 1 reply; 16+ messages in thread
From: Rick Frankel @ 2013-10-23 13:54 UTC (permalink / raw)
To: John Kitchin; +Cc: emacs-orgmode
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.
Wouldn't a better way be to define =chemdraw= as a babel language?
ob-plantuml, ob-dot and ob-mscgen are all examples of babel languages
which generate images.
rick
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make new links show as figures?
2013-10-23 13:54 ` Rick Frankel
@ 2013-10-24 7:28 ` Alan Schmitt
2013-10-24 10:08 ` Carsten Dominik
0 siblings, 1 reply; 16+ messages in thread
From: Alan Schmitt @ 2013-10-24 7:28 UTC (permalink / raw)
To: Rick Frankel; +Cc: emacs-orgmode, John Kitchin
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.
>
> Wouldn't a better way be to define =chemdraw= as a babel language?
>
> ob-plantuml, ob-dot and ob-mscgen are all examples of babel languages
> which generate images.
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.
Alan
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make new links show as figures?
2013-10-24 7:28 ` Alan Schmitt
@ 2013-10-24 10:08 ` Carsten Dominik
2013-10-24 13:45 ` Rick Frankel
` (2 more replies)
0 siblings, 3 replies; 16+ messages in thread
From: Carsten Dominik @ 2013-10-24 10:08 UTC (permalink / raw)
To: Alan Schmitt; +Cc: Rick Frankel, emacs-orgmode, John Kitchin
On 24.10.2013, at 09:28, Alan Schmitt <alan.schmitt@polytechnique.org> 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.
>>
>> Wouldn't a better way be to define =chemdraw= as a babel language?
>>
>> ob-plantuml, ob-dot and ob-mscgen are all examples of babel languages
>> which generate images.
>
> 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
>
> Alan
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make new links show as figures?
2013-10-24 10:08 ` Carsten Dominik
@ 2013-10-24 13:45 ` Rick Frankel
2013-10-24 21:48 ` John Kitchin
2013-10-24 23:41 ` Rick Frankel
2013-10-25 1:18 ` Rick Frankel
2 siblings, 1 reply; 16+ messages in thread
From: Rick Frankel @ 2013-10-24 13:45 UTC (permalink / raw)
To: Carsten Dominik; +Cc: Alan Schmitt, emacs-orgmode, John Kitchin
On 2013-10-24 06:08, Carsten Dominik wrote:
> On 24.10.2013, at 09:28, Alan Schmitt <alan.schmitt@polytechnique.org>
> 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
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make new links show as figures?
2013-10-24 13:45 ` Rick Frankel
@ 2013-10-24 21:48 ` John Kitchin
2013-10-25 16:49 ` Rick Frankel
0 siblings, 1 reply; 16+ messages in thread
From: John Kitchin @ 2013-10-24 21:48 UTC (permalink / raw)
To: Rick Frankel; +Cc: Alan Schmitt, emacs-orgmode@gnu.org, Carsten Dominik
[-- Attachment #1: Type: text/plain, Size: 4370 bytes --]
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 <rick@rickster.com> wrote:
> On 2013-10-24 06:08, Carsten Dominik wrote:
>
>> On 24.10.2013, at 09:28, Alan Schmitt <alan.schmitt@polytechnique.**org<alan.schmitt@polytechnique.org>>
>> 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<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
>
[-- Attachment #2: Type: text/html, Size: 5448 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make new links show as figures?
2013-10-24 10:08 ` Carsten Dominik
2013-10-24 13:45 ` Rick Frankel
@ 2013-10-24 23:41 ` Rick Frankel
2013-10-25 1:18 ` Rick Frankel
2 siblings, 0 replies; 16+ messages in thread
From: Rick Frankel @ 2013-10-24 23:41 UTC (permalink / raw)
To: Carsten Dominik; +Cc: Alan Schmitt, emacs-orgmode, John Kitchin
Carsten-
On 2013-10-24 06:08, Carsten Dominik wrote:
> On 24.10.2013, at 09:28, Alan Schmitt <alan.schmitt@polytechnique.org> wrote:
> 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.
I agree, expanding images in the link description per the mentioned posting makes sense.
Do you think inlining images in the description
In terms of implementation of this, and inlining
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make new links show as figures?
2013-10-24 10:08 ` Carsten Dominik
2013-10-24 13:45 ` Rick Frankel
2013-10-24 23:41 ` Rick Frankel
@ 2013-10-25 1:18 ` Rick Frankel
2 siblings, 0 replies; 16+ messages in thread
From: Rick Frankel @ 2013-10-25 1:18 UTC (permalink / raw)
To: Carsten Dominik; +Cc: Alan Schmitt, emacs-orgmode, John Kitchin
Carsten-
On 2013-10-24 06:08, Carsten Dominik wrote:
> On 24.10.2013, at 09:28, Alan Schmitt <alan.schmitt@polytechnique.org> wrote:
> 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.
I agree, expanding images in the link description per the mentioned posting makes sense.
Do you think inlining images in the description
In terms of implementation of this, and inlining
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make new links show as figures?
2013-10-24 21:48 ` John Kitchin
@ 2013-10-25 16:49 ` Rick Frankel
2013-10-26 12:10 ` John Kitchin
0 siblings, 1 reply; 16+ messages in thread
From: Rick Frankel @ 2013-10-25 16:49 UTC (permalink / raw)
To: John Kitchin; +Cc: Alan Schmitt, emacs-orgmode, Carsten Dominik
On 2013-10-24 17:48, John Kitchin wrote:
> 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.
Sorry, not familiar w/ chemdraw and you had originally mentioned that
you wanted clicking the link to open it in emacs.
> [[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.
I realize that. I offered this approach as an alternative, as I
believe I can add the functionality to expand inline images in the
description portion, but i don't see a way to make the link portion
accept "aliases" for the file: protocol without major changes to link
handling. Even then, it seems a bit like a hack.
> [many use cases omitted]
> Those are what I was thinking about for using other links as images.
Other than having to repeat yourself, wouldn't the
[[custom:file.ext][file:file.png]] syntax allow for most/all of the
use cases mentioned?
rick
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make new links show as figures?
2013-10-25 16:49 ` Rick Frankel
@ 2013-10-26 12:10 ` John Kitchin
2013-10-30 16:02 ` Rick Frankel
0 siblings, 1 reply; 16+ messages in thread
From: John Kitchin @ 2013-10-26 12:10 UTC (permalink / raw)
To: Rick Frankel; +Cc: Alan Schmitt, emacs-orgmode@gnu.org, Carsten Dominik
[-- Attachment #1: Type: text/plain, Size: 676 bytes --]
I realize that. I offered this approach as an alternative, as I
> believe I can add the functionality to expand inline images in the
> description portion, but i don't see a way to make the link portion
> accept "aliases" for the file: protocol without major changes to link
> handling. Even then, it seems a bit like a hack.
>
> [many use cases omitted]
>>
>
> Those are what I was thinking about for using other links as images.
>>
>
> Other than having to repeat yourself, wouldn't the
> [[custom:file.ext][file:file.**png]] syntax allow for most/all of the
> use cases mentioned?
>
> rick
>
Yes, I think [[custom:file.ext][file:file.png]] would cover all those cases.
[-- Attachment #2: Type: text/html, Size: 1333 bytes --]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make new links show as figures?
2013-10-26 12:10 ` John Kitchin
@ 2013-10-30 16:02 ` Rick Frankel
2013-10-31 10:04 ` Alan Schmitt
0 siblings, 1 reply; 16+ messages in thread
From: Rick Frankel @ 2013-10-30 16:02 UTC (permalink / raw)
To: John Kitchin; +Cc: Alan Schmitt, emacs-orgmode, Carsten Dominik
On 2013-10-26 08:10, John Kitchin wrote:
> Other than having to repeat yourself, wouldn't the
> [[custom:file.ext][file:file.png]] syntax allow for most/all of the
> use cases mentioned?
>
> rick
>
> Yes, I think [[custom:file.ext][file:file.png]] would cover all
> those cases.
So it turns out that this is a REALLY simple patch (two characters):
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -18853,7 +18853,7 @@ BEG and END default to the buffer boundaries."
(widen)
(setq beg (or beg (point-min)) end (or end (point-max)))
(goto-char beg)
- (let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
+ (let ((re (concat
"\\[.*\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
(substring (org-image-file-name-regexp) 0 -2)
"\\)\\]" (if include-linked "" "\\]")))
(case-fold-search t)
This seems to work in all cases I can think of (see test file below).
Let me know if this works for you and i will apply to master when i
get home and have git push access.
rick
--------- 8< --------------------
* Setup (babel me)
#+BEGIN_SRC dot :file "image1.png"
digraph { one }
#+END_SRC
#+BEGIN_SRC sh
echo "digraph { one }" > image1.dot
#+END_SRC
#+RESULTS:
[[file:image1.png]]
#+BEGIN_SRC dot :file "image2.png"
digraph { two }
#+END_SRC
#+RESULTS:
[[file:image2.png]]
* Tests
** file link
- with path (=./=)
[[file:./image1.png]]
- without path
[[file:image1.png]]
** no uri link
- with path ( =./=)
[[./image1.png]]
- without path (this does not expand as an image)
[[image1.png]]
** with description
Note: this does not expand as an image unless
`org-display-inline-images' is called with =include-linked= true.
[[file:./image1.png][an image]]
** image in description
[[./image1.dot][./image1.png]]
** in both
This will always display the image in the description regardless of
the value of the =include-linked= argument to
`org-display-inline-images' (but open the image in the link).
[[./image1.png][./image2.png]]
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make new links show as figures?
2013-10-30 16:02 ` Rick Frankel
@ 2013-10-31 10:04 ` Alan Schmitt
2013-10-31 15:47 ` Rick Frankel
0 siblings, 1 reply; 16+ messages in thread
From: Alan Schmitt @ 2013-10-31 10:04 UTC (permalink / raw)
To: Rick Frankel; +Cc: Carsten Dominik, emacs-orgmode, John Kitchin
rick@rickster.com writes:
> On 2013-10-26 08:10, John Kitchin wrote:
>> Other than having to repeat yourself, wouldn't the
>> [[custom:file.ext][file:file.png]] syntax allow for most/all of the
>> use cases mentioned?
>>
>> rick
>>
>> Yes, I think [[custom:file.ext][file:file.png]] would cover all
>> those cases.
>
> So it turns out that this is a REALLY simple patch (two characters):
>
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -18853,7 +18853,7 @@ BEG and END default to the buffer boundaries."
> (widen)
> (setq beg (or beg (point-min)) end (or end (point-max)))
> (goto-char beg)
> - (let ((re (concat "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
> + (let ((re (concat
> "\\[.*\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
> (substring (org-image-file-name-regexp) 0 -2)
> "\\)\\]" (if include-linked "" "\\]")))
> (case-fold-search t)
>
> This seems to work in all cases I can think of (see test file below).
> Let me know if this works for you and i will apply to master when i
> get home and have git push access.
I tried it on some files with images as links, and it works
great. Thanks a lot!
Alan
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make new links show as figures?
2013-10-31 10:04 ` Alan Schmitt
@ 2013-10-31 15:47 ` Rick Frankel
2013-10-31 16:20 ` Cook, Malcolm
2013-10-31 17:06 ` Alan Schmitt
0 siblings, 2 replies; 16+ messages in thread
From: Rick Frankel @ 2013-10-31 15:47 UTC (permalink / raw)
To: Alan Schmitt; +Cc: John Kitchin, emacs-orgmode, Carsten Dominik
On 2013-10-31 06:04, Alan Schmitt wrote:
> rick@rickster.com writes:
>
> So it turns out that this is a REALLY simple patch (two characters):
>
> +++ b/lisp/org.el
> @@ -18853,7 +18853,7 @@ BEG and END default to the buffer boundaries."
> (widen)
> (setq beg (or beg (point-min)) end (or end (point-max)))
> (goto-char beg)
> - (let ((re (concat
> "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
> + (let ((re (concat
> "\\[.*\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
> (substring (org-image-file-name-regexp) 0 -2)
> "\\)\\]" (if include-linked "" "\\]")))
> (case-fold-search t)
>
> This seems to work in all cases I can think of (see test file below).
> Let me know if this works for you and i will apply to master when i
> get home and have git push access.
>
> I tried it on some files with images as links, and it works
> great. Thanks a lot!
So, I've done some testing of the export functions (html and latex
only) and found the following behaviors with this patch:
- HTML
- image in description only displayed if the protocol (file:) is
included.
- LaTeX
- same, required file: protocol in description
- additionally, pdflatex \includgraphics barfs on any path w/ a
=./= path prefix -- this is true for the current implmenation as
well.
Changing the regexp for in-buffer image expansion to mimic the export
behavior is difficult at best. I think the inconsistency is
acceptable, and I will documentment the behavior in the
`org-display-inline-images' docstring.
The latex breakage on paths beginning with =./= should perhaps be
addressed in the latex exporter, but this is orthogonal to the
current issue.
If there is no objection, I will push a fix tonight or tomorrow.
rick
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make new links show as figures?
2013-10-31 15:47 ` Rick Frankel
@ 2013-10-31 16:20 ` Cook, Malcolm
2013-10-31 16:55 ` Rick Frankel
2013-10-31 17:06 ` Alan Schmitt
1 sibling, 1 reply; 16+ messages in thread
From: Cook, Malcolm @ 2013-10-31 16:20 UTC (permalink / raw)
To: 'Rick Frankel', 'Alan Schmitt'
Cc: 'Carsten Dominik', 'emacs-orgmode@gnu.org',
'John Kitchin'
>>
>> So it turns out that this is a REALLY simple patch (two characters):
>>
>> +++ b/lisp/org.el
>> @@ -18853,7 +18853,7 @@ BEG and END default to the buffer boundaries."
>> (widen)
>> (setq beg (or beg (point-min)) end (or end (point-max)))
>> (goto-char beg)
>> - (let ((re (concat
>> "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
>> + (let ((re (concat
>> "\\[.*\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
>> (substring (org-image-file-name-regexp) 0 -2)
>> "\\)\\]" (if include-linked "" "\\]")))
>> (case-fold-search t)
>>
>> This seems to work in all cases I can think of (see test file below).
>> Let me know if this works for you and i will apply to master when i
>> get home and have git push access.
>>
>> I tried it on some files with images as links, and it works
>> great. Thanks a lot!
[Cook, Malcolm]
Hi - I'm trying to follow this thread but having a challenge. Can you please summarize/repeat the original intended effect of this change....
~Malcolm
>
>So, I've done some testing of the export functions (html and latex
>only) and found the following behaviors with this patch:
>
>- HTML
>- image in description only displayed if the protocol (file:) is
>included.
>- LaTeX
>- same, required file: protocol in description
>- additionally, pdflatex \includgraphics barfs on any path w/ a
>=./= path prefix -- this is true for the current implmenation as
>well.
>
>Changing the regexp for in-buffer image expansion to mimic the export
>behavior is difficult at best. I think the inconsistency is
>acceptable, and I will documentment the behavior in the
>`org-display-inline-images' docstring.
>
>The latex breakage on paths beginning with =./= should perhaps be
>addressed in the latex exporter, but this is orthogonal to the
>current issue.
>
>If there is no objection, I will push a fix tonight or tomorrow.
>
>rick
>
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make new links show as figures?
2013-10-31 16:20 ` Cook, Malcolm
@ 2013-10-31 16:55 ` Rick Frankel
0 siblings, 0 replies; 16+ messages in thread
From: Rick Frankel @ 2013-10-31 16:55 UTC (permalink / raw)
To: emacs-orgmode
On 2013-10-31 12:20, Cook, Malcolm wrote:
>
> >> So it turns out that this is a REALLY simple patch (two characters):
> >>
> >> +++ b/lisp/org.el
> >> @@ -18853,7 +18853,7 @@ BEG and END default to the buffer
> boundaries."
> >> (widen)
> >> (setq beg (or beg (point-min)) end (or end (point-max)))
> >> (goto-char beg)
> >> - (let ((re (concat
> >> "\\[\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
> >> + (let ((re (concat
> >> "\\[.*\\[\\(\\(file:\\)\\|\\([./~]\\)\\)\\([^]\n]+?"
> >> (substring (org-image-file-name-regexp) 0 -2)
> >> "\\)\\]" (if include-linked "" "\\]")))
> >> (case-fold-search t)
> >>
> >> This seems to work in all cases I can think of (see test file
> below).
> >> Let me know if this works for you and i will apply to master when i
> >> get home and have git push access.
> >>
> >> I tried it on some files with images as links, and it works
> >> great. Thanks a lot!
> [Cook, Malcolm]
>
> Hi - I'm trying to follow this thread but having a challenge. Can you
> please summarize/repeat the original intended effect of this
> change....
To make images in link descriptions (e.g, [[file.dot][file.png]]
displayed inline rather than showing the text ("file.png")
>
> >
> >So, I've done some testing of the export functions (html and latex
> >only) and found the following behaviors with this patch:
> >
> >- HTML
> >- image in description only displayed if the protocol (file:) is
> >included.
> >- LaTeX
> >- same, required file: protocol in description
> >- additionally, pdflatex \includgraphics barfs on any path w/ a
> >=./= path prefix -- this is true for the current implmenation as
> >well.
> >
> >Changing the regexp for in-buffer image expansion to mimic the export
> >behavior is difficult at best. I think the inconsistency is
> >acceptable, and I will documentment the behavior in the
> >`org-display-inline-images' docstring.
> >
> >The latex breakage on paths beginning with =./= should perhaps be
> >addressed in the latex exporter, but this is orthogonal to the
> >current issue.
> >
> >If there is no objection, I will push a fix tonight or tomorrow.
> >
> >rick
> >
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: make new links show as figures?
2013-10-31 15:47 ` Rick Frankel
2013-10-31 16:20 ` Cook, Malcolm
@ 2013-10-31 17:06 ` Alan Schmitt
1 sibling, 0 replies; 16+ messages in thread
From: Alan Schmitt @ 2013-10-31 17:06 UTC (permalink / raw)
To: Rick Frankel; +Cc: John Kitchin, emacs-orgmode, Carsten Dominik
rick@rickster.com writes:
> So, I've done some testing of the export functions (html and latex
> only) and found the following behaviors with this patch:
>
> - HTML
> - image in description only displayed if the protocol (file:) is
> included.
> - LaTeX
> - same, required file: protocol in description
> - additionally, pdflatex \includgraphics barfs on any path w/ a
> =./= path prefix -- this is true for the current implmenation as
> well.
>
> Changing the regexp for in-buffer image expansion to mimic the export
> behavior is difficult at best. I think the inconsistency is
> acceptable, and I will documentment the behavior in the
> `org-display-inline-images' docstring.
Consistency would be nice, but then we might start asking for more, such
as following attr_html attributes (width, for instance). It's very
useful like this, to check before exporting that the link to the
expected image is indeed correct.
Thanks,
Alan
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2013-10-31 17:06 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-10-23 1:53 make new links show as figures? John Kitchin
2013-10-23 13:54 ` Rick Frankel
2013-10-24 7:28 ` Alan Schmitt
2013-10-24 10:08 ` Carsten Dominik
2013-10-24 13:45 ` Rick Frankel
2013-10-24 21:48 ` John Kitchin
2013-10-25 16:49 ` Rick Frankel
2013-10-26 12:10 ` John Kitchin
2013-10-30 16:02 ` Rick Frankel
2013-10-31 10:04 ` Alan Schmitt
2013-10-31 15:47 ` Rick Frankel
2013-10-31 16:20 ` Cook, Malcolm
2013-10-31 16:55 ` Rick Frankel
2013-10-31 17:06 ` Alan Schmitt
2013-10-24 23:41 ` Rick Frankel
2013-10-25 1:18 ` 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).