如何使用emacs org-mode在导出的html文件中包含svg图像?

时间:2012-03-05 19:15:40

标签: html org-mode

我尝试了以下语法:

[[folder/figure.svg]]

以及org-export-as-html

这显然不起作用 - 只需在html文件中添加引用....

2 个答案:

答案 0 :(得分:4)

我不得不对此进行几次测试,以确切地说明问题的确切原因。使用以下链接时,图像导出成功:

Current folder is ~/test/
[[./img/Bitmap.svg]]
[[./Bitmap.svg]]
[[~/test/Bitmap.svg]]

然而它失败了:

Current folder is ~/test/
[[img/Bitmap.svg]]
[[Bitmap.svg]]

我怀疑Org必须找到图像在路径上的位置,./告诉它从当前位置查看,而~/可以通过shell正确扩展以给出当前目录。

如果您在图片前加./,则应正确导出。

答案 1 :(得分:1)

在Org模式下,org-export-html-inline-image-extensions变量确定哪些图像文件内联并且未在html输出中链接。您还应该检查org-export-html-inline-images变量的设置,以防其他类型的图像没有内联。

要自定义这些选项,您可以

M-x customize-option org-export-html-inline-image-extensions

或使用菜单'选项>自定义Emacs>如果您有可用的GUI,则具体选项。

相关问题