summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/picture/picture.sty
blob: 14d2fee1654d3ba33c551551a5e1c1b959a35fae (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
%%
%% This is file `picture.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% picture.dtx  (with options: `package')
%% 
%% This is a generated file.
%% 
%% Project: picture
%% Version: 2019/12/09 v1.5
%% 
%% Copyright (C)
%%    2006-2009 Heiko Oberdiek
%%    2016-2019 Oberdiek Package Support Group
%% 
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either
%% version 1.3c of this license or (at your option) any later
%% version. This version of this license is in
%%    https://www.latex-project.org/lppl/lppl-1-3c.txt
%% and the latest version of this license is in
%%    https://www.latex-project.org/lppl.txt
%% and version 1.3 or later is part of all distributions of
%% LaTeX version 2005/12/01 or later.
%% 
%% This work has the LPPL maintenance status "maintained".
%% 
%% The Current Maintainers of this work are
%% Heiko Oberdiek and the Oberdiek Package Support Group
%% https://github.com/ho-tex/picture/issues
%% 
%% 
%% This work consists of the main source file picture.dtx
%% and the derived files
%%    picture.sty, picture.pdf, picture.ins, picture.drv,
%%    picture-example.tex.
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{picture}%
  [2019/12/09 v1.5 Dimens for picture macros (HO)]%
\def\Pc@calcname{calc}
\def\Pc@etexname{etex}
\def\Pc@plainname{plain}
\@ifpackageloaded{calc}{%
  \let\Pc@method\Pc@calcname
}{%
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname dimexpr\endcsname\relax
    \let\Pc@method\Pc@plainname
  \else
    \let\Pc@method\Pc@etexname
  \fi
}
\DeclareOption{plain}{%
  \let\Pc@method\Pc@plainname
}
\DeclareOption{etex}{%
  \begingroup\expandafter\expandafter\expandafter\endgroup
  \expandafter\ifx\csname dimexpr\endcsname\relax
    \PackageError{picture}{%
      e-TeX is not available%
    }\@ehc
  \else
    \let\Pc@method\Pc@etexname
  \fi
}
\DeclareOption{calc}{%
  \let\Pc@method\Pc@calcname
}
\ProcessOptions*
\begingroup
  \let\on@line\@empty
  \PackageInfo{picture}{Calculation method: \Pc@method}%
\endgroup
\ifx\Pc@method\Pc@calcname
  \RequirePackage{calc}%
\fi
\ifx\Pc@method\Pc@calcname
  \def\Pc@tokslength#1{%
    \begingroup
      \let\calc@error\Pc@calc@error
      \setlength\dimen@{#1\unitlength}\Pc@next\Pc@nil{#1}%
  }%
  \let\PcOrg@calc@error\calc@error
  \@ifpackagelater{calc}{2007/08/22}{% v4.3
    \def\Pc@calc@error#1{%
      \expandafter\ifx\expandafter\unitlength\noexpand#1\relax
        \def\calc@next##1!{%
          \endgroup
          \aftergroup\afterassignment
          \aftergroup\Pc@next
        }%
        \expandafter\@firstoftwo
      \else
        \expandafter\@secondoftwo
      \fi
      {%
        \calc@next{#1}%
      }{%
        \PcOrg@calc@error{#1}%
      }%
    }%
  }{%
    \def\Pc@calc@error#1{%
      \expandafter\ifx\expandafter\unitlength\noexpand#1\relax
        \def\calc@next##1!{%
          \endgroup
          \aftergroup\afterassignment
          \aftergroup\Pc@next
        }%
        \expandafter\@gobble
      \else
        \expandafter\@firstofone
      \fi
      {%
        \PcOrg@calc@error{#1}%
      }%
    }%
  }%
\fi
\ifx\Pc@method\Pc@etexname
  \def\Pc@tokslength#1{%
    \begingroup
      \afterassignment\Pc@next
      \dimen@=\dimexpr#1\unitlength\Pc@nil{#1}%
  }%
\fi
\ifx\Pc@method\Pc@plainname
  \def\Pc@tokslength#1{%
    \begingroup
      \afterassignment\Pc@next
      \dimen@=#1\unitlength\Pc@nil{#1}%
  }%
\fi
\def\Pc@next#1\Pc@nil#2{%
  \ifx\\#1\\%
    \endgroup
    \Pc@addtoks{{#2}}%
  \else
    \expandafter\endgroup
    \expandafter\Pc@addtoks\expandafter{%
      \expandafter{\the\dimen@\@gobble}%
    }%
  \fi
}
\let\Pc@nil\message
\def\Pc@addtoks#1{%
  \toks@=\expandafter{\the\toks@#1}%
}
\def\Pc@init#1{%
  \begingroup
    \toks@={#1}%
}
\def\Pc@finish#1{%
  \expandafter\endgroup
  \expandafter#1\the\toks@
}
\def\picture@redefine#1#2{%
  \begingroup
    \edef\reserved@a{%
      \noexpand\noexpand
      \expandafter\noexpand
          \csname PcOrg@\expandafter\@gobble\string#1\endcsname
    }%
    \toks0{#1}%
    \Pc@first#2&0%
}
\def\Pc@first#1&{%
  \toks1={#1}%
  \toks2={\Pc@init{#1}}%
  \Pc@scanlength
}
\def\Pc@scanlength#1{%
  \ifcase#1 %
    \expandafter\Pc@last
  \else
    \toks1=\expandafter{\the\toks1 ###1}%
    \toks2=\expandafter{\the\toks2 \Pc@tokslength{###1}}%
    \expandafter\Pc@scannext
  \fi
}
\def\Pc@scannext#1&{%
  \ifx\\#1\\%
  \else
    \toks1=\expandafter{\the\toks1 #1}%
    \toks2=\expandafter{\the\toks2 \Pc@addtoks{#1}}%
  \fi
  \Pc@scanlength
}
\def\Pc@last{%
  \edef\x{%
    \endgroup
    \let\reserved@a\the\toks0 %
    \def\the\toks0 \the\toks1 {%
      \the\toks2 %
      \noexpand\Pc@finish\reserved@a
    }%
  }%
  \x
}
\picture@redefine\@picture{(&1,&2)(&3,&4)}
\picture@redefine\put{(&1,&2)}
\picture@redefine\multiput{(&1,&2)}
\picture@redefine\@multiput{(&1,&2)}
\picture@redefine\line{(#1,#2)&3}
\picture@redefine\vector{(#1,#2)&3}
\picture@redefine\dashbox{&1(&2,&3)}
\picture@redefine\@circle{&1}
\picture@redefine\@dot{&1}
\picture@redefine\@bezier{#1(&2,&3)(&4,&5)(&6,&7)}
\picture@redefine\@imakepicbox{(&1,&2)}
\@ifpackageloaded{pspicture}{%
  \picture@redefine\@oval{[&1](&2,&3)}%
  \picture@redefine\Line{(&1,&2)}%
  \picture@redefine\Curve{(&1,&2)}%
  \picture@redefine\Vector{(&1,&2)}%
}{%
  \picture@redefine\@oval{(&1,&2)}%
}
\def\Pc@checkpackage#1{%
  \@ifpackageloaded{#1}{%
  }{%
    \AtBeginDocument{%
      \@ifpackageloaded{#1}{%
        \PackageWarningNoLine{picture}{%
          Package `#1' is loaded after `picture'.\MessageBreak
          Load package `picture' afterwards to get full support%
          \MessageBreak
          of its additional syntax with length specifications%
        }%
      }{}%
    }%
  }%
}
\Pc@checkpackage{pict2e}
\Pc@checkpackage{pspicture}
\endinput
%%
%% End of file `picture.sty'.