Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

After profiting enormously from other people's questions here, I finally need to ask one myself: since I updated my MiKTeX 2.9 installation a week ago, I can't compile my PhD thesis anymore.

I use pdflatex in conjunction with the auto-pst-pdf package to include graphics obtained with matlabfrag. I also need TikZ for a couple of diagrams and custom chapter and section headings that I programed using the features of the memoir class.

In this configuration, Ghostscript 9.05 (the one included in MiKTeX 2.9) crashes with an irrecoverable error. Here's a minimal example to reproduce the problem:

\documentclass{article}

% (A) alternatively, comment the following two lines
\usepackage{tikz}
\usetikzlibrary{arrows}

\usepackage{psfrag}
\usepackage{auto-pst-pdf}

\begin{document}

% (B) or those two lines in order to prevent the Ghostscript error
\begin{center}
\end{center}

\input{brachistochroneA1.tex}
\includegraphics[width=\textwidth]{brachistochroneA1}

\end{document}

The weird thing is that Ghostscript doesn't break if either the TikZ import or the \begin{center} and \end{center} block is commented out. (I expect that this also holds for other blocks, but I haven't tested it yet.)

I'd greatly appreciate any help!

Also, as an alternative, I tried pstool (since the auto-pst-pdf manual suggests its use as replacement), but this gives me different trouble: the \includegraphics{...} directive takes subdirectories (as usual) with a forward slash /, but since I'm on Windows, these need to be translated into backslashes \ for shell-escape commands. Unfortunately, pstool seems not to be doing this, resulting in command line errors when copying the bbl file. (Should I ask this in a separate question?)

share|improve this question
1  
Try \usepackage{ifpdf}\ifpdf\usepackage{tikz}\fi. –  Ulrike Fischer Mar 20 at 10:05
    
Sorry -- that was rather obvious, wasn't it? (Add the sound of someone frenetically slapping himself.) Many thanks, Ulrike! How do I mark this as an answer? –  Andreas Häusler Mar 20 at 10:15
add comment

1 Answer 1

up vote 3 down vote accepted

Try

   \usepackage{ifpdf}
    \ifpdf
      \usepackage{tikz}
    \fi

Remark: Why the new pgf version breaks in auto-pst-pdf hasn't been analysed yet. So this is more a work-around then a solution.

share|improve this answer
    
it prevents the loading of the PostScript files. I suppose a problem with a redefinition of the \special command. –  Herbert Mar 20 at 10:54
    
Thanks for the background information! After 30 hours of trying to isolate the error out of a multitude of package imports and customizations, and a heads-over-heels dive into auto-pst-pdf.dtx trying to execute it step-wise in the shell, I'm relieved that my thesis compiles again -- even more though that I now know that it didn't fail because I unknowingly used some deprecated functions. :-) –  Andreas Häusler Mar 20 at 11:21
    
@AndreasHäusler: Well, I've been fighting with this for several days and I was about to ask a question right before I saw your OP. It took me a long time to figure out something was not quite right with the latest tikz. –  Marcos Apr 7 at 8:08
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.