簡體   English   中英

org-mode 內聯圖像不起作用(遠程使用 TRAMP)

[英]org-mode inline images not working (remotely with TRAMP)

我正在使用 TRAMP 在遠程機器上使用 emacs 組織模式。 我將代碼單元連接到 jupyter 服務器(在那台遠程機器上),在那里我啟動了一個 python 3 kernel。代碼執行工作得很好,我也可以用 matplotlib 創建圖。雖然 a.png 是在正確的臨時文件位置生成的,但代碼單元格的 output 是文件的(相對)鏈接,沒有按預期內聯顯示。

示例代碼塊如下所示:

#+BEGIN_SRC jupyter-python :session /jpy:localhost#9090:TEST
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot(range(10), range(10))
#+END_SRC
#+RESULTS:
:RESULTS:
| <matplotlib.lines.Line2D | at | 0x7f1c43a289a0> |
[[file:./.ob-jupyter/e1eecf5d59de9bfa1d3468867a64aadf4b1a6261.png]]
:END:

Cc Cx Cv給出消息: 'No images to display inline'

Cc o打開並正確顯示不同緩沖區中的文件。

我希望該文件能夠在 org-mode 緩沖區中正確地內聯顯示。

我試圖將鏈接手動更改為 TRAMP 路徑,看起來像這樣:

[[file:/ssh:MYSERVER:/PATH_TO_TEMP_FOLDER/.ob-jupyter/e1eecf5d59de9bfa1d3468867a64aadf4b1a6261.png]]

這也允許我使用Cc o打開文件,但不會內聯顯示文件(與上述行為相同)

如果我直接打開 jupyter-repl session 並輸入fig (在執行上面的代碼塊之后)該圖在 jupyter-repl 緩沖區中按預期顯示

如果我在本地運行 jupyter session,內聯繪圖會按預期工作


更新:

我意識到如果我在鏈接上打開文件,鏈接會擴展為無效的Cf鏈接,從而引發以下錯誤消息:

File is missing: /ssh:bih:/PATH_TO_CORRECT_FOLDER/00_test/file:./.ob-jupyter/

請注意鏈接末尾的file:./不屬於那里。 所以我認為 TRAMP 和 org-mode(或 emacs-jupyter)之間的某個地方出了問題。 任何想法如何解決這一問題?

Ch v org-display-remote-inline-images說:

org-display-remote-inline-images is a variable defined in ‘org.el’.

Its value is ‘skip’

How to display remote inline images.
Possible values of this option are:

skip        Don’t display remote images.
download    Always download and display remote images.
cache       Display remote images, and open them in separate buffers
            for caching.  Silently update the image buffer when a file
            change is detected.

檢查值並可能自定義變量以執行skip以外的操作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM