【问题标题】:Exporting figures with svg images使用 svg 图像导出数字
【发布时间】:2012-03-07 23:24:43
【问题描述】:

我在 .org 文件中有一个嵌入图像,然后我将其发布为 html。 .org 文件中包含的行是

[[./img/fig.svg]]

这被翻译成html为

<p><img src="./img/fig.svg"  alt="./img/fig.svg" />
</p>

当我加载页面时,此图像会显示在 Chrome 和 Opera 中,但在 Firefox 中,我只会将链接视为文本(“./img/fig.svg”)。我想知道我需要做什么来导出 svg 以便它在 Firefox 中加载 - 无论是在 org 模式下还是在 html 中导出之后。谢谢

【问题讨论】:

    标签: html firefox xhtml svg org-mode


    【解决方案1】:

    我无法重现此问题(关于 Org 和 org-export-as-html)。我使用以下测试:

    组织机构
    #+property: cache yes
    
    * SVG test
    
    This is a test to see if SVG images load properly in firefox
    
    [[./img/Bitmap.svg]]
    
    Small codeblock simply for extra content
    #+name: testing
    #+begin_src emacs-lisp
      (message "this is a test")
    #+end_src
    
    #+RESULTS[cb71d15e075dd84e5bc916f61562820a5695d056]: testing
    : this is a test
    
    HTML
    <h1 class="title">SVG test</h1>
    
    <p>This is a test to see if SVG images load properly in firefox
    </p>
    <p>
    <img src="./img/Bitmap.svg"  alt="./img/Bitmap.svg" />
    </p>
    <p>
    Small codeblock simply for extra content
    </p>
    
    
    <pre class="src src-emacs-lisp">(message "this is a test")
    </pre>
    

    这在 Opera 11.61、Firefox 10.0.2 中显示没有问题,但在 IE8 中失败并显示协议不可用的消息。当您尝试查看其他 SVG 时,它们是否可以在 Firefox 中工作?

    【讨论】:

    • 感谢您提醒调试的基础知识。它确实适用于其他 SVG。我最初使用的 SVG 是从 Adob​​e Illustrator 导出的——那里一定有问题。奇怪的是它可以在其他浏览器中运行......
    • @crippledlambda 你能把 SVG 贴在某个地方吗?这样可以更容易地判断它为什么不工作......
    • @BorisZbarsky,非常感谢 - 我在 Illustrator 中重新创建了这个人物,现在看起来很好......我认为它之前没有正确保存。
    猜你喜欢
    • 2013-07-01
    • 2021-09-05
    • 2019-05-27
    • 2023-04-05
    • 2020-07-08
    • 1970-01-01
    • 1970-01-01
    • 2015-06-21
    • 2019-07-23
    相关资源
    最近更新 更多