emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Images generated by R code blocks do not display


From: Ihor Radchenko
Subject: Re: Images generated by R code blocks do not display
Date: Thu, 24 Nov 2022 02:56:05 +0000

William Denton <wtd@pobox.com> writes:

> #+begin_src sh :results graphics file :file /tmp/colour.png
> convert -size 300x300 xc:#002b36 /tmp/colour.png
> #+end_src
>
> # -----
>
> But the image doesn't appear right away:
>
> + C-x C-f (load this file)
> + C-c C-c (to execute)
> + Say yes to "Evalute this sh code block on your system?"
> + #RESULTS block appears (good) but image does not show
> + But: C-c C-x C-v does work to toggle image display (fixed!)
>
> This is the simplest way I could think of to generate an image with minimal 
> dependencies, so I hope this boils the problem down in a helpful way.  The 
> image 
> should appear immediately in the buffer, shouldn't it?

No, it should not.
Though it is often requested.

I personally just do it via hook:

(add-hook! 'org-babel-after-execute-hook
  (unless (eq this-command 'org-babel-tangle)
    (org-display-inline-images nil nil
                               (save-excursion 
(org-back-to-heading-or-point-min t))
                               (save-excursion (or (outline-next-heading) 
(point-max))))))

Maybe one day someoneā„¢ can submit a patch ;)

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]