mgieseki / dvisvgm

A fast DVI, EPS, and PDF to SVG converter
https://dvisvgm.de
GNU General Public License v3.0
312 stars 34 forks source link

pstricks: PostScript error: undefined in NodeScale #257

Closed chrille69 closed 11 months ago

chrille69 commented 11 months ago

Hello,

i get the following error, if i try to compile the pstricks-command \pcline:

~/tmp$ dvisvgm -n herleitung-zeitdehnung-aus-doppler.dvi 
pre-processing DVI file (format version 2)
processing page 1
  PostScript error: undefined in NodeScale
  Operand stack:
      --nostringval--  false  N@@@A  10  --nostringval--

If you comment out the \pcline-lines, it work's.

Minimal example:

\documentclass{article}

\usepackage{newcent}
\usepackage{helvet}
\usepackage[german,ngerman]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[dvipsnames]{pstricks}
\usepackage{pst-all}
\usepackage{pst-math}
\usepackage{pst-eucl}
\usepackage{pstricks-add}
\usepackage[intlimits]{amsmath}
\usepackage{amssymb}

\begin{document}
\section*{Herleitung Zeitdehnung}
\subsection*{Variante I: Lichtuhr}
In einer Lichtuhr wird ein Photon zwischen zwei Spiegeln mit
Lichtgeschwindigkeit $c$ hin und her reflektiert. Sie bewegt sich quer zur
Spiegelachse mit der Geschwindigkeit $v$. Um welchen Faktor vergrößert sich
die Periodendauer der Lichtuhr?

\begin{center}
\begin{pspicture}(0,-.75)(8,2.5)
\psline(0,0)(1,0)
\psline(0,2)(1,2)
\psline[linestyle=dashed](1.5,0)(1.5,2)
\psline(2,0)(3,0)
\psline[linestyle=dotted](2,2)(3,2)
\psline[linestyle=dotted](5,0)(6,0)
\psline(5,2)(6,2)

\psdot(0.5,0)\psdot(0.5,2)
\psline[arrows=->,linewidth=.5pt](0.5,0)(0.5,2)
\psdot(2.5,0)\psdot(5.5,2)
\pcline[arrows=->,linewidth=.5pt](2.5,0)(5.5,2)\naput[nrot=:U]{$ct$}
\pcline[arrows=|->|,linewidth=.5pt,offset=-.15](2.5,0)(5.5,0)\nbput{$vt$}
\pcline[arrows=->,linewidth=.5pt](5.5,0)(5.5,2)\nbput{$ct'$}

\end{pspicture}
\end{center}
\end{document}

dvisvgm 3.1.2 (x86_64-pc-linux-gnu) brotli: 1.0.9 clipper: 6.2.1 freetype: 2.11.1 Ghostscript: 9.55.0 kpathsea: 6.3.4/dev potrace: 1.16 xxhash: 0.8.2 zlib: 1.2.11

muzimuzhi commented 11 months ago

Not reproducible with dvisvgm 3.0.3 (x86_64-apple-darwin18.7.0) here. Was your step to generate .dvi error free?

mgieseki commented 11 months ago

I can't reproduce the error with dvisvgm 3.1.2 and GS 9.55.0 either. Could you convert the DVI file with dvips and does Ghostscript display the generated PS file correctly?

chrille69 commented 11 months ago

Which PS file? I execute

latex file.tex
dvisvgm -n file.dvi

There is no PS file in the working directory. latex produces no errors.

mgieseki commented 11 months ago

As mentioned, please convert the DVI file with dvips instead of dvisvgm and run Ghostscript with it afterwards:

dvips file.dvi
gs file.ps

Does GS produce any error messages here?

chrille69 commented 11 months ago

OK. I moved to another computer with a fresh texlive installation and all went fine. There is an error in my environment. Sorry for the trouble.

mgieseki commented 11 months ago

No problem. Glad to hear, you could convert the file after all.

muzimuzhi commented 11 months ago
~/tmp$ dvisvgm -n herleitung-zeitdehnung-aus-doppler.dvi 
pre-processing DVI file (format version 2)
processing page 1
  PostScript error: undefined in NodeScale
  Operand stack:
      --nostringval--  false  N@@@A  10  --nostringval--

NodeScale is a PostScript procedure defined in TeX macro \tx@NewNode, which is then provided in pst-node.tex.

@chrille69 You may want to check the loaded version (and perhaps also location) of pst-node package.