[Latex] latex import svg pictures

1. Download inkscape:
https://inkscape.org/release/all/windows/64-bit/exe/ During the
installation process, check to add environment variables, if not checked, add them manually.
Use the command to check whether the installation is successful inkscape -V.
2. Use inkscape to convert svg to pdf and pdf_tex.
Enter cmd above the directory where the svg image is located (or advanced cmd and then cd to the directory where the svg image is located), and execute the following command.
Take demo.svg as an example:

## inkscape version 为 1.x
inkscape -D --export-type=pdf --export-latex demo.svg

After execution, two files, demo.pdf and demo.pdf_tex, will be generated in the demo.svg directory.
3. Just insert it in Latex
Macro package

\usepackage{color}
\usepackage{transparent}
\usepackage{graphicx}
\usepackage{import}

Insert picture

\begin{figure}
    \centering
    \def\svgwidth{\columnwidth}
    \input{demo.pdf_tex}
\end{figure}

Reference link:
1. http://ctan.imsc.res.in/info/svg-inkscape/InkscapePDFLaTeX.pdf
2. Latex insert svg picture
3. Latex add svg picture

Guess you like

Origin blog.csdn.net/dl962454/article/details/114479159