开发者

Convert xypic matrix to eps. (LaTeX)

开发者 https://www.devze.com 2022-12-19 16:25 出处:网络
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 incl

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.


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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消