jupyter icon indicating copy to clipboard operation
jupyter copied to clipboard

:file header fails to create the link to the result

Open logexp1 opened this issue 1 year ago • 1 comments

When I try to plot using matplotlib using org source block as follows:

#+begin_src jupyter-python :file tangle/tmp.png
import matplotlib.pyplot as plt
\\ some code here \\
...
plt.show()
#+end_src

the result block looks like this:

#+RESULTS:
[[tangle/tmp.png]]

in which file: is missing. It should be like this:

#+RESULTS:
[[file:tangle/tmp.png]]
:END:

It was used to be like this. But after I changed my system to Fedora and installed new doom emacs, it began to act weirdly. Any help will be appreciated. Thanks!

logexp1 avatar Feb 19 '24 11:02 logexp1

It’s a bit late, but I found a workaround. You need to write a complete or relative path in your :file argument because in that case you don’t need the "file:" prefix. For example, in your case:

#+begin_src jupyter-python :file ./tangle/tmp.png
import matplotlib.pyplot as plt
\\ some code here \\
...
plt.show()
#+end_src

Hope this helps.

rbocheux avatar Jul 24 '24 12:07 rbocheux