Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Export `.pdf_tex` for Inkscape 1.0

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.

like image 544
Oromion Avatar asked Jun 01 '20 23:06

Oromion


People also ask

How do I save a high resolution PDF in Inkscape?

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.

Can Inkscape convert SVG to PNG?

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.


2 Answers

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
like image 114
Moini Avatar answered Oct 19 '22 02:10

Moini


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
like image 31
Viggar Avatar answered Oct 19 '22 02:10

Viggar