summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pstricks/pst-news22.tex
blob: c345ccfbb581e4d13893d5c5bd1d7d303962b239 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
%% $Id: pst-news21.tex 382 2021-12-29 19:19:18Z herbert $
\listfiles
\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{}
\documentclass[11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false,headings=small,
    headinclude=false,footinclude=false,twoside,usegeometry,dvipsnames]{pst-doc}
    
\usepackage{libertinus}
\usepackage{hvlogos}
\listfiles
%\usepackage[svgnames,dvipsnames,x11names,pspdf=-dALLOWPSTRANSPARENCY]{pstricks-pdf}
\usepackage{showexpl,pst-arrow,pst-plot,pst-geometrictools}
\lstset{explpreset={pos=l,width=-99pt,overhang=0pt,hsep=\columnsep,vsep=\bigskipamount,rframe={},extendedchars},
    escapechar=?}

\usepackage{biblatex}
\addbibresource{PSTricks.bib}
\def\Lcs#1{\texttt{\textbackslash#1}}
\begin{document}

\title{\texttt{News -- \the\year}\\ \Large new macros and bugfixes for the basic package.}
\author{Herbert Voß}
\date{\today}

\settitle

\tableofcontents

\part{\texttt{pstricks} -- package}

This version of the News was run with \verb|lualatex| \emph{without} using Ghostscript.
The PDF file was created in a direkt way by Lua. If you want to try it, then look
at \url{https://github.com/zauguin/luapstricks}.

By default the dots are now taken from a Type1 version of the font file. For
lualatex it uses the OpenType version.

The dot part is now in an own file \texttt{pstricks-dots.tex}.





%--------------------------------------------------------------------------------------
\section{\texttt{pstricks.sty}}
%--------------------------------------------------------------------------------------
The optional argument \texttt{gsfonts} can be used to load only the symbol font from GhostScript.
Otherwise the one from URW or the system is used, which is the default.



%--------------------------------------------------------------------------------------
\section{\texttt{pstricks.tex} (v. 3.13 -- 2022/01/09)}
%--------------------------------------------------------------------------------------

\subsection{Presetting of \nxLkeyval{dimen} for circles}
Some years ago the behaviour changed and \Lkeyset{dimen=middle} was preset for circles and ovals.
It is now reverted to the old behaviour where all PSTricks objects have the presetting \Lkeyset{dimen=outer}.


\subsection{Coordinates}
By default the coordinates \verb|(10,10)| are used if the environment \Lenv{pspicture}
is called without any given coordinates. This behaviour can be changed if you are running
the document with \Lprog{lualatex}. Then you can use the optional argument \Lkeyword{calcframe}
to allow the internal calculation of the box width and height. it needs two \Lprog{lualatex}
runs to get the coordinates. The values are written into a file \verb|\jobname-<No>.psaux| and read
in the next run.

With the optional argument \Lkeyword{margin} it is possible to add white space to the calculated coordinates.
The keyword must be set with the command \Lcs{psset} \emph{before} the environment \Lenv{pspicture}, otherwise it is too late.

\begin{itemize}
\item \verb|margin=5mm| will add 5mm on all sides of the box.
\item \verb|margin={5mm,1cm}| will add 5mm on the left side and 1cm on the lower side of the box.
\item \verb|margin={2mm,3,4,5pt}| will add 2mm on the left, 3\Lcs{psunit} at the bottom, 4\Lcs{psunit} on
the right and 5pt on the top of the box. With the optional argument \Lkeyword{showframe} the calculated
box coordinates can be visible. Additional white space is marked by a box with dashed lines.
\end{itemize}

Without a given unit all values are used with the current defined PSTricks unit. But remember
that this will only work with \Lprog{lualatex}.

The following example shows the same curve, but with different coordinates.

\begin{LTXexample}[pos=t,width=\linewidth]
\def\dataV{6.8 -1 5.9 -2 5.4 -3 5.7 -4 6.2 -5} % original
\def\dataW{6.8 4 5.9 3 5.4 2 5.7 1 6.2 0}      % x>= 0
\def\dataU{1.4 4 0.5 3 0 2 0.3 1 0.8 0}        % x>=0 und y>=0
\psset{calcframe,showframe}% must be set before pspicture
X\begin{pspicture}[showgrid]
   \listplot[plotstyle=curve, showpoints]{\dataU} \rput(1,-0.5){default dataU}
\end{pspicture}X \hfill X%
\begin{pspicture}[showgrid]
   \listplot[plotstyle=curve, showpoints]{\dataW} \rput(6,-0.5){default dataW}
\end{pspicture}X \hfill X%
\begin{pspicture}[showgrid]
   \listplot[plotstyle=curve, showpoints]{\dataV} \rput(6,-5.5){default dataV}
\end{pspicture}X

\vspace{1cm}
X\begin{pspicture}[showgrid,margin=0.5]
   \listplot[plotstyle=curve, showpoints]{\dataU} \rput(1,5){margin=0.5}
\end{pspicture}X \hfill X%
\begin{pspicture}[showgrid,margin={0.5,1}]
   \listplot[plotstyle=curve, showpoints]{\dataW} \rput(6,4.5){margin={0.5 1}}
\end{pspicture}X \hfill X%
\begin{pspicture}[showgrid,margin={5mm,1,15mm,2}]
   \listplot[plotstyle=curve, showpoints]{\dataV} \rput(6,-0.5){margin={5mm,1,15mm,2}}
\end{pspicture}X
\end{LTXexample}

Only PSTricks objects are taken into account for calculating the bounding box. All stuff
which is placed on \TeX-level like any text with for example \Lcs{rput} cannot not be
used for calculating the correct coordinates. With setting additional whitespace with
the optional argument \Lkeyword{margin} the boxsize can be modified.

\newpsstyle{Parallelen}{country=G,ProLineCol=cyan,ProFillCol=gray!50,
  OwnerTxt=Pythagoras,MadeTxt={Geodreieck},RulerFillCol=cyan!40}
\psscalebox{0.5}{%
  \psset{calcframe,margin=5mm}%
  \begin{pspicture}[showgrid]%  no coordinates are given
  \pnode(5,5){A}\uput[90](A){A}
  \pnode(-8,1){B}\uput[90](B){B}
  \pnode(3,3){C}\uput[250](C){C} 
  \pcline[linecolor=BrickRed,nodesepA=-2,nodesepB=-2](A)(B) 
  \psParallels[style=Parallelen,RulerScale=0.75,ProScale=0.75](A)(B)(C) 
  \pcline[linecolor=BrickRed](GeodrB)(GeodrA)% 
  \midAB(GeodrB)(GeodrA){M}% 
  \psPencil[PenLength=5,pencilColA=red,PenScale=0.5]{60}(M) 
\end{pspicture}}


\begin{lstlisting}
\psscalebox{0.5}{%
  \psset{calcframe}%
  \begin{pspicture}[showgrid]%  no coordinates are given
  \pnode(5,5){A}\uput[90](A){A}
  \pnode(-8,1){B}\uput[90](B){B}
  \pnode(3,3){C}\uput[250](C){C} 
  \pcline[linecolor=BrickRed,nodesepA=-2,nodesepB=-2](A)(B) 
  \psParallels[style=Parallelen,RulerScale=0.75,ProScale=0.75](A)(B)(C) 
  \pcline[linecolor=BrickRed](GeodrB)(GeodrA)% 
  \midAB(GeodrB)(GeodrA){M}% 
  \psPencil[PenLength=5,pencilColA=red,PenScale=0.5]{60}(M) 
\end{pspicture}}
\end{lstlisting}



\subsection{Colors}

There are two new macros to get the color values:

\begin{verbatim}
\psgetRGBColorValues{<color macro>}
\psgetCMYKColorValues{<color macro>}
\end{verbatim}

An Example:

\begin{LTXexample}[width=5cm]
\psset{linecolor=red!40}
\psgetRGBColorValues{\pslinecolor}

\colorlet{Blue}[cmyk]{blue}
\psset{linecolor=Blue!40}
\psgetCMYKColorValues{\pslinecolor}
\end{LTXexample}


\subsection{Arrows}


There are new arrow types and a new optional argument \texttt{tipcolor}:


\begin{LTXexample}[width=5cm]
\begin{pspicture}[showgrid](4.2,3.25)
\psline{-T>}(0,1)(4,1)
\psline[arrowscale=2]{<T-T>}(0,2)(4,2)
\psline[tipcolor=red,arrowscale=2]{<T-}(0,3)(4,3)
\end{pspicture}
\end{LTXexample}



\LPack{pstricks} defines the following "`arrows"':

  \def\myline#1{\psline[linecolor=red,linewidth=0.5pt,arrowscale=1.5]{#1}(0,1ex)(1.3,1ex)}%
  \def\mylineA#1{\psline[linecolor=red,linewidth=0.5pt,arrowscale=4.5]{#1}(0,1ex)(2,1ex)}%
  \psset{arrowscale=1.5}
  \begin{longtable}{@{} c @{\qquad} p{3cm} l @{}}%
    Value & Example & Name \\[2pt]\hline
    \Lnotation{-}      & \myline{-}      & None\\
    \Lnotation{<->}    & \myline{<->}    & Arrowheads.\\
    \Lnotation{>-<}    & \myline{>-<}    & Reverse arrowheads.\\
    \Lnotation{<{<}-{>}>}  & \myline{<<->>}  & Double arrowheads.\\
    \Lnotation{{>}>-{<}<}  & \myline{>>-<<}  & Double reverse arrowheads.\\
    \Lnotation{{|}-{|}}    & \myline{|-|}    & T-bars, flush to endpoints.\\
    \Lnotation{{|}*-{|}*}  & \myline{|*-|*}  & T-bars, centered on endpoints.\\
    \Lnotation{[-]}    & \myline{[-]}    & Square brackets.\\
    \Lnotation{]-[}    & \myline{]-[}    & Reversed square brackets.\\
    \Lnotation{(-)}    & \myline{(-)}    & Rounded brackets.\\
    \Lnotation{)-(}    & \myline{)-(}    & Reversed rounded brackets.\\
    \Lnotation{o-o}    & \myline{o-o}    & Circles, centered on endpoints.\\
    \Lnotation{*-*}    & \myline{*-*}    & Disks, centered on endpoints.\\
    \Lnotation{oo-oo}  & \myline{oo-oo}  & Circles, flush to endpoints.\\
    \Lnotation{**-**}  & \myline{**-**}  & Disks, flush to endpoints.\\
    \Lnotation{{|}<->{|}}  & \myline{|<->|}  & T-bars and arrows.\\
    \Lnotation{{|}>-<{|}}  & \myline{|>-<|}  & T-bars and reverse arrows.\\
    \Lnotation{h-h{}}   & \myline{h-h}    & left/right hook arrows.\\
    \Lnotation{H-H{}}   & \myline{H-H}    & left/right hook arrows.\\
    \Lnotation{v-v}   & \myline{v-v}    & left/right inside vee arrows.\\
    \Lnotation{V-V}   & \myline{V-V}    & left/right outside vee arrows.\\
    \Lnotation{f-f}   & \myline{f-f}    & left/right inside filled arrows.\\
    \Lnotation{F-F}   & \myline{F-F}    & left/right outside filled arrows.\\
    \Lnotation{t-t}   & \myline{t-t}    & left/right inside slash arrows.\\[5pt]
    \Lnotation{T-T}   & \myline{T-T}    & left/right outside slash arrows.\\
%
    \Lnotation{<D-D>}   & \mylineA{<D-D>}    & curved  arrows.\\
    \Lnotation{<D<D-D>D>}   & \mylineA{<D<D-D>D>}    & curved doubled arrows.\\
    \Lnotation{D>-<D}   & \mylineA{D>-<D}    & curved  arrows, tip inside.\\
    \Lnotation{<T-T>}   & \myline{<T-T>}    & curved lines.\\
%    \Lnotation{>T-T<}   & \mylineA{>T-T<}    & \TikZ\ like arrows.\\
    \hline
  \end{longtable}




%\@namedef{psas@T>}{ false \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@ArrowT }%	hv 20210531
%\@namedef{psas@<T}{ %	hv 20071211
%  true \psk@arrowinset \psk@arrowlength \psk@arrowsize \tx@ArrowT
%}


With version 3.04 all arrow specific base code is moved to the file \LPack{pstricks-arrows}, which
is not of interest for the default user..

\subsection{Symbolfont}


Use by default the URW or system symbol font for \Lcs{psdot}. This can be changes by using
the optional argument \texttt{gsfonts}:

\begin{verbatim}
\usepackage[gsfonts]{pstricks}
\end{verbatim}

\TeX-users have to define the switch and

\begin{verbatim}
\newif\ifpstGSfonts
\pstGSfontsfalse % or true for using GS font

\input pstricks
...
\end{verbatim}


\subsection{Fillstyle \texttt{penrose}}

There was a bug if this fillstyle was used together with a line sequence.


\psset{unit=1cm}
\centering\vspace{5cm}
\pspicture[showgrid=false](-0.5\linewidth,-4.5)(0.5\linewidth,5)
\rput(0,0){\parbox{4.5cm}{%
  \psclip{\psccurve[linestyle=none,fillstyle=penrose,psscale=.2](-3,-2)%
  (0.3,-1.5)(2.3,-2)(4.3,-1.5)(6.3,-2)(8,-1.5)(8,2)(-3,2)}
  ``One of the best new plays I have seen all year: cool, poetic,
  ironic \ldots'' proclaimed \emph{The Guardian} upon the London
  premiere of this extraordinary play about a Czech director and
  his actress wife, confronting exile in America.
  \endpsclip}}
  \psline[linearc=0.5cm,showpoints=true,dotstyle=|]{<<->>}(-1,-2)(0,-4)(1,-2)
\endpspicture



\begin{lstlisting}
\pspicture[showgrid=false](-0.5\linewidth,-4.5)(0.5\linewidth,5)
\rput(0,0){\parbox{4.5cm}{%
  \psclip{\psccurve[linestyle=none,fillstyle=penrose,psscale=.2](-3,-2)
  (0.3,-1.5)(2.3,-2)(4.3,-1.5)(6.3,-2)(8,-1.5)(8,2)(-3,2)}
 ``One of the best new plays I have seen all year: cool, poetic,
  ironic \ldots'' proclaimed \emph{The Guardian} upon the London
  premiere of this extraordinary play about a Czech director and
  his actress wife, confronting exile in America.
  \endpsclip}}%
  \psline[linearc=0.5cm,showpoints=true,dotstyle=|]{<<->>}(-1,-2)(0,-4)(1,-2)
\endpspicture
\end{lstlisting}


\iffalse



\pspicture[showgrid=false](-0.5\linewidth,-4.5)(0.5\linewidth,5)
\rput(0,0){\parbox{4.5cm}{%
  \psclip{\psccurve[linestyle=none,fillstyle=penroseA,psscale=.2](-3,-2)
  (0.3,-1.5)(2.3,-2)(4.3,-1.5)(6.3,-2)(8,-1.5)(8,2)(-3,2)}\color{white}
  ``One of the best new plays I have seen all year: cool, poetic,
  ironic \ldots'' proclaimed \emph{The Guardian} upon the London
  premiere of this extraordinary play about a Czech director and
  his actress wife, confronting exile in America.
  \endpsclip}}%
  \psline[linearc=0.5cm,showpoints=true,dotstyle=|]{<<->>}(-1,-2)(0,-4)(1,-2)
\endpspicture

\begin{lstlisting}
\pspicture[showgrid=false](-0.5\linewidth,-4.5)(0.5\linewidth,5)
\rput(0,0){\parbox{4.5cm}{%
  \psclip{\psccurve[linestyle=none,fillstyle=penrose,psscale=.2](-3,-2)
  (0.3,-1.5)(2.3,-2)(4.3,-1.5)(6.3,-2)(8,-1.5)(8,2)(-3,2)}\color{white}
  ``One of the best new plays I have seen all year: cool, poetic,
  ironic \ldots'' proclaimed \emph{The Guardian} upon the London
  premiere of this extraordinary play about a Czech director and
  his actress wife, confronting exile in America.
  \endpsclip}}%
  \psline[linearc=0.5cm,showpoints=true,dotstyle=|]{<<->>}(-1,-2)(0,-4)(1,-2)
\endpspicture\end{lstlisting}


\fi


\section{\LuaLaTeX}\label{lua}
Currently one has to use package \LPack{auto-pst-pdf-lua} if a document with
\PSTricks-code should be run \emph{directly} with  \LuaLaTeX, without using
GhostScript. This version has experimental basic support for the lua package
\LPack{luapstricks.lua}, available from \url{https://github.com/zauguin/luapstricks}.

\nocite{*}
\printbibliography


\end{document}