【问题标题】:How to add svg file extension on a beamer latex?如何在投影仪乳胶上添加 svg 文件扩展名?
【发布时间】:2017-02-11 20:42:59
【问题描述】:

我正在做一个投影仪乳胶演示,我想知道如何直接在其上添加 svg 图形。我知道可以将 svg 文件转换为 pdf 格式,然后将其包含到 beamer 中,但我想直接包含 svg 文件(不将其转换为 pdf 格式)。

代码必须如下所示:

\begin{frame}
  \frametitle{Frame SVG example}
  \begin{figure}
    \includegraphics[\textwidth]{graphic.svg}
  \end{figure}
\end{frame}

提前致谢!

【问题讨论】:

    标签: svg latex inkscape beamer


    【解决方案1】:

    您可以使用SVG 包来实现这一点。它将使用Inkscape(需要在您的计算机上安装)即时转换您的.svg。如果 .svg 文件发生更改,它将重新导出您的图形。

    一个最小的例子可能如下所示:

    \documentclass{beamer}
    \usepackage{svg}
    \setsvg{inkscape = "C:/Program Files/Inkscape/inkscape.exe" -z -D}
    
    \begin{document}
      \begin{frame}
        \includesvg[width=0.7\textwidth]{path/to/mysvgimage}
      \end{frame}
    \end{document}
    

    有一些事情需要考虑,例如文本格式和对齐方式。查看 SVG 包的文档。

    您还需要确保您允许乳胶调用 Inkscape

    pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex
    

    latex -interaction=nonstopmode --shell-escape %.tex
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2011-02-17
      • 1970-01-01
      • 1970-01-01
      • 2010-12-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多