Skip to content

Instantly share code, notes, and snippets.

@lukas-mertens
Created January 21, 2018 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukas-mertens/3352d5372e56157f77e25e95596f48de to your computer and use it in GitHub Desktop.
Save lukas-mertens/3352d5372e56157f77e25e95596f48de to your computer and use it in GitHub Desktop.
Powershell-Script to convert all svg-files in the scripts location to LaTeX
$rootDir = $PSScriptRoot
cd $rootDir
foreach($file in Get-ChildItem $rootDir)
{
if($file.Extension.Equals(".svg")) {
$svg_name = $file.Name
$pdf_name = $file.BaseName + ".pdf"
$cmd = "inkscape -D -z --file=$svg_name --export-pdf=$pdf_name --export-latex"
Invoke-Expression $cmd
Rename-Item $file -NewName $($file.BaseName + ".svg_converted")
}
}
@lukas-mertens
Copy link
Author

Inkscape has to be installed and in your $PATH-Variable
Additional info: http://mirrors.sorengard.com/ctan/info/svg-inkscape/InkscapePDFLaTeX.pdf
Include in latex using
\input{yourfile.pdf_tex}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment