1

We have a system at our college where we've written thousands of problems over the years. We started using Metapost, then along came PSTricks, then we started using tike and tkz. Our code mixes perl and tex code, then a script is applied that produces a tex file, which is then compiled using the following commands.

latex --shell-escape filename.tex
dvips -o filename-pics.ps filename.dvi
ps2pdf -dAutoRotatePages=/None filename-pics.ps filename-pics.pdf
pdflatex --shell-escape filename.tex

All worked well with Texlive 2012, but a recent update to Texlive 2014 is causing problems. Many of our graphics will no longer compile and wind up in our pdf output documents. So I may be tuning into Tex Stack Exchange with a number of questions as we try to hunt down what is going wrong. My first question follows.

Here is a minimal file.

\documentclass{article}
\usepackage{amsmath,amssymb}

\usepackage{infwarerr}
\usepackage{ltxcmds}

\usepackage{pst-pdf}
\usepackage{pst-bar}
\usepackage{pst-plot}
\usepackage{pst-tree}
\usepackage{pst-eucl}
\usepackage{pst-solides3d}
\usepackage{pstricks-add}
\usepackage{tkz-euclide,tkz-fct}
\usetkzobj{all}

\usepackage{ifpdf}

%% for metapost graphics
\usepackage{emp}
\ifpdf
\DeclareGraphicsRule{*}{mps}{*}{}
\fi
\setlength{\unitlength}{1cm}

\empTeX{}

\begin{document}

\setlength{\unitlength}{1cm}
\begin{empfile}

\begin{empdef}[raydomain1](4,4)

%initalize parameters;
numeric xa, ya, xb, yb;
xa:=0;
ya:=0;
xb:=5;
yb:=-5;

%initialize scale
numeric u; 10u=w;

%opendotblue macro
def opendotblue(expr pos)=
 fill fullcircle scaled 4pt shifted pos withcolor white;
 draw fullcircle scaled 4pt shifted pos withcolor blue;
enddef;

%grid
for k=-5u step 1u until 5u:
 draw (k,-5u)--(k,5u) withcolor blue;
 draw (-5u,k)--(5u,k) withcolor blue;
endfor;

%axes
drawdblarrow (-5u,0)--(5u,0);
label.rt(btex $x$ etex, (5u,0));
drawdblarrow (0,-5u)--(0,5u);
label.top(btex $y$ etex, (0,5u));

%scale
label.lft(btex $5$ etex, (0,5u));
label.top(btex $5$ etex, (5u,0));

%draw ray
path p;
p:=((xa,ya)--(xb,yb)) scaled u;
pickup pencircle scaled 1pt;
 drawarrow p withcolor blue;
pickup defaultpen;
opendotblue((xa,ya) scaled u);
label.rt(btex $f$ etex, (xb,yb) scaled u);

\end{empdef}

\end{empfile}

\immediate\write18{mpost  \jobname}

\empuse{raydomain1}

\end{document}

Let's save this file as filename.tex. Then the first two commands work fine.

latex --shell-escape filename.tex
dvips -o filename-pics.ps filename.dvi

However, the third command:

ps2pdf -dAutoRotatePages=/None filename-pics.ps filename-pics.pdf

Posts the following error.

Error: /typecheck in --div--
Operand stack:
   1   1   0.0   0.0   a   65781.8
Execution stack:
   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1900   1   3   %oparray_pop   1899   1   3   %oparray_pop   1883   1   3   %oparray_pop   1771   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   --nostringval--   4   --nostringval--   %repeat_continue   --nostringval--
Dictionary stack:
   --dict:1168/1684(ro)(G)--   --dict:0/20(G)--   --dict:132/200(L)--   --dict:787/1012(L)--   --dict:183/300(L)--
Current allocation mode is local
Last OS error: Invalid argument
Current file position is 447402
GPL Ghostscript 9.10: Unrecoverable error, exit code 1

Now, if we comment two lines, namely:

%\usepackage{tkz-euclide,tkz-fct}
%\usetkzobj{all}

Then that error is eliminated. So, has something changed?

Here is a second example:

\documentclass{article}
\usepackage{amsmath,amssymb}

\usepackage{pst-pdf}
\usepackage{pst-bar}
\usepackage{pst-plot}
\usepackage{pst-tree}
\usepackage{pst-eucl}
\usepackage{pst-solides3d}
\usepackage{pstricks-add}
\usepackage{tkz-euclide,tkz-fct}
\usetkzobj{all}

\begin{document}

\begin{center}
\psset{unit=0.4in}
\begin{pspicture}(-1,-1)(6.5,6)
\psgrid[gridlabels=0pt,subgriddiv=1,gridcolor=lightgray](0,0)(0,0)(5,5)
\psaxes[arrows=->,arrowscale=1.5,ticks=none,labels=none](0,0)(0,0)(5.3,5.3)
\uput[0](5.3,0){$x$}
\uput[270](5,0){5}
\uput[270](0,0){0}
\uput[180](0,5){5}
\uput[180](0,0){0}
\uput[90](0,5.3){$y$}
\psdot*[linecolor=red,dotsize=3pt 3](2,2)
\uput[45](2,2){$P$}
\end{pspicture}
\end{center}

\end{document}

Now, these three commands:

latex --shell-escape filename.tex
dvips -o filename-pics.ps filename.dvi
ps2pdf -dAutoRotatePages=/None filename-pics.ps filename-pics.pdf

Produces a file filename-pics.pdf that is blank.

Now, if again, I comment the lines:

%\usepackage{tkz-euclide,tkz-fct}
%\usetkzobj{all}

Then, these three commands:

latex --shell-escape filename.tex
dvips -o filename-pics.ps filename.dvi
ps2pdf -dAutoRotatePages=/None filename-pics.ps filename-pics.pdf

Produces a file filename-pics.pdf that contains the image needed.

Note: I know some people will probably immediately start to suggest better approaches (and they do exist now, but probably not when we started many years ago), so we have to pretty much keep our system the same, there are just far too many files than we could possibly rewrite.

So, what is going on with:

\usepackage{tkz-euclide,tkz-fct}
\usetkzobj{all}

I am using:

\ProvidesPackage{tkz-fct}[2014/03/13 1.19 c function ] 

David

  • Does the same thing happen with different compatibility levels? Which version of ghostscript are you using? – cfr Jun 27 '14 at 2:42
  • I'm not using Ghostscript to view the images. I just double-clicked the pdf file and it opened in Acrobat Reader as a blank image when the two commands regarding tkz were uncommented. My system is a Macbook pro, brand new, using Mavericks and my tex system is Mactex.org, the new Texlive 2014 version that was just recently released. – David Jun 27 '14 at 3:10
  • ps2pdf is essentially ghostscript. That's why you can pass options to it which are for gs. It's basically a wrapper. See man ps2pdf for details. – cfr Jun 27 '14 at 20:26
  • Do you have suggestions of passing options that will make the second example work, even when the tis commands are not commented out? – David Jun 28 '14 at 2:30
  • No. I was just explaining why I asked about your version of ghostscript. – cfr Jun 28 '14 at 2:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.