![包含 eps 图形与 dvips 配合良好,但与 PdfLaTeX 配合不佳](https://linux22.com/image/369976/%E5%8C%85%E5%90%AB%20eps%20%E5%9B%BE%E5%BD%A2%E4%B8%8E%20dvips%20%E9%85%8D%E5%90%88%E8%89%AF%E5%A5%BD%EF%BC%8C%E4%BD%86%E4%B8%8E%20PdfLaTeX%20%E9%85%8D%E5%90%88%E4%B8%8D%E4%BD%B3.png)
我使用 JaxoDraw 2.1 为正在编写的文档绘制 Feynman Diagrams(eps 文件)。反过来,JaxoDraw 使用 axodraw4j 包。
我的问题是,当我将 eps 图形包含在文档中并通过 LaTeX+dvips+ps2pdf 进行编译时,它可以正常工作,但是当我通过 PdfLaTeX 进行编译时,图形就不合适了,有大量空白并占据了整整一页。
这是 MWE。JaxoDraw 生成的图表的 TeX 代码是
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% LaTex file generated by JaxoDraw-2.1-0
%%% CreationDate: 6/2/2018
%%% Make sure you have the axodraw4j package installed in order to proceed!
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper]{article}
\usepackage{axodraw4j}
\usepackage{pstricks}
\usepackage{color}
\setlength{\oddsidemargin}{0pt}
\setlength{\evensidemargin}{0pt}
\setlength{\topmargin}{0pt}
\setlength{\headheight}{0pt}
\setlength{\headsep}{0pt}
\setlength{\topskip}{0pt}
\setlength{\footskip}{0pt}
\setlength{\textwidth}{\paperwidth}
\addtolength{\textwidth}{-2in}
\setlength{\textheight}{\paperheight}
\addtolength{\textheight}{-2in}
\pagestyle{empty}
\begin{document}
%%JaxoComment:
%%JaxoScale{1.0}
\begin{center}
\fcolorbox{white}{white}{
\begin{picture}(116,150) (31,-27)
\SetWidth{1.0}
\SetColor{Black}
\Photon(96,102)(96,38){7.5}{3}
\Line[arrow,arrowpos=0.5,arrowlength=5,arrowwidth=2,arrowinset=0.2](32,-26)(96,38)
\Line[arrow,arrowpos=0.5,arrowlength=5,arrowwidth=2,arrowinset=0.2](96,38)(144,-26)
\Text(112,102)[lb]{\Large{\Black{$p_\mu$}}}
\end{picture}
}
\end{center}
\end{document}
我使用 LaTeX+dvips+ps2pdf 编译此文件并生成一个 eps 文件,例如“simple_diagram.eps”。然后我使用 GSview 再次转换为 eps 以获得正确的边界框。当我查看最终的 eps 时,它似乎确实具有正确的边界框。
然后我尝试将 eps 图形包含在文档中,
\documentclass[a4paper,12pt]{article}
\usepackage{graphicx}
\begin{document}
Some text goes here, perhaps referring to a simple Feynman diagram, Fig.~\ref{simple_diagram}.
%%%%%%%%%%%%%%%%%%%%%
\begin{figure}[ht]
\begin{center}
\includegraphics[scale=1]{./simple_diagram}
\caption{A simple Feynman diagram.}\label{simple_diagram}
\end{center}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%
\end{document}
使用 LaTeX+dvips+ps2pdf 可以很好地进行编译,但如果我想使用 PdfLaTeX,那就大错特错了。
我尝试了 includegraphics 的剪辑选项和许多其他方法,但都没有成功。我需要一个简单且便携的解决方案,因为我正在处理的文档有多个作者。
如果问题很愚蠢,我很抱歉,我只是不太了解如何将 eps 与 pdflatex 结合使用。提前致谢!