From mboxrd@z Thu Jan 1 00:00:00 1970 From: "numbchild@gmail.com" Subject: make ox-publish generate result figure image link path to relative instead of absolute full path Date: Sun, 24 Apr 2016 19:25:53 +0800 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11490da868ecdb05313954b8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47041) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auIBI-0001AP-4R for emacs-orgmode@gnu.org; Sun, 24 Apr 2016 07:26:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1auIBD-0002zp-CV for emacs-orgmode@gnu.org; Sun, 24 Apr 2016 07:26:28 -0400 Received: from mail-yw0-x236.google.com ([2607:f8b0:4002:c05::236]:35669) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1auIBD-0002zk-6T for emacs-orgmode@gnu.org; Sun, 24 Apr 2016 07:26:23 -0400 Received: by mail-yw0-x236.google.com with SMTP id g133so143405273ywb.2 for ; Sun, 24 Apr 2016 04:26:22 -0700 (PDT) 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" To: Org-mode --001a11490da868ecdb05313954b8 Content-Type: text/plain; charset=UTF-8 I want babel can generate a figure image which path is relative to current directory instead of full path. Here is the org-mode buffer example which use `:dir "data/images"` as default directory for executing code: ``` #+BEGIN_SRC gnuplot :session none :results graphics :dir "data/images" :file "org-babel-plot-test.png" set term png set output 'org-babel-plot-test.png' set grid plot sin(x) #+END_SRC #+RESULTS: [[file:/home/stardiviner/Org/Blog/org-publish/Blog/data/images/org-babel-plot-test.png]] ``` And here is another example which use current directory for save figure image: ``` #+BEGIN_SRC gnuplot :session none :results graphics :file "org-babel-plot-test.png" set term png set output 'org-babel-plot-test.png' set grid plot sin(x) #+END_SRC #+RESULTS: [[file:org-babel-plot-test.png]] ``` What I want: - result figure image can display as inline image. - result figure image also can work in remote server. (like the first example, `ox-publish` exported HTML link is local resource link like `file:///home/USER/....png`) Is there a way to change babel generate figure image result path to be like option `org-link-file-path-type` can set to `adaptive`. - I think org-mode should improve on this. - If somebody can provide an adivce, that is good too for a solution to use for now. [stardiviner] GPG key ID: 47C32433 IRC(freeenode): stardiviner Twitter: @numbchild Key fingerprint = 9BAA 92BC CDDD B9EF 3B36 CB99 B8C4 B8E5 47C3 2433 Blog: http://stardiviner.github.io/ --001a11490da868ecdb05313954b8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
I want babel can generate a figure image which p= ath is relative to current directory instead of full path.
=
Here is the org-mode buffer example which use `:dir &qu= ot;data/images"` as default directory for executing code:


```
= #+BEGIN_SRC gnuplot :session none :results graphics :dir "data/images&= quot; :file "org-babel-plot-test.png"
set term png
se= t output 'org-babel-plot-test.png'

set grid=
=
plot sin(x)
#+END_SRC

#+RESULTS:
[[file:/home/stardiviner/Org/Blog/org-publish/Blog/data/images/org-babel-p= lot-test.png]]
```

And here is another example which use current directory for save figure= image:
<= br>
```
#+BEGIN_SRC gnuplot := session none :results graphics :file "org-babel-plot-test.png"
set term png<= /div>
set output 'org-babel= -plot-test.png'
set grid

plot sin(x)
#+END_SRC

#+RESULTS:
[[file:org-babel-plot-test.png]]
```

What I want:
- result figure image can display= as inline image.
- result figure image also can work in remote server. (like the fi= rst example, `ox-publish` exported HTML link is local resource link like `f= ile:///home/USER/....png`)

Is there a way to change babel generate figure image result p= ath to be like option `org-link-file-path-type` can set to `adaptive`.

- I think org-mod= e should improve on this.
- If somebody can provide an adivce, that is good too for = a solution to use for now.

[stardiviner]= =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 <Hack this = world!>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 GPG key ID: 47C32433
IRC(freeen= ode): stardiviner =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 Twitter:=C2=A0 @n= umbchild
Key fingerprint =3D 9BAA 92BC CDDD B9EF 3B36=C2=A0 CB99 B8C4 B8= E5 47C3 2433
Blog: http://stardiviner.github.io/
--001a11490da868ecdb05313954b8--