org-roam-server
org-roam-server copied to clipboard
Is there a way to display figures when previewing a note?
I was wondering if a link to a figure (such as a pdf plot) can be shown in the preview of a note.
Figures are shown if they are images(png, jpg, etc.). If they are pdfs, unfortunately they are not shown directly. You can set org-roam-server-serve-files to t and then you can click the pdf links to open them in another tab.
Thanks. Should I do it like that (setq org-roam-server-serve-files t)
?
I also tried (setq org-roam-server-serve-files 't)
But these don't open a link of the form file:///Users/roi/Dropbox/figure.pdf
.
This
(setq org-roam-server-serve-files t)
should work. When you set it to t
, it shouldn't show file:
when you hover to the link but rather it should show 127.0.0.1:8080/<a_random_string>
. Can you close and reopen http://127.0.0.1:8080 after setting the variable.
Also you might have extra /
in your link. It should be [[file:/Users/roi/Dropbox/figure.pdf][Description]]
The way I add the figure is by a link of the form
[[~/Dropbox/figure.pdf]]
What is shown in the html in the preview of the note is a link with the string file:///Users/roi/Dropbox/figure.pdf
This still does not work...
if it is shown like that it means it is not served. Did you set org-roam-served-file-extensions
? It is set to serve pdfs by default but if you changed it, it won't serve pdfs.
I have this set org-roam-server-served-file-extensions '("pdf" "mp4" "ogv")
If it helps: When I export the org file to a pdf file using latex, then the pdf is found and exported.