summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pstricks/pst-news13.tex
blob: 0a40dd76b1193b84ffd5b4ea38ac85ef45fcb104 (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
%% $Id: pst-news13.tex 800 2013-07-09 18:01:00Z herbert $
\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings
    headexclude,footexclude,oneside]{pst-doc}
\listfiles
\let\Lfile\LFile
\usepackage[utf8]{inputenc}
\usepackage{pst-node,pst-plot}
\usepackage{xkvview}
\let\pstnodeFV\fileversion
\let\pstnodeFD\filedate
\renewcommand\bgImage{\psscalebox{15}{\color{blue!20}2013}}
\def\textat{\char064}
\lstset{explpreset={pos=l,width=-99pt,overhang=0pt,hsep=\columnsep,vsep=\bigskipamount,rframe={}},
    escapechar=?}
\begin{document}

%\psset{PstDebug=1}
\title{\texttt{News -- 2013}\\ \Large new macros and bugfixes for the
basic package \nxLFile{pstricks}}
\author{Herbert Voß}
\date{\today}

\maketitle

\clearpage
\tableofcontents

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

%--------------------------------------------------------------------------------------
\section{\texttt{pstricks.sty}}
%--------------------------------------------------------------------------------------

There are new optional arguments \Lkeyword{monochrome} and \Lkeyword{grayscale} to convert \emph{all} RGB and CMYK colors
into black and white or grayscale. The equations are:

\subsection{RGB to gray}
\[ \text{gray} = 0.07 \text{red} + 0.71 \text{green} + 0.21 \text{blue} \]

\subsection{CMYK to gray}
\begin{align*} 
    c &= c  (1 - k) + k\\
    m &= m  (1 - k) + k\\
    y &= y  (1 - k) + k\\
    r, g, b &= (1 - c), (1 - m), (1 - y)\\
  \text{gray} &= 0.299 r + 0.587 g + 0.114 b
\end{align*}

This change will be global and effects also all other color setting!
See section~\vref{subsec:monochrome} for a local change of the color output.

%--------------------------------------------------------------------------------------
\section{\texttt{pstricks.tex} (\pstricksFV -- \pstricksFD)}
%--------------------------------------------------------------------------------------
There is a new optional argument \Lkeyword{pgffunctions} for the environment \Lenv{pspicture}.
With this option one can force the loading of the special pgf PostScript function
which in some cases are missing, when using the package \LPack{auto-pst-pdf} and another
package which uses pgf macros.

\lstinline|\begin{pspicture}[pgffunctions,...](...)(...)|

\subsection{labelsep}
The \Lkeyword{labelsep} is the first -- optional -- argument of \Lcs{uput}. 
It is now possible to use the PostScript notation for this \emph{length}, eg \verb|{! 45 sin 3 mul}|.
Then the unit which is active when \Lcs{uput} is active is used. With a unit the PS notation
ist not allowed and leads to an error!



\subsection{Coordinates}
Additionally to the special pair of coordinates \verb|(*x f(x))| where $x$ must be a value in
PostScript notation and $f(x)$ in algebraic noatation, there is now a \verb|(**{f(y), y})| 
which is vice versa, $f(y)$ in algebraic and $y$ in PostScript notation. And there is also
a \verb|(+{x}, {f(x)})|, where both expressions must be in algebraic notation and \verb|{x}| must expand to a value
or an expression which uses known system or user defined PostScript functions.





\begin{LTXexample}[width=5cm]
\def\f(#1){#1^2} \def\y{2}
\begin{pspicture}[showgrid](5,5)
\pnode(+{sqrt(Pi),1.5*(sin(x)^2+cos(x)^2)}){A} 
\psdot(A) \psline[arrowscale=1.5]{->}(A)
\psline{->}(*2 {x^2})  \psline{->}(**{y^2} 2)
\psline(1,1)(**{\f(y)} 2.2)(2;45)(*2 {\f(x)})
\psline[linecolor=blue]{->}(+{sqrt(2),\f(x)}) 
\psline[linecolor=blue]{->}(+{sqrt(3)},{\f(x)}) 
\psline(+1,x+0.5)
\end{pspicture}
\end{LTXexample}


Important: If the expression contains itself a parenthesis like \verb|)| then the argument must
be inside braces; otherwise \TeX\ will take the first closing parenthesis as clsong delimiter 
for the complete coordinate argument \verb|(...)| which then gives an error.



\subsection{Fillstyle \texttt{dots}}
A fix for the fill style \Lkeyval{dots} to make it work again:

\begin{LTXexample}[width=5cm]
\pspicture(4,3) 
\psframe[fillstyle=dots](4,3) 
\endpspicture 
\end{LTXexample}

\subsection{New macro \nxLcs{psRing}}

\begin{BDef}
\LcsStar{psRing}\OptArgs\Largr{\CAny}\Largb{Inner Radius}\Largb{Outer Radius}
\end{BDef}


\begin{LTXexample}[width=5cm]
\begin{pspicture}[showgrid](4,4)
  \psRing[linecolor=red](2,2){0.3}{0.8}
  \psRing*[opacity=0.5](2,2){1}{2}
\psdot(2,2)
\end{pspicture}
\end{LTXexample}

\subsection{New macros \nxLcs{pssetMonochrome}, \nxLcs{pssetGrayscale},  and \nxLcs{psresetColor}}\label{subsec:monochrome}

\begin{BDef}
\Lcs{pssetMonochrome}\\
\Lcs{pssetGrayscale}\\
\Lcs{psresetColor}
\end{BDef}



\begin{LTXexample}[width=5cm]
\begin{pspicture}[showgrid](4,4)
  \pssetMonochrome%
  \psRing[linecolor=red](2,2){0.3}{0.8}
  \psRing*[linecolor=red!30](2,2){1}{2}
\psresetColor%
\psdot[linecolor=red,dotscale=3](2,2)
\end{pspicture}
\end{LTXexample}

\begin{LTXexample}[width=5cm]
\begin{pspicture}[showgrid](4,4)
  \pssetGrayscale%
  \psRing[linecolor=red](2,2){0.3}{0.8}
  \psRing*[linecolor=red!30](2,2){1}{2}
\psresetColor%
\psdot[linecolor=red,dotscale=3](2,2)
\end{pspicture}
\end{LTXexample}



\section{The PostScript header files}
\subsection{\nxLFile{pstricks.pro}}
%--------------------------------------------------------------------------------------

\clearpage
\part{Other packages}
\section{\texttt{pst-node} -- version \pstnodeFV\ | \pstnodeFD}

\ttfamily
1.27  2013-04-12 - added macro \Lcs{Cnodeput} which takes radius=...
                   into account\\
1.26  2013-04-09 - added macros \Lcs{psncurve} and \Lcs{psnccurve}
                   for a sequence of nodes created by \Lcs{curvepnodes}\\
1.25  2012-09-21 - Global node coordinates only with
                   saveNodeCoors

\rmfamily


\clearpage
\nocite{*}
\bibliographystyle{plain}
\bibliography{PSTricks}

\printindex


\end{document}