Inkscape + pdftex?

发布于 2024-07-18 02:56:57 字数 265 浏览 4 评论 0原文

我在 Inkscape 中有一张小图,我想将其嵌入到我使用 pdftex 编译的 LaTeX 文档中。 pdftex 似乎有一个不接受 .eps 的奇怪现象。 事实上,如果我的理解是正确的,它接受的唯一矢量图形格式是pdf。 当我在 Inkscape 中将绘图保存为 pdf 时,我得到的是一个整页的 pdf,我的绘图位于右上角。
有没有办法将 Inkscape 绘图导入 pdftex 并忽略此页面大小? 或者我是否需要开始摆弄页面设置以使页面尺寸完全适合我的绘图尺寸?

I have a small drawing in Inkscape and I want to embed it in a LaTeX document which I compile using pdftex. pdftex seem to have an oddity of not accepting .eps. infact if what I understood is correct the only vector graphics format it accepts is pdf. When I save my drawing in Inkscape as pdf then what I get is a pdf with a full page with my drawing in the upper corner.
Is there a way to import an Inkscape drawing to pdftex and ignoring this page size? Or do I need to start fiddling with the page settings to make the page size exactly fit the size of my drawing?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

卷耳 2024-07-25 02:56:57

事实证明,Inkscape 在文档属性上有一个名为“使页面适合选择”的按钮,这使得这更容易。 那好吧。

So it turns out that Inkscape has a button on the Document properties titled "Fit page to selection" which makes this easier. Oh well.

千纸鹤 2024-07-25 02:56:57

是的,pdftex 不接受 eps。

我使用 inkscape 制作图形,并将其合并到 .tex 文档中,然后使用 pdflatex 进行处理。 是的,我在 inkscape 中设置了页面大小,以便图形适合。

您还可以尝试从 inkscape 导出为 .eps,然后使用“epstopdf”工具转换为 pdf。

Yes, pdftex does not accept eps.

I have used inkscape to make figures that I incorporate into .tex documents that I then process with pdflatex. And yes, I set the page size in inkscape so that the figure fits.

You could also try to export to .eps from inkscape, then convert to pdf with the "epstopdf" tool.

绝情姑娘 2024-07-25 02:56:57

您是否向 \includegraphics 提供可选的缩放参数? PDF 处理边界框的方式与封装后记不同,并且自动调整大小似乎效果不佳。

Are you giving the optional scaling parameters to \includegraphics? PDF handles bounding boxes differently from encapsulated postscript, and auto-sizing does not seem to work as well.

分分钟 2024-07-25 02:56:57

据我所知,你必须调整边界框。 PDF 中的纸张尺寸。 有像 eps2pdf 这样的工具可以将 EPS 转换为具有相同边框的 PDF。

As far as I know, you have to adjust the bounding box resp. paper size in your PDF. There are tools like eps2pdf to convert EPS to PDF with the same bounding box.

Hello爱情风 2024-07-25 02:56:57

您甚至可以完全自动化将 svgs 转换为 pdf 的过程,因为可以从命令行调用 inkscape。 例如,以下 makefile 代码为我完成了这项工作(复制和转换):

# svg -> pdf
$(GRAPHIC_DIR)/%.pdf: $(GRAPHIC_DIR)/%.svg
    cp $(GRAPHIC_DIR)/$*.svg $(GRAPHIC_DIR)/$*-crop.svg
    inkscape --verb=FitCanvasToSelectionOrDrawing --verb=FileSave --verb=FileClose $(GRAPHIC_DIR)/$*-crop.svg
    inkscape -A $(GRAPHIC_DIR)/$*.pdf $(GRAPHIC_DIR)/$*-crop.svg
    rm $(GRAPHIC_DIR)/$*-crop.svg

此外,还可以使用 pdfcrop 来裁剪 pdf 文件。

You can even fully automate the process of converting your svgs into pdfs, since inkscape can be called from command line. For instance, the following makefile code does the job (copping and converting) for me:

# svg -> pdf
$(GRAPHIC_DIR)/%.pdf: $(GRAPHIC_DIR)/%.svg
    cp $(GRAPHIC_DIR)/$*.svg $(GRAPHIC_DIR)/$*-crop.svg
    inkscape --verb=FitCanvasToSelectionOrDrawing --verb=FileSave --verb=FileClose $(GRAPHIC_DIR)/$*-crop.svg
    inkscape -A $(GRAPHIC_DIR)/$*.pdf $(GRAPHIC_DIR)/$*-crop.svg
    rm $(GRAPHIC_DIR)/$*-crop.svg

Moreover, cropping pdf files can be also done using pdfcrop.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文