Inkscape + pdftex?
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
事实证明,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.
是的,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.
您是否向
\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.据我所知,你必须调整边界框。 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.您甚至可以完全自动化将 svgs 转换为 pdf 的过程,因为可以从命令行调用 inkscape。 例如,以下 makefile 代码为我完成了这项工作(复制和转换):
此外,还可以使用
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:
Moreover, cropping pdf files can be also done using
pdfcrop
.