summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pstricks/pstricks.sty
blob: 69391b99323a0c9d6d2efbbdd1994e6d074a26bf (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
%%
%% This is file `pstricks.sty' based on the code of `pstcol.sty'.
%%
%% IMPORTANT NOTICE:
%%
%% pstricks.sty Copyright (C) 1997 Timothy Van Zandt
%% pstcol.sty   Copyright (C) 1994-1996 1999 David Carlisle
%% pstricks.sty Copyright (C) 2004-2005 Herbert Voss <voss@perce.de>
%%                                 Rolf Niepraschk <Rolf.Niepraschk@ptb.de>
%%
%% This package may be distributed under the terms of the LaTeX Project
%% Public License, as described in lppl.txt in the base LaTeX distribution.
%% Either version 1.0 or, at your option, any later version.
%%

\NeedsTeXFormat{LaTeX2e}

\ProvidesPackage{pstricks}
  [2005/10/07 v0.25 LaTeX wrapper for `PSTricks' (RN,HV)]
  
\DeclareOption{plain}{%
  \input{pstricks.tex}
    \ProvidesFile{pstricks.tex}
      [\filedate\space v\fileversion\space `PSTricks' (tvz)]
  \endinput
}
\DeclareOption*{\OptionNotUsed}

\ProcessOptions\relax

\@ifpackageloaded{pstcol}{}{\let\saved@gray\color@gray}

\@ifundefined{PSTricksLoaded}
{%
  \let\saved@scalebox\scalebox
  \input{pstricks.tex}
  \ProvidesFile{pstricks.tex}
    [\filedate\space v\fileversion\space `PSTricks' (tvz)]
  \@ifundefined{psscalebox}%
  {%
    \let\psscalebox=\scalebox
    \let\psscaleboxto=\scaleboxto
  }{}
  \let\scalebox\saved@scalebox
}{}

\def\pst@LaTeX@Setup{%
  \PassOptionsToPackage{override}{xcolor}
%
  \IfFileExists{xcolor.sty}%
    {\def\pst@ColorPackage{xcolor}}{\def\pst@ColorPackage{color}}%
%
  \newif\ifpst@DIA\pst@DIAfalse
  \DeclareOption{DIA}{\pst@DIAtrue}
  \DeclareOption{noxcolor}{\def\pst@ColorPackage{color}}
  \DeclareOption*{\PassOptionsToPackage\CurrentOption
    {\pst@ColorPackage}}
  \ProcessOptions\relax

  \RequirePackage{\pst@ColorPackage}
%
  \@ifpackageloaded{xcolor}{%
    \@ifpackagelater{xcolor}{2004/05/02}%
    {%
      \let\pst@getcolor\XC@getcolor
      \let\pst@usecolor\XC@usecolor
    }
    {%
      \PackageError{pstricks}{%
      *************************************************\MessageBreak
      * Your Version of `xcolor.sty' is too old!\MessageBreak
      * You need the version from 2004/05/02 or newer\MessageBreak
      * or use: \string\usepackage[noxcolor]{pstricks}\MessageBreak
      *************************************************}{}%
    }%
  }{%
    \def\pst@getcolor##1##2{%
      \@ifundefined{\string\color@##1}%
      {\@pstrickserr{Color `##1' not defined}\@eha}%
      {\edef##2{##1}}}%
    \def\pst@usecolor##1{\expandafter\expandafter\expandafter\c@lor@to@ps%
      \csname\string\color@##1\endcsname\@@\space}%
    \definecolor{darkgray}{gray}{.25}
    \definecolor{gray}{gray}{.5}
    \definecolor{lightgray}{gray}{.75}
  }%
%
  \definecolor{gradbegin}{rgb}{0,1,1}
  \definecolor{gradend}{rgb}{0,.1,.95}
%
  \@ifpackageloaded{pstcol}{%
    \psset@bordercolor{white}
    \psset@doublecolor{white}
    \psset@linecolor{black}
    \psset@fillcolor{white}
    \psset@hatchcolor{black}
    \psset@gridcolor{black}
    \psset@gridlabelcolor{black}
    \psset@shadowcolor{darkgray}
    \psset@subgridcolor{gray}
  }{}%
%
  \def\newgray##1##2{%
    \expandafter\gdef\csname ##1\endcsname{\color{##1}}%  HV 2004-03-31
    \edef\@tempa{\noexpand\definecolor{##1}{gray}{##2}}\@tempa%
    \expandafter\xdef\csname color@##1\endcsname{##2 setgray}%  HA 2005-02-24
  }%
  \def\newrgbcolor##1##2{%
    \expandafter\gdef\csname ##1\endcsname{\color{##1}}%  HV 2004-03-31
    \edef\@tempa{\noexpand\newrgbcolorx{##1}##2\noexpand\@@}\@tempa
    \expandafter\xdef\csname color@##1\endcsname{##2 setrgbcolor}%  HA 2005-02-24
  }
  \def\newrgbcolorx##1##2 ##3 ##4\@@{%
    \definecolor{##1}{rgb}{##2,##3,##4}}
  \def\newcmykcolor##1##2{%
    \expandafter\gdef\csname ##1\endcsname{\color{##1}}%  HV 2004-03-31
    \edef\@tempa{\noexpand\newcmykcolorx{##1}##2\noexpand\@@}\@tempa
    \expandafter\xdef\csname color@##1\endcsname{##2 setcmykcolor}%  HA 2005-02-24
  }%
  \def\newcmykcolorx##1##2 ##3 ##4 ##5\@@{%
    \definecolor{##1}{cmyk}{##2,##3,##4,##5}}
  \def\newhsbcolor##1##2{%
    \expandafter\gdef\csname ##1\endcsname{\color{##1}}%  HV 2004-03-31
    \edef\@tempa{\noexpand\newhsbcolorx{##1}##2\noexpand\@@}\@tempa
    \expandafter\xdef\csname color@##1\endcsname{##2 sethsbcolor}%  HA 2005-02-24
  }%
  \def\newhsbcolorx##1##2 ##3 ##4\@@{%
    \definecolor{##1}{hsb}{##2,##3,##4}}%
%
  \renewcommand\black{\color{black}}
  \renewcommand\darkgray{\color{darkgray}}
  \renewcommand\gray{\color{gray}}
  \renewcommand\lightgray{\color{lightgray}}
  \renewcommand\white{\color{white}}
  \renewcommand\blue{\color{blue}}
  \renewcommand\red{\color{red}}
  \renewcommand\green{\color{green}}
  \renewcommand\yellow{\color{yellow}}
  \renewcommand\magenta{\color{magenta}}
  \renewcommand\cyan{\color{cyan}}
%
  \let\pst@LaTeX@Setup=\relax%
}

\@ifpackageloaded{pstcol}% Is our package called from `pstcol'?
{%
%  We use our own definitions even if `pstcol' is in the first
%  place (adding to pstcol's \AtEndOfPackage hook). RN 2004-05-02
  \expandafter\g@addto@macro\csname pstcol.sty-h@@k\endcsname{%
    \pst@LaTeX@Setup}%
}%
{%
  \let\color@gray\saved@gray%
% Dummy version entry for `pstcol' to prevent forther loading. RN 2004-04-22
  \@namedef{ver@pstcol.sty}{1938/01/10}% The birthday of Don Knuth
  \PassOptionsToPackage{usenames}{color}
  \pst@LaTeX@Setup%
}

\AtBeginDocument{%
  \@ifpackageloaded{pstcol}%
  {%
    \@ifpackagelater{pstcol}{1938/01/11}{% Really loaded? RN 2004-04-22
      \PackageWarningNoLine{pstricks}{%
      *************************************************\MessageBreak
      * The installed version of `pstricks.sty' doesn't\MessageBreak
      * need `pstcol' any more. You should write only:\MessageBreak
      * \@spaces\string\usepackage{pstricks}\MessageBreak
      *************************************************}
    }{\expandafter\let\csname ver@pstcol.sty\endcsname\relax}%
  }{}%
%  \ifpst@DIA\else\@ifundefined{saved@scalebox}{}{\let\scalebox=\saved@scalebox}\fi%
  \let\pst@endcolor=\relax%
% LaTeX used `\color@endgroup' instead. RN 2004-05-06
}
%
\endinput
%%
%% End of file `pstricks.sty'.