Created
January 21, 2018 18:22
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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}