In emacs
+org-mode
, when viewing an org-mode buffer, you can inline
linked images with the org-toggle-inline-images
command. This
includes various formats out of the box, but apparently PDF images
aren't included yet.
Given that emacs is perfectly capable of rendering PDF files, is it
possible to make org-mode inline PDF files like it does with images
(png,jpeg,etc)?
Some background: PDF images are more convenient for me for several
reasons, the biggest being that they scale well and work well with
latex, from small papers to large posters.
Best Answer
Let me finish this question.
Firstly, Org-mode does not support any pdf inline display function with itself. However, it is possible to modify
org-display-inline-images
to achieve what you want. First you need to refer to this answer: Configuring emacs for showing fixed width inline images, which inspired me a lot. Then I slightly modified the function, making it support pdf, bmp display in org-mode. My function is on below.The function uses
convert file.pdf -thumbnail "400x400>" file_thumb.png
to generate a file_thumb named thumbnail in your folder to substitute overlay of pdf, and force org-mode to display pdf with file_thumb without any modification to the org file.Moreover, because i use babel to generate image with python. It always need me to update the _thumb file, so I add a if condition to say if this thumb file existed or not, and if the pdf file changed i need to change thumb file on the same time... and so on!
Hope it can help you.