Subversion Repositories svnkaklik

Rev

Details | Last modification | View Log

Rev Author Line No. Line
1001 kaklik 1
%%
2
%% This is file `dirtree.tex',
3
%% generated with the docstrip utility.
4
%%
5
%% The original source files were:
6
%%
7
%% dirtree.dtx  (with options: `tex')
8
%% 
9
%% IMPORTANT NOTICE:
10
%% 
11
%% For the copyright see the source file.
12
%% 
13
%% Any modified versions of this file must be renamed
14
%% with new filenames distinct from dirtree.tex.
15
%% 
16
%% For distribution of the original source see the terms
17
%% for copying and modification in the file dirtree.dtx.
18
%% 
19
%% This generated file may be distributed as long as the
20
%% original source files, as listed above, are part of the
21
%% same distribution. (The sources need not necessarily be
22
%% in the same archive or directory.)
23
%%
24
%% Package `dirtree.dtx'
25
%% -----------------------------------------------
26
%% Copyright (C) 2004-2006 Jean-C\^ome Charpentier
27
%% -----------------------------------------------
28
%%
29
%% This work may be distributed and/or modified under the
30
%% conditions of the LaTeX Project Public License, either version 1.3
31
%% of this license or (at your option) any later version.
32
%% The latest version of this license is in
33
%%   http://www.latex-project.org/lppl.txt
34
%% and version 1.3 or later is part of all distributions of LaTeX
35
%% version 2003/12/01 or later.
36
%%
37
%% See CTAN archives in directory macros/latex/base/lppl.txt.
38
%%
39
%% CONTENTS:
40
%%   This work consists of the files dirtree.ins and dirtree.dtx.
41
%%   Derived files are dirtree.tex and dirtree.sty.
42
%%
43
%% DESCRIPTION:
44
%%   dirtree is a package displaying directory trees.
45
%%
46
 \def\fileversion{0.2}
47
 \def\filedate{2006/01/25}
48
\message{`dirtree' v\fileversion, \filedate\space (jcc)}
49
\edef\DTAtCode{\the\catcode`\@}
50
\catcode`\@=11
51
\long\def\LOOP#1\REPEAT{%
52
  \def\ITERATE{#1\relax\expandafter\ITERATE\fi}%
53
  \ITERATE
54
  \let\ITERATE\relax
55
}
56
\let\REPEAT=\fi
57
\expandafter\ifx\csname DT@fromsty\endcsname\relax
58
  \def\@namedef#1{\expandafter\def\csname #1\endcsname}
59
  \def\@nameuse#1{\csname #1\endcsname}
60
  \long\def\@gobble#1{}
61
\fi
62
\def\@nameedef#1{\expandafter\edef\csname #1\endcsname}
63
\newdimen\DT@offset \DT@offset=0.2em
64
\newdimen\DT@width \DT@width=1em
65
\newdimen\DT@sep \DT@sep=0.2em
66
\newdimen\DT@all
67
\DT@all=\DT@offset
68
\advance\DT@all \DT@width
69
\advance\DT@all \DT@sep
70
\newdimen\DT@rulewidth \DT@rulewidth=0.4pt
71
\newdimen\DT@dotwidth \DT@dotwidth=1.6pt
72
\newdimen\DTbaselineskip \DTbaselineskip=\baselineskip
73
\newcount\DT@counti
74
\newcount\DT@countii
75
\newcount\DT@countiii
76
\newcount\DT@countiv
77
\def\DTsetlength#1#2#3#4#5{%
78
  \DT@offset=#1\relax
79
  \DT@width=#2\relax
80
  \DT@sep=#3\relax
81
  \DT@all=\DT@offset
82
  \advance\DT@all by\DT@width
83
  \advance\DT@all by\DT@sep
84
  \DT@rulewidth=#4\relax
85
  \DT@dotwidth=#5\relax
86
}
87
\expandafter\ifx\csname DT@fromsty\endcsname\relax
88
  \def\DTstyle{\tt}
89
  \def\DTstylecomment{\rm}
90
\else
91
  \def\DTstyle{\ttfamily}
92
  \def\DTstylecomment{\rmfamily}
93
\fi
94
\def\DTcomment#1{%
95
  \kern\parindent\dotfill
96
  {\DTstylecomment{#1}}%
97
}
98
\def\dirtree#1{%
99
  \let\DT@indent=\parindent
100
  \parindent=\z@
101
  \let\DT@parskip=\parskip
102
  \parskip=\z@
103
  \let\DT@baselineskip=\baselineskip
104
  \baselineskip=\DTbaselineskip
105
  \let\DT@strut=\strut
106
  \def\strut{\vrule width\z@ height0.7\baselineskip depth0.3\baselineskip}%
107
  \DT@counti=\z@
108
  \let\next\DT@readarg
109
  \next#1\@nil
110
  \dimen\z@=\hsize
111
  \advance\dimen\z@ -\DT@offset
112
  \advance\dimen\z@ -\DT@width
113
  \setbox\z@=\hbox to\dimen\z@{%
114
    \hsize=\dimen\z@
115
    \vbox{\@nameuse{DT@body@1}}%
116
  }%
117
  \dimen\z@=\ht\z@
118
  \advance\dimen0 by\dp\z@
119
  \advance\dimen0 by-0.7\baselineskip
120
  \ht\z@=0.7\baselineskip
121
  \dp\z@=\dimen\z@
122
  \par\leavevmode
123
  \kern\DT@offset
124
  \kern\DT@width
125
  \box\z@
126
  \endgraf
127
  \DT@countii=\@ne
128
  \DT@countiii=\z@
129
  \dimen3=\dimen\z@
130
  \@namedef{DT@lastlevel@1}{-0.7\baselineskip}%
131
  \loop
132
  \ifnum\DT@countii<\DT@counti
133
    \advance\DT@countii \@ne
134
    \advance\DT@countiii \@ne
135
    \dimen\z@=\@nameuse{DT@level@\the\DT@countii}\DT@all
136
    \advance\dimen\z@ by\DT@offset
137
    \advance\dimen\z@ by-\DT@all
138
    \leavevmode
139
    \kern\dimen\z@
140
    \DT@countiv=\DT@countii
141
    \count@=\z@
142
    \LOOP
143
      \advance\DT@countiv \m@ne
144
      \ifnum\@nameuse{DT@level@\the\DT@countiv} >
145
        \@nameuse{DT@level@\the\DT@countii}\relax
146
      \else
147
        \count@=\@ne
148
      \fi
149
    \ifnum\count@=\z@
150
    \REPEAT
151
    \edef\DT@hsize{\the\hsize}%
152
    \count@=\@nameuse{DT@level@\the\DT@countii}\relax
153
    \dimen\z@=\count@\DT@all
154
    \advance\hsize by-\dimen\z@
155
    \setbox\z@=\vbox{\@nameuse{DT@body@\the\DT@countii}}%
156
    \hsize=\DT@hsize
157
    \dimen\z@=\ht\z@
158
    \advance\dimen\z@ by\dp\z@
159
    \advance\dimen\z@ by-0.7\baselineskip
160
    \ht\z@=0.7\baselineskip
161
    \dp\z@=\dimen\z@
162
    \@nameedef{DT@lastlevel@\the\DT@countii}{\the\dimen3}%
163
    \advance\dimen3 by\dimen\z@
164
    \advance\dimen3 by0.7\baselineskip
165
    \dimen\z@=\@nameuse{DT@lastlevel@\the\DT@countii}\relax
166
    \advance\dimen\z@ by-\@nameuse{DT@lastlevel@\the\DT@countiv}\relax
167
    \advance\dimen\z@ by0.3\baselineskip
168
    \ifnum\@nameuse{DT@level@\the\DT@countiv} <
169
        \@nameuse{DT@level@\the\DT@countii}\relax
170
      \advance\dimen\z@ by-0.5\baselineskip
171
    \fi
172
    \kern-0.5\DT@rulewidth
173
    \hbox{\vbox to\z@{\vss\hrule width\DT@rulewidth height\dimen\z@}}%
174
    \kern-0.5\DT@rulewidth
175
    \kern-0.5\DT@dotwidth
176
    \vrule width\DT@dotwidth height0.5\DT@dotwidth depth0.5\DT@dotwidth
177
    \kern-0.5\DT@dotwidth
178
    \vrule width\DT@width height0.5\DT@rulewidth depth0.5\DT@rulewidth
179
    \kern\DT@sep
180
    \box\z@
181
    \endgraf
182
  \repeat
183
  \parindent=\DT@indent
184
  \parskip=\DT@parskip
185
  \DT@baselineskip=\baselineskip
186
  \let\strut\DT@strut
187
}
188
\def\DT@readarg.#1 #2. #3\@nil{%
189
  \advance\DT@counti \@ne
190
  \@namedef{DT@level@\the\DT@counti}{#1}%
191
  \@namedef{DT@body@\the\DT@counti}{\strut{\DTstyle{#2}\strut}}%
192
  \ifx\relax#3\relax
193
    \let\next\@gobble
194
  \fi
195
  \next#3\@nil
196
}
197
\catcode`\@=\DTAtCode\relax
198
\endinput
199
%%
200
%% End of file `dirtree.tex'.