summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/coordsys/logsys.sty
blob: ac8a978bba783d8f07f668d8ffec8fde331f8df1 (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
%%
%% This is file `logsys.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% coordsys.dtx  (with options: `logsys')
%% 
%% 
%%  This is the coordsys and logsys packages
%%  Copyright 2000-06 by Mogens Lemvig Hansen,
%%                       mlhansen@uniserve.com
%% 
%% This program may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version. The latest
%% version of this license is in
%%   http://www.latex-project.org/lppl.txt
%% and version 1.2 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%% 
%% This program consists of the files coordsys.dtx and coordsys.ins
%% 
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{logsys}[2006/02/03 version 1.4]
\DeclareOption{centred}{\PassOptionsToPackage{centred}{coordsys}}
\DeclareOption{outside}{\PassOptionsToPackage{outside}{coordsys}}
\DeclareOption{inside}{\PassOptionsToPackage{inside}{coordsys}}
\ProcessOptions
\RequirePackage{coordsys}[2006/02/03]
\newcommand{\loglabel}[1]{%
   \ifnum      #1=-2\relax \frac{1}{100}%
   \else\ifnum #1=-1\relax \frac{1}{10}%
   \else\ifnum #1= 0\relax 1%
   \else\ifnum #1= 1\relax 10%
   \else\ifnum #1= 2\relax 100%
   \else                   10^{#1}%
   \fi\fi\fi\fi\fi}
\newcommand{\v@logbox}[2]{%
   \vbox to #1\unitlength{%
      \offinterlineskip
      \vskip \z@ plus  458fil\relax
      \vbox to \z@{\vss\hbox{#2}\vss}%  9
      \vskip \z@ plus  512fil\relax
      \vbox to \z@{\vss\hbox{#2}\vss}%  8
      \vskip \z@ plus  580fil\relax
      \vbox to \z@{\vss\hbox{#2}\vss}%  7
      \vskip \z@ plus  669fil\relax
      \vbox to \z@{\vss\hbox{#2}\vss}%  6
      \vskip \z@ plus  792fil\relax
      \vbox to \z@{\vss\hbox{#2}\vss}%  5
      \vskip \z@ plus  969fil\relax
      \vbox to \z@{\vss\hbox{#2}\vss}%  4
      \vskip \z@ plus 1249fil\relax
      \vbox to \z@{\vss\hbox{#2}\vss}%  3
      \vskip \z@ plus 1761fil\relax
      \vbox to \z@{\vss\hbox{#2}\vss}%  2
      \vskip \z@ plus 3010fil\relax
   }}
\newcommand{\h@logbox}[2]{%
   \hbox to #1\unitlength{%
      \hskip \z@ plus 3010fill\relax
      \hbox to \z@{\hss #2\hss}%  2
      \hskip \z@ plus 1761fill\relax
      \hbox to \z@{\hss #2\hss}%  3
      \hskip \z@ plus 1249fill\relax
      \hbox to \z@{\hss #2\hss}%  4
      \hskip \z@ plus  969fill\relax
      \hbox to \z@{\hss #2\hss}%  5
      \hskip \z@ plus  792fill\relax
      \hbox to \z@{\hss #2\hss}%  6
      \hskip \z@ plus  669fill\relax
      \hbox to \z@{\hss #2\hss}%  7
      \hskip \z@ plus  580fill\relax
      \hbox to \z@{\hss #2\hss}%  8
      \hskip \z@ plus  512fill\relax
      \hbox to \z@{\hss #2\hss}%  9
      \hskip \z@ plus  458fill\relax
   }}
\newcommand{\@sethlogticks}[5]{%
   \thin@ticks
   \@tempcnta=#2\relax
   \ifnum\@tempcnta>0\advance\@tempcnta -1\relax\fi
   \divide\@tempcnta #1\relax
   \ifnum #2>0\advance\@tempcnta 1\relax\fi
   \multiply\@tempcnta #1\relax
   \edef\coordsys@a{\the\@tempcnta}%
   \@tempcntb=#3\relax
   \ifnum\@tempcnta<\@tempcntb\relax
      \advance\@tempcntb -\@tempcnta\relax
      \divide\@tempcntb #1\relax
      \edef\coordsys@b{\the\@tempcntb}%
      \multiput(\coordsys@a,#4)(#1,0)\coordsys@b
         {\h@logbox{#1}{#5}}%
      \thick@ticks
      \@tempcntb=\coordsys@b\relax
      \advance\@tempcntb 1\relax
      \edef\coordsys@b{\the\@tempcntb}%
      \multiput(\coordsys@a,#4)(#1,0)\coordsys@b
         {#5}%
      \if@numbline
         \setcounter{@coord}{\coordsys@a}%
         \divide\c@@coord #1\relax
         \multiput(\coordsys@a,#4)(#1,0)\coordsys@b{%
            \sethlabel{\loglabel{\arabic{@coord}}}%
            \stepcounter{@coord}}%
      \fi
   \fi
}
\newcommand{\@setvlogticks}[5]{%
   \thin@ticks
   \@tempcnta=#2\relax
   \ifnum\@tempcnta>0\advance\@tempcnta -1\relax\fi
   \divide\@tempcnta #1\relax
   \ifnum #2>0\advance\@tempcnta 1\relax\fi
   \multiply\@tempcnta #1\relax
   \edef\coordsys@a{\the\@tempcnta}%
   \@tempcntb=#3\relax
   \ifnum\@tempcnta<\@tempcntb\relax
      \advance\@tempcntb -\@tempcnta\relax
      \divide\@tempcntb #1\relax
      \edef\coordsys@b{\the\@tempcntb}%
      \multiput(#4,\coordsys@a)(0,#1)\coordsys@b
         {\v@logbox{#1}{#5}}%
      \thick@ticks
      \@tempcntb=\coordsys@b\relax
      \advance\@tempcntb 1\relax
      \edef\coordsys@b{\the\@tempcntb}%
      \multiput(#4,\coordsys@a)(0,#1)\coordsys@b
         {#5}%
      \if@numbline
         \setcounter{@coord}{\coordsys@a}%
         \divide\c@@coord #1\relax
         \multiput(#4,\coordsys@a)(0,#1)\coordsys@b{%
            \setvlabel{\loglabel{\arabic{@coord}}}%
            \stepcounter{@coord}}%
      \fi
   \fi
}
\newcommand{\logline}{%
   \@ifstar{\@numblinefalse\hlogline@i}
           {\@numblinetrue \hlogline@i}}
\newcommand{\hlogline@i}[1][50]{\leavevmode\hlogline@ii{#1}}
\newcommand{\hlogline@ii}[3]{{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \put(#2,0){\vector(1,0){\coordsys@w}}%
   \@sethlogticks{#1}{#2}{#3}{0}{\vtickmark}
   \color@endgroup}%
   \def\coordsys@w{0}%
}
\newcommand{\vlogline}{%
   \@ifstar{\@numblinefalse\vlogline@i}
           {\@numblinetrue \vlogline@i}}
\newcommand{\vlogline@i}[1][50]{\leavevmode\vlogline@ii{#1}}
\newcommand{\vlogline@ii}[3]{{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(0,#2){\vector(0,1){\coordsys@h}}%
   \@setvlogticks{#1}{#2}{#3}{0}{\htickmark}
   \color@endgroup}%
   \def\coordsys@h{0}%
}
\newcommand{\logsys}{%
   \def\coordsys@c{\logsys@i}%
   \def\@hticksep{10}%
   \def\@vticksep{50}%
   \@ifstar{\@numblinefalse\logsys@args@i}
           {\@numblinetrue \logsys@args@i}}
\newcommand{\logsys@args@i}[1][\@hticksep]{\leavevmode
   \edef\@hticksep{#1}%
   \logsys@args@ii}
\newcommand{\logsys@args@ii}[1][\@vticksep]{%
   \edef\@vticksep{#1}%
   \coordsys@args@iii}
\def\logsys@i#1#2(#3,#4){{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \put(#1,#2){\vector(1,0){\coordsys@w}}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(#1,#2){\vector(0,1){\coordsys@h}}%
   \@set@ticks{\hthickratio}{\@hticksep}{#1}{#3}{6\p@}{%
      \multiput(\coordsys@a,#2)(\coordsys@c,0)\coordsys@b\vtickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(\coordsys@a,#2)(\coordsys@c,0)\coordsys@b{%
         \edef\coordsys@a{\arabic{@coord}}%
         \sethlabel{\hlabel{\coordsys@a}}%
         \addtocounter{@coord}{\coordsys@c}}%
   \fi
   \@setvlogticks{\@vticksep}{#2}{#4}{#1}{\htickmark}%
   \color@endgroup}%
   \def\coordsys@h{#1}%
   \def\coordsys@w{#2}%
}
\newcommand{\semilogsys}{%
   \def\coordsys@c{\semilogsys@i}%
   \def\@hticksep{50}%
   \def\@vticksep{10}%
   \@ifstar{\@numblinefalse\logsys@args@i}
           {\@numblinetrue \logsys@args@i}}
\def\semilogsys@i#1#2(#3,#4){{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \put(#1,#2){\vector(1,0){\coordsys@w}}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(#1,#2){\vector(0,1){\coordsys@h}}%
   \@sethlogticks{\@hticksep}{#1}{#3}{#2}{\vtickmark}%
   \@set@ticks{\vthickratio}{\@vticksep}{#2}{#4}{6\p@}{%
      \multiput(#1,\coordsys@a)(0,\coordsys@c)\coordsys@b\htickmark}%
   \if@numbline
      \setcounter{@coord}{\coordsys@a}%
      \multiput(#1,\coordsys@a)(0,\coordsys@c)\coordsys@b{%
         \edef\coordsys@a{\arabic{@coord}}%
         \setvlabel{\vlabel{\coordsys@a}}%
         \addtocounter{@coord}{\coordsys@c}}%
   \fi
   \color@endgroup}%
   \def\coordsys@h{#1}%
   \def\coordsys@w{#2}%
}
\newcommand{\loglogsys}{%
   \def\coordsys@c{\loglogsys@i}%
   \def\@hticksep{50}%
   \def\@vticksep{50}%
   \@ifstar{\@numblinefalse\logsys@args@i}
           {\@numblinetrue \logsys@args@i}}
\def\loglogsys@i#1#2(#3,#4){{\color@begingroup
   \thinlines
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \put(#1,#2){\vector(1,0){\coordsys@w}}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \put(#1,#2){\vector(0,1){\coordsys@h}}%
   \@sethlogticks{\@hticksep}{#1}{#3}{#2}{\vtickmark}%
   \@setvlogticks{\@vticksep}{#2}{#4}{#1}{\htickmark}%
   \color@endgroup}%
   \def\coordsys@h{#1}%
   \def\coordsys@w{#2}%
}
\newcommand{\loggrid}{%
   \def\@hticksep{10}%
   \def\@vticksep{50}%
   \@numblinefalse
   \@ifstar{\def\coordsys@c{\loggrid@ii}\logsys@args@i}
           {\def\coordsys@c{\loggrid@i}\logsys@args@i}}
\def\loggrid@i#1#2(#3,#4){{\color@begingroup
   \coordgrid@calc
   \grid@style
   \@set@ticks{\hthickratio}{\@hticksep}{#1}{#3}{\z@}{%
      \multiput(\coordsys@a,0)(\coordsys@c,0)\coordsys@b
         {\vgridfromto{#2}{#4}}}%
   \@setvlogticks{\@vticksep}{#2}{#4}{0}{\hgridfromto{#1}{#3}}%
   \color@endgroup}}
\def\loggrid@ii#1#2(#3,#4){{\color@begingroup
   \grid@style
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \@set@ticks{\hthickratio}{\@hticksep}{#1}{#3}{\z@}{%
      \multiput(\coordsys@a,#2)(\coordsys@c,0)\coordsys@b
         {\vgridlength{\coordsys@h}}}%
   \@setvlogticks{\@vticksep}{#2}{#4}{#1}{\hgridlength{\coordsys@w}}%
   \color@endgroup}}
\newcommand{\semiloggrid}{%
   \def\@hticksep{50}%
   \def\@vticksep{10}%
   \@numblinefalse
   \@ifstar{\def\coordsys@c{\semiloggrid@ii}\logsys@args@i}
           {\def\coordsys@c{\semiloggrid@i}\logsys@args@i}}
\def\semiloggrid@i#1#2(#3,#4){{\color@begingroup
   \coordgrid@calc
   \grid@style
   \@sethlogticks{\@hticksep}{#1}{#3}{0}{\vgridfromto{#2}{#4}}%
   \@set@ticks{\vthickratio}{\@vticksep}{#2}{#4}{\z@}{%
      \multiput(0,\coordsys@a)(0,\coordsys@c)\coordsys@b
         {\hgridfromto{#1}{#3}}}%
   \color@endgroup}}
\def\semiloggrid@ii#1#2(#3,#4){{\color@begingroup
   \grid@style
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \@sethlogticks{\@hticksep}{#1}{#3}{#2}{\vgridlength{\coordsys@h}}%
   \@set@ticks{\vthickratio}{\@vticksep}{#2}{#4}{\z@}{%
      \multiput(#1,\coordsys@a)(0,\coordsys@c)\coordsys@b
         {\hgridlength{\coordsys@w}}}%
   \color@endgroup}}
\newcommand{\logloggrid}{%
   \def\@hticksep{50}%
   \def\@vticksep{50}%
   \@numblinefalse
   \@ifstar{\def\coordsys@c{\logloggrid@ii}\logsys@args@i}
           {\def\coordsys@c{\logloggrid@i}\logsys@args@i}}
\def\logloggrid@i#1#2(#3,#4){{\color@begingroup
   \coordgrid@calc
   \grid@style
   \@sethlogticks{\@hticksep}{#1}{#3}{0}{\vgridfromto{#2}{#4}}%
   \@setvlogticks{\@vticksep}{#2}{#4}{0}{\hgridfromto{#1}{#3}}%
   \color@endgroup}}
\def\logloggrid@ii#1#2(#3,#4){{\color@begingroup
   \grid@style
   \@tempcnta=#3\relax
   \advance\@tempcnta -#1\relax
   \edef\coordsys@w{\the\@tempcnta}%
   \@tempcnta=#4\relax
   \advance\@tempcnta -#2\relax
   \edef\coordsys@h{\the\@tempcnta}%
   \@sethlogticks{\@hticksep}{#1}{#3}{#2}{\vgridlength{\coordsys@h}}%
   \@setvlogticks{\@vticksep}{#2}{#4}{#1}{\hgridlength{\coordsys@w}}%
   \color@endgroup}}
\endinput
%%
%% End of file `logsys.sty'.