[pstricks] Opening a data file with postscript
Herbert Voss
Herbert.Voss at fu-berlin.de
Sat Sep 21 09:33:31 CEST 2024
please write always to the list and provide also full working examples!
Am 21.09.24 um 08:15 schrieb Poul Riis:
> So you would expect the following to work? It does not on my computer!?
>
> \documentclass[a4paper,14pt]{article}
> \usepackage[x11names]{xcolor}
> \usepackage{pstricks-add}
>
>
> \begin{document}
> ~
> \pstverb{/Times-Roman findfont 12 scalefont setfont
> /hubblearray [ (hubble.txt) run ] def
> %hubblearray 1 get 20 string cvs show
> hubblearray 1 get show
the elements of the array are numbers. The reason why you need
the commented line:
\documentclass[a4paper,14pt]{article}
\usepackage[x11names]{xcolor}
\usepackage{pstricks-add}
\begin{filecontents}[noheader,force]{hubble.txt}
1.1
1.2
1.3
1.4
\end{filecontents}
\begin{document}
~
\pstverb{/Times-Roman findfont 12 scalefont setfont
/hubblearray [ (hubble.txt) run ] def
hubblearray 1 get 20 string cvs show
100 0 moveto
(Hello!) show
100 10 moveto
100 2 neg moveto
130 2 neg lineto stroke
showpage
}
\end{document}
Herbert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bildschirmfoto 2024-09-21 um 09.30.10.png
Type: image/png
Size: 7336 bytes
Desc: not available
URL: <https://tug.org/pipermail/pstricks/attachments/20240921/a201b0f9/attachment.png>
More information about the PSTricks
mailing list.