导出Inkscape 1.0中的.pdf_tex文件

9
我想要通过命令行从.svg导出到.pdf_tex,但只能在Inkscape 1.0或更高版本中进行操作,例如:https://dev59.com/O4rda4cB1Zd3GeqPLFmp#41110512
解释:
在Inkscape 0.92或之前,如果我在.tex文件中使用.svg文件,我只需使用lualatex --shell-scape myfile.tex编译器即可创建一个名为svg-inkscape的文件夹,并生成一对文件name_svg_tex.pdfname_svg-tex.pdf_tex。然后我更喜欢手动操作,生成最后两个文件以便将SVG嵌入PDF文件中的.tex。换句话说,我想在Inkscape 0.92中复制这个操作步骤。
inkscape -D --export-filename=MyOutput.pdf_tex spektralnorm.svg

以下是这些错误:
所以
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.

重要的是生成文件.pdf_tex,生成.pdf已经完成。
inkscape -D --export-type="pdf" spektralnorm.svg

谢谢,希望svg能够更新Inkscape 1.0的pdflatexxelatexlualatex

请注意,我无法进行该操作。

 inkscape -D --export-filename=MyOutput.pdf_tex spektralnorm.svg

因为只支持InkFileExportCmd :: export:未知的导出类型:pdf_tex。允许的值:[svg,png,ps,eps,pdf,emf,wmf,xaml],甚至不支持作为.tex文件导出。

这个inkscape文档帮助我从.svg创建.pdf,但无法从.pdf_tex创建。


那么 'inkscape -D --export-latex --export-filename=my_file.pdf my_file.svg' 怎么样? - Moini
很奇怪,一个单独的svg,在pdf中导出了12页。我尝试使用这个svg,但它与使用\usepackage{svg}和lualatex --shell-escape foo.tex本地导出不相似。 - Oromion
@Oromion,这12页是由于不同层次的文本和图形元素而创建的。在您的文档中它看起来会很好。 - samcarter_is_at_topanswers.xyz
哦,谢谢SamCarter。那么Moini的答案是正确的。我提出这个问题是因为当我使用TexLive 2019和Inkscape 1.X时,将svg转换为pdf并生成.pdf_tex时,我遇到了lualatex的问题。但现在我有TeXLive 2020,就像以前一样正常工作了。 - Oromion
本问题与编程无关,抱歉离开了 TX.SX,我很高兴将在新的论坛继续学习 LaTeX。 - Oromion
2个回答

10

那么,我将把我的评论正式作为答案:

在Inkscape 1.0中,该命令应该是:

inkscape -D --export-latex --export-filename=my_file.pdf my_file.svg

我应该在LaTeX中的哪里更改命令?似乎有些魔法调用了Inkscape,而Inkscape无法识别命令行参数。现在我需要找出这个魔法来自哪里。 - Thomas Weller

4

另外,如果有人因为某种原因不想为导出的文件命名,可以采用这种方法:

inkscape -D --export-latex --export-type="pdf" my_file.svg

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接