将 xypic 矩阵转换为 eps。 (乳胶)

发布于 2024-08-20 17:07:48 字数 289 浏览 5 评论 0原文

我的一篇论文的 LaTeX 文件中有很多大的 xypic 矩阵,并且需要很长/无限的时间来编译。有没有办法将单独的 xypic 片段转换为 eps 文件,并将其包含在我的主文档中?

我想我使用 LaTeX 来编译 xypic 部分,但是然后我会得到整个文档,对吧?

(有人可以在这个问题上添加标签 xypic 吗?)

更新:我想出的解决方案是为每个 xymatrix 提供单独的 LaTeX 文档,然后使用 dvips -E 捕获图形。我在我使用的编辑器 Kile 中创建了一个用于编译 + 创建 eps 的脚本。

I have a lot of BIG xypic-matrices in my LaTeX file for one of my papers, and it takes long/infinite time to compile. Is there a way to convert just the separate xypic-pieces to eps files, that I include in my main document?

I suppose I use LaTeX to compile the xypic part, but then I will get an entire document, right?

(Can someone add the tag xypic to this question?)

Update: The solution I came up with was to have separate LaTeX documents for each xymatrix, and then use dvips -E to capture the figure. I created a script for Compiling + Create eps in Kile, the editor I use.

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

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

发布评论

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

评论(3

烟花肆意 2024-08-27 17:07:48

使用latex进行编译,然后a

dvips -E -o temp.eps temp.dvi

将其制作成eps,然后 epscrop 制作一个小 eps,您可以稍后添加。

Use latex to compile, then a

dvips -E -o temp.eps temp.dvi

to make an eps out of it, then epscrop to make a small eps you can include later.

别在捏我脸啦 2024-08-27 17:07:48

有几种方法可以仅在文档的一部分上运行 Latex;最广泛使用的可能是 Emacs/Auctex 的 TeX-command-region (Cc Cr),它生成一个临时 Latex 文件,其 dvi/eps/pdf/whatever 输出正是来自所选区域的输出。

There are a few ways to run Latex on just a portion of a document; the most widely used is likely Emacs/Auctex's TeX-command-region (C-c C-r), which generates a temporary Latex file whose dvi/eps/pdf/whatever output is just that from the selected region.

讽刺将军 2024-08-27 17:07:48

您可以使用 preview 包来仅处理您的图片。例如:

$ cat a.tex
\documentclass{article}
\usepackage[active,tightpage]{preview}
\setlength\PreviewBorder{5pt}
\usepackage [arrow]{xy}
\begin{document}
\begin{preview}
\begin{xy}
    (0,-20)="a", (0,0)="b"
    \ar@{<.||}  @<24mm>  "a";"b"
    \ar@^{<.||} @<16mm>  "a";"b"
    \ar@_{<.||} @<8mm>   "a";"b"
    \ar@0{<.||}          "a";"b"
    \ar@1{<.||} @<-8mm>  "a";"b"
    \ar@2{<.||} @<-16mm> "a";"b"
    \ar@3{<.||} @<-24mm> "a";"b"
\end{xy}
\end{preview}
\end{document}

然后,当您运行 pdflatex 时,preview 将生成一个仅包含图片的 pdf。您可以通过 Ghostscript 将它们转换为 eps:

$ latex a
$ dvips -E -i -Pwww -o figure.000 a

或者您可以生成 PNG 图像:

$ pdflatex a
$ gs -dNOPAUSE -r400 -dGraphicsAlphaBits=4 -dTextAlphaBits=4 \
     -sDEVICE=png16m  -sOutputFile=figure.png -dBATCH a.pdf

然后,您可以将生成的文件包含在文档中。

You can use the preview package to only process your pictures. For example:

$ cat a.tex
\documentclass{article}
\usepackage[active,tightpage]{preview}
\setlength\PreviewBorder{5pt}
\usepackage [arrow]{xy}
\begin{document}
\begin{preview}
\begin{xy}
    (0,-20)="a", (0,0)="b"
    \ar@{<.||}  @<24mm>  "a";"b"
    \ar@^{<.||} @<16mm>  "a";"b"
    \ar@_{<.||} @<8mm>   "a";"b"
    \ar@0{<.||}          "a";"b"
    \ar@1{<.||} @<-8mm>  "a";"b"
    \ar@2{<.||} @<-16mm> "a";"b"
    \ar@3{<.||} @<-24mm> "a";"b"
\end{xy}
\end{preview}
\end{document}

Then, when you run pdflatex, preview will generate a pdf with only the pictures in it. You can convert them to eps by ghostscript:

$ latex a
$ dvips -E -i -Pwww -o figure.000 a

or you can generate PNG images:

$ pdflatex a
$ gs -dNOPAUSE -r400 -dGraphicsAlphaBits=4 -dTextAlphaBits=4 \
     -sDEVICE=png16m  -sOutputFile=figure.png -dBATCH a.pdf

Then, you can include the generated files in your document.

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