I would like to export from .svg
to .pdf_tex
from command line but on inkscape 1.0 or later, for instance, https://stackoverflow.com/a/41110512/9302545.
Explanation
In Inkscape 0.92 or earlier if I use a .svg
file in a .tex
I only use the lualatex --shell-scape myfile.tex
and this compiler creates a folder svg-inkscape
with a couple of files name_svg_tex.pdf
and name_svg-tex.pdf_tex
. Then I prefer to do it manually and generate the last two files for embeded svg in a pdf from .tex
. In other words I want to replicate for Inkscape 0.92
inkscape -D --export-filename=MyOutput.pdf_tex spektralnorm.svg
These are the errors:
So
Did you run the export with Inkscape? There's no file
`./svg-inkscape/spektralnorm.pdf_tex'
although `./svg-inkscape/spektralnorm.pdf' was found.
inkscape:42353): Unknown option -z
Package svg Warning: The export with Inkscape failed for file
(svg) `img/spektralnorm.svg'
(svg) Troubleshooting: Please check in the log file how
(svg) the invocation of Inkscape took place and try to
(svg) execute it yourself in the terminal on input line 31.
The important is generate the file .pdf_tex
, generate .pdf
is covered.
inkscape -D --export-type="pdf" spektralnorm.svg
And thanks, I hope that svg
package updates pdflatex
, xelatex
, lualatex
for Inkscape 1.0
Please note that I can not do
inkscape -D --export-filename=MyOutput.pdf_tex spektralnorm.svg
because only InkFileExportCmd::export: Unknown export type: pdf_tex. Allowed values: [svg,png,ps,eps,pdf,emf,wmf,xaml]
are supported, not even as a .tex
.
This inkscape's docs helps me create a .pdf
from .svg
but not a .pdf_tex
.
Inkscape can save directly to PDF. To do so, do File ‣ Save a Copy, and select Portable Document Format (*. pdf) from the list of available file formats at the bottom.
Inkscape only exports to PNG. If you need to export to something like a JPEG file or another file type, you will have to export your file to a PNG from Inkscape, then open up another program like GIMP (another awesome free program, which I have hundreds of tutorials for) and export to whatever filetype you want.
So then, I'm going to formalize my comment as an answer:
With Inkscape 1.0, the command should be:
inkscape -D --export-latex --export-filename=my_file.pdf my_file.svg
Alternatively, if someone does not want to name the exported file for some reason, this works for me:
inkscape -D --export-latex --export-type="pdf" my_file.svg
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With