5

I'm currently preparing a presentation which I've outlined in org-mode and I'm having difficulty in including diagrams in the exported HTML. I'm currently using org-reveal but I'm happy to use another HTML presentation exporter if needed. org-reveal does offer the option to include HTML directly in the presentation but that seems a little hacky. Surely there is a better way to specify that an image should be in-line in the final exported output?

4
  • Hmmm it seems the solution is to drop the link name :-/
    – stsquad
    Commented Oct 3, 2014 at 15:37
  • 2
    Image export using org-reveal works for me. I simply use [[file:./path/to/img/img.png]] Commented Oct 3, 2014 at 18:41
  • Does this help? The Org Manual Commented Oct 3, 2014 at 22:53
  • @stsquad yeah, that's not terribly intuitive, but if a link has a description org won't turn it into an image. If it solved your problem write it as an answer!
    – Malabarba
    Commented Oct 4, 2014 at 8:47

2 Answers 2

3

Images can be exported as Inline in two styles: with hyperlink or without hyperlink.

Inline With Hyperlink

[[file:./image.png][file:./image_thumbnail.png]] 

Note that it is mandatory to put a prefix like file: or http: in the Description portion ([file:./image_thumbnail.png]) of the above image link; otherwise ox-html will export that as a text hyperlink pointing to the image.png.

You can use simply reuse image.png instead of image_thumbnail.png.

Below examples will result in inline image hyperlinks pointing to ./image.png:

[[file:./image.png][file:./image.png]]
[[./image.png][file:./image.png]]
[[file:./image.png][file:./other-image.png]]

Inline Without Hyperlink

[[file:./image.png]] 

Below examples will result in inline images without hyperlinks:

[[file:./image.png]]
[[./image.png]]

Text hyperlink to image

[[file:./image.png][Any text that doesn't begin with file:]]

Below examples will result in text hyperlinks pointing to ./image.png:

[[file:./image.png][Description]]
[[file:./image.png][./image.png]]
[[./image.png][./image.png]]
1
  • 1
    To display several images on the same slide, add formatting options before each picture: #+ATTR_HTML: :style float:left; margin:20px ; width: 250px;
    – kotchwane
    Commented May 16, 2020 at 11:53
1

The details are in the org-mode manual but I missed it. Basically you need to ensure you don't add a title. So:

#+ATTR_HTML: :alt Architectural overview :style border:none;
[[file:diagrams/RISU_Architecture_Overview.svg]]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.