Graphicx 无法与 XeLatex 一起显示

Graphicx 无法与 XeLatex 一起显示

我在使用 XeLaTeX 和 pst-coil 时遇到了问题。如果我想绘制图形,使用 latex+dvips+ps2pdf+see pdf 进行编译时可以正常工作。如果我使用 Xelatex 进行编译,则 pspicture 中不会绘制任何内容。以下是示例

\documentclass[oneside,a4paper,12pt]{book}
\usepackage{graphicx}
\usepackage{pst-coil}
\ifx\setlinejoinmode\undefined
  \newcommand{\setlinejoinmode}[1]{}
\fi
\ifx\setlinecaps\undefined
  \newcommand{\setlinecaps}[1]{}
\fi
% This way define your own fonts mapping (for example with ifthen)
\ifx\setfont\undefined
  \newcommand{\setfont}[2]{}
\fi
\begin{document}
\begin{figure}[h]
\begin{center}
\pspicture(-1.000,-6.000)(26.113750,-1.700)
\psscalebox{0.37 -0.37}{
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\newrgbcolor{diafillcolor}{1.000000 1.000000 1.000000}%
\psset{fillcolor=diafillcolor}
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.780392 0.737255 0.737255}%
\psset{linecolor=dialinecolor}
\pspolygon*(7.950000,12.020000)(7.950000,13.940000)(12.850000,13.940000)(12.850000,12.020000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(7.950000,12.020000)(7.950000,13.940000)(12.850000,13.940000)(12.850000,12.020000)
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.368627 0.341176 0.341176}%
\psset{linecolor=dialinecolor}
\pspolygon*(12.842100,12.000000)(12.842100,13.985000)(15.350000,13.985000)(15.350000,12.000000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(12.842100,12.000000)(12.842100,13.985000)(15.350000,13.985000)(15.350000,12.000000)
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.180392 0.141176 0.141176}%
\psset{linecolor=dialinecolor}
\pspolygon*(20.250000,12.020000)(20.250000,13.962500)(25.184600,13.962500)(25.184600,12.020000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(20.250000,12.020000)(20.250000,13.962500)(25.184600,13.962500)(25.184600,12.020000)
\psset{linestyle=solid}
\setlinejoinmode{0}
\setfont{Helvetica}{1.000000}
\psset{linewidth=0.050000cm}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(7.937500,14.000000)(7.937500,14.198333)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(10.403571,14.000000)(10.403571,14.198333)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(12.869643,14.000000)(12.869643,14.198333)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(15.335714,14.000000)(15.335714,14.198333)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(17.801786,14.000000)(17.801786,14.198333)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(20.267857,14.000000)(20.267857,14.198333)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(22.733929,14.000000)(22.733929,14.198333)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(25.200000,14.000000)(25.200000,14.198333)
\psset{linewidth=0.100000cm}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(7.937500,14.000000)(7.937500,14.595000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(7.937500,15.395000){\psscalebox{2.5 -2.5}{0}}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(10.403571,14.000000)(10.403571,14.595000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(10.403571,15.395000){\psscalebox{2.5 -2.5}{1}}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(12.869643,14.000000)(12.869643,14.595000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(12.869643,15.395000){\psscalebox{2.5 -2.5}{2}}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(15.335714,14.000000)(15.335714,14.595000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(15.335714,15.395000){\psscalebox{2.5 -2.5}{3}}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(17.801786,14.000000)(17.801786,14.595000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(17.801786,15.395000){\psscalebox{2.5 -2.5}{4}}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(20.267857,14.000000)(20.267857,14.595000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(20.267857,15.395000){\psscalebox{2.5 -2.5}{5}}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(22.733929,14.000000)(22.733929,14.595000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(22.733929,15.395000){\psscalebox{2.5 -2.5}{6}}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(25.200000,14.000000)(25.200000,14.595000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput(25.200000,15.395000){\psscalebox{2.5 -2.5}{7}}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(7.937500,14.000000)(25.200000,14.000000)
\setfont{Helvetica}{0.800000}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](3.00000,7.180000){\psscalebox{2.5 -2.5}{Machine 1}}
\setfont{Helvetica}{0.800000}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](3.000,10.175000){\psscalebox{2.5 -2.5}{Machine 2}}
\setfont{Helvetica}{0.800000}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](5.405000,10.095000){\psscalebox{1 -1}{}}
\setfont{Helvetica}{0.800000}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](3.000,13.145000){\psscalebox{2.5 -2.5}{Machine 3}}
\psset{linewidth=0.100000cm}
\psset{linestyle=dotted,dotsep=0.200000}
\psset{linestyle=dotted,dotsep=0.200000}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(15.350000,12.000000)(20.250000,12.020000)
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.368627 0.341176 0.341176}%
\psset{linecolor=dialinecolor}
\pspolygon*(8.055000,9.045000)(8.055000,10.945000)(12.900000,10.945000)(12.900000,9.045000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(8.055000,9.045000)(8.055000,10.945000)(12.900000,10.945000)(12.900000,9.045000)
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.180392 0.141176 0.141176}%
\psset{linecolor=dialinecolor}
\pspolygon*(15.405000,8.995000)(15.405000,10.945000)(20.250000,10.945000)(20.250000,8.995000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(15.405000,8.995000)(15.405000,10.945000)(20.250000,10.945000)(20.250000,8.995000)
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.780392 0.737255 0.737255}%
\psset{linecolor=dialinecolor}
\pspolygon*(20.255000,8.995000)(20.255000,10.980000)(22.762900,10.980000)(22.762900,8.995000)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(20.255000,8.995000)(20.255000,10.980000)(22.762900,10.980000)(22.762900,8.995000)
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.180392 0.141176 0.141176}%
\psset{linecolor=dialinecolor}
\pspolygon*(8.033241,5.977500)(8.033241,7.927500)(15.378241,7.927500)(15.378241,5.977500)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(8.033241,5.977500)(8.033241,7.927500)(15.378241,7.927500)(15.378241,5.977500)
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.368627 0.341176 0.341176}%
\psset{linecolor=dialinecolor}
\pspolygon*(15.383241,5.977500)(15.383241,7.927500)(22.728241,7.927500)(22.728241,5.977500)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(15.383241,5.977500)(15.383241,7.927500)(22.728241,7.927500)(22.728241,5.977500)
\psset{linewidth=0.000000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinejoinmode{0}
\newrgbcolor{dialinecolor}{0.780392 0.737255 0.737255}%
\psset{linecolor=dialinecolor}
\pspolygon*(22.733241,5.982500)(22.733241,7.912500)(25.128241,7.912500)(25.128241,5.982500)
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\pspolygon(22.733241,5.982500)(22.733241,7.912500)(25.128241,7.912500)(25.128241,5.982500)
\psset{linewidth=0.100000cm}
\psset{linestyle=dotted,dotsep=0.200000}
\psset{linestyle=dotted,dotsep=0.200000}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(12.900000,9.045000)(15.405000,8.995000)
\psset{linewidth=0.100000cm}
\psset{linestyle=dotted,dotsep=0.200000}
\psset{linestyle=dotted,dotsep=0.200000}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(12.900000,10.945000)(15.405000,10.945000)
\psset{linewidth=0.100000cm}
\psset{linestyle=dotted,dotsep=0.200000}
\psset{linestyle=dotted,dotsep=0.200000}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(22.762900,8.995000)(25.378241,8.932500)
\psset{linewidth=0.100000cm}
\psset{linestyle=dotted,dotsep=0.200000}
\psset{linestyle=dotted,dotsep=0.200000}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(22.762900,10.980000)(25.278241,10.982500)
\psset{linewidth=0.100000cm}
\psset{linestyle=solid}
\psset{linestyle=solid}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(25.184600,13.962500)(26.288068,13.961114)
\psset{linewidth=0.100000cm}
\psset{linestyle=solid}
\setlinejoinmode{0}
\setlinecaps{0}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\psline(25.900186,14.211601)(26.399871,13.960974)(25.899558,13.711602)
\setfont{Helvetica}{0.800000}
\newrgbcolor{dialinecolor}{0.000000 0.000000 0.000000}%
\psset{linecolor=dialinecolor}
\rput[l](26.211675,14.810833){\psscalebox{2.5 -2.5}{time}}
}\endpspicture
\end{center}
\caption{Optimal schedule} 
\end{figure}
\end{document}

使用 Xelatex 编译时会产生此结果 在此处输入图片描述

这是使用 latex+dvips+ps2pdf+see pdf 进行编译时得到的在此处输入图片描述

我需要用 Xelatex 编译我的文件,你有什么解决方案吗?

答案1

这是一个简化的、更短的代码。我将\pst-coil与此无关的 替换为pstricks-add

\documentclass[12pt]{standalone}%{book}%
\usepackage[scaled=0.80]{helvet}%
\usepackage{pstricks-add}%

\begin{document}
\sffamily
\begin{pspicture}(1,-5.9)(10.4,-2)%
\newrgbcolor{dialinecolor1}{0.780392 0.737255 0.737255}%
\newrgbcolor{dialinecolor2}{0.368627 0.341176 0.341176}%
\newrgbcolor{dialinecolor3}{0.180392 0.141176 0.141176}%
%%
\psscalebox{0.37 -0.37}{%
\psset{fillstyle=solid, fillcolor=white, linewidth=0pt}
\pspolygon[fillcolor=dialinecolor1, linewidth=0pt](7.950000,12.020000)(7.950000,13.940000)(12.850000,13.940000)(12.850000,12.020000)
\pspolygon[fillcolor=dialinecolor2](12.842100,12.000000)(12.842100,13.985000)(15.350000,13.985000)(15.350000,12.000000)
\pspolygon[fillcolor=dialinecolor3](20.250000,12.020000)(20.250000,13.962500)(25.184600,13.962500)(25.184600,12.020000)
%%
\psaxes[linewidth=0.1cm, arrows=-v, veearrowlinewidth=0.9mm,veearrowlength=4.5mm, veearrowangle=60, %
yAxis=false, dx=2.466, ticksize=5mm -0.5mm, tickwidth=1mm, labels=none](7.9375,14)(7.9375,14)(27,14)
\uput{5mm}[u](27,14){\psscalebox{2.5 -2.5}{time}}
\rput(7.937500,15.395000){\psscalebox{2.5 -2.5}{0}}
\rput(10.403571,15.395000){\psscalebox{2.5 -2.5}{1}}
\rput(12.869643,15.395000){\psscalebox{2.5 -2.5}{2}}
\rput(15.335714,15.395000){\psscalebox{2.5 -2.5}{3}}
\rput(17.801786,15.395000){\psscalebox{2.5 -2.5}{4}}
\rput(20.267857,15.395000){\psscalebox{2.5 -2.5}{5}}
\rput(22.733929,15.395000){\psscalebox{2.5 -2.5}{6}}
\rput(25.200000,15.395000){\psscalebox{2.5 -2.5}{7}}
%%
\rput[l](3.00000,7.180000){\psscalebox{2.5 -2.5}{Machine 1}}
\rput[l](3.000,10.175000){\psscalebox{2.5 -2.5}{Machine 2}}
\rput[l](3.000,13.145000){\psscalebox{2.5 -2.5}{Machine 3}}
%%
\pspolygon[fillcolor=dialinecolor2](8.055000,9.045000)(8.055000,10.945000)(12.900000,10.945000)(12.900000,9.045000)
\pspolygon[fillcolor=dialinecolor3](15.405000,8.995000)(15.405000,10.945000)(20.250000,10.945000)(20.250000,8.995000)
\pspolygon[fillcolor=dialinecolor1](20.255000,8.995000)(20.255000,10.980000)(22.762900,10.980000)(22.762900,8.995000)
\pspolygon[fillcolor=dialinecolor3](8.033241,5.977500)(8.033241,7.927500)(15.378241,7.927500)(15.378241,5.977500)
\pspolygon[fillcolor=dialinecolor2](15.383241,5.977500)(15.383241,7.927500)(22.728241,7.927500)(22.728241,5.977500)
\pspolygon[fillcolor=dialinecolor1](22.733241,5.982500)(22.733241,7.912500)(25.128241,7.912500)(25.128241,5.982500)
%%
\psset{linewidth=1mm, linestyle=dotted, dotsep=0.200000}
\psline(12.900000,10.945000)(15.405000,10.945000)
\psline(12.900000,9.045000)(15.405000,8.995000)
\psline(22.762900,8.995000)(25.378241,8.932500)
\psline(22.762900,10.980000)(25.278241,10.982500)
\psline(15.350000,12.000000)(20.250000,12.020000)
}\end{pspicture}

\end{document} 

在此处输入图片描述

相关内容