# TeX file with PSTricks figure won't compile

Consider the following file which is a modified version of the file Kernkraftwerk-DWR-v2-ps2pdf.tex: http://gratisupload.dk/vis/698163 (It contains more charachters than I'm allowed to enter here.)

I have tried to clean up the code (and have so far converted some of the comments into Danish).

My problem is that I cannot compile using

latex filename.tex
dvips -T 35cm,21cm -o filename.ps filename.dvi
ps2pdf filename.ps


but I don't know why. No DVI file is created but I'm clueless as to why that it.

Update

Now I can't even compile the original file. Maybe something has happened when I upgraded to TeX Live 2013.

Update 2

Maybe I should try and put \rput inside the pspicture environment.

• it is not a good idea to write every keyword in an own line. That makes it nearly impossible to locate the problem. If you really need that then make it line for line from the original code. When I roll it back for some lines in your code it works well. – user2478 Jun 23 '13 at 21:06
• @Herbert I tried to make it line for line from the original code and I'm rather sure that it compiled without problems when I worked on it yesterday, so it is a recent change that results in the error. I don't quite understand what you mean by "When I roll it back for some lines in your code it works well"; what do you mean by 'roll it back'? :( – Svend Tveskæg Jun 23 '13 at 21:14

By disabling \rput(4,-8){ and }, I can compile it with the following result. Be careful, your code potentially contains some unwanted white spaces, for example, the white space after \rput(x,y){.

\documentclass[12pt,landscape]{article}

% other code goes here. it is removed just to bypass the constraint of 40000 characters.

\begin{figure}
\centering
\psset{unit=0.9}
%\rput(4,-8){%
\begin{pspicture}(-24.4,-2)(8.5,15.8)
\rput(-8.5,15.5){\Huge Kernkraftwerk mit Druckwasserreaktor}
%----------------------------------------------------------------------------
\Reaktorgebaeude
\Maschinenhaus
\Kuehlturm
%----------------------------------------------------------------------------
%----------- Strommast und Verbindung der Leitung zum Traformator -----------
%----------------------------------------------------------------------------
\rput(-6,10){\Strommast}
\psbezier(ATL)(-4.8,10.5)(-7,11)(SML2)
\psbezier(ATM)(-3.5,11.2)(-4.5,11.5)(SMR1)
\psbezier(ATR)(-2.5,11.2)(-3.5,11.5)(SMR2)
%----------------------------------------------------------------------------
%------------------------------ Beschriftungen ------------------------------
%----------------------------------------------------------------------------
\rput(-7,8.2){Maschinenhaus}
\rput(-19,10){Reaktorgeb{\"a}ude}
\rput(-23.0,5){\shortstack[c]{%
\scriptsize Reaktor-\strut\\[-0.5ex]
\scriptsize druck-\strut\\[-0.5ex]
\scriptsize gef{\"a}{\ss}\strut}}
\rput(-18.95,2.3){\shortstack[c]{
\scriptsize Brenn-\strut\\[-0.5ex]
\scriptsize elemente\strut}
}
\psline(-20.4,2.5)(-19.65,2.5)
\rput(-21.0,7.8){\scriptsize Steuerst{\"a}be}
\rput(-19,7.25){\scriptsize Druckhalter}
\rput(-17.0,7.8){\scriptsize Dampferzeuger}
\rput(-17.0,0.5){\scriptsize Hauptk{\"u}hlkreis}
\rput(-13.3,7.8){\scriptsize Wasserdampf}
\rput(-13,3.3){\scriptsize Speisewasser}
\rput(-8.75,6.5){\scriptsize Turbine}
\rput(-4.5,6.5){\scriptsize Generator}
\rput(-1.95,9){\shortstack[c]{%
\scriptsize Trans-\strut\\[-0.5ex]
\scriptsize formator\strut}
}
\rput(-4.9,13.5){\scriptsize Strommast}
\rput(-5.75,4.4){\scriptsize Kondensator}
\rput(4,-0.4){\scriptsize K{\"u}hlturm}
\rput[r](1.3,2.5){\scriptsize Spr{\"u}hwasser}
\uput{2pt}[110](0,1){\scriptsize Luft}
\rput(4,5.5){\scriptsize Feuchte, warme Luft}
\uput{4pt}[90](-0.25,3.6){\scriptsize K{\"u}hlwasser}
\end{pspicture}
%}
\end{figure}

\end{document}


## Notes:

• It is safe to separate each key-value in its own line. An extra comma in the last item is not a typo. It is also safe to have a comma for each line.

\pscustom
[
fillstyle=solid,
fillcolor=blue!30,
opacity=0.35,
linestyle=none,
linearc=0.3,
]


or

\psset
{
plotpoints=1000,
linewidth=1.2pt,
linecolor=Kuehlturmwasser,
}


or

\pcline
[
linewidth=0.5pt,
arrowscale=1,
arrowinset=0.04,
arrowsize=0.08,
arrowlength=1.4,
linecolor=white,
]


or

\usepackage
{
pst-slpe,
pst-blur,
pst-eucl,
}


or

\documentclass
[
pstricks,
border=12pt,
]


or

\pstVerb
{
/x a def
/y b def
}%<--- but this comment is necessary when \pstVerb is specified in pspicture or \rput or \rnode, etc.

• It is safe (in my experience) to separate each PSTricks graphics command in each own line when you are working with pscustom as follows. Control words (such as \closepath) will eat spaces that follow, so they no longer need to be followed by % to remove the spaces.

\pscustom
[
...
]{
\psline(O1)(O2)
\pstArcnOAB{O0}{O2}{U5}
\psline(U5)(U4)
\psline(U1)(U2)
\pstArcnOAB{O0}{U2}{O5}
\psline(O5)(O4)
\closepath
}

• \pstVerb contributes a white space in pspicture and other graphics objects. Always put % after its closing curly brace }. Good practices are given as follows.

\pstVerb
{
...
}%

• In my experience, white spaces in \rput and \rnode are "dangerous". Always % to remove the unwanted white spaces. Good practices are given as follows.

\rput(2,2){%
...
}


or

\rnode{A}{%
...
}

• Now I'm trying to reinstall TeX Live 2013 so I'll tell you if it works for me when I'm done with it. – Svend Tveskæg Jun 23 '13 at 21:45
• Arrrrh! Of course it doesn't work when I put \rput outside the pspicture environment. (Your comments in the updated answer are great!) – Svend Tveskæg Jun 23 '13 at 22:26