visio 导出所有sheet页为svg

参考: exportEachPageToSvg.vba

Sub exportSvg()

    Dim formatExtension As String
    formatExtension = ".svg"

    ' initializations
    folder = ThisDocument.Path
    Set doc = Visio.ActiveDocument
    folder = doc.Path

    ' for each page
    For Each pg In doc.Pages

        ' set filename
        ' FileName = Left(doc.Name, Len(doc.Name) - 4) & "_" & pg.Name
        FileName = pg.Name

        ' skip background pages
        If (Not (pg.Background)) Then
            ' add extension
            FileName = FileName & formatExtension

            ' save
            Call pg.Export(folder & FileName)
        End If

    Next
End Sub

latex 直接嵌入svg

注意设置inkscapelatex=false,否则文字缩放变化较大。

\documentclass{article}

\usepackage{graphicx}

\usepackage{svg}
\svgsetup{inkscapelatex=false}

\graphicspath\{\{figure/}\{figures/}}

\title{xxx yyy zzz}

\begin{document}

\maketitle

\begin{figure}
  \centering
  \includesvg[scale=0.6]{001.svg}
  \caption{xxx}
  \label{fig:ex1}
\end{figure}


\end{document}


Published

06 April 2024

Categories

Tags


Share On