blob: f557ae6fed37e602548448cc832dabc48c81f26f (
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
|
%%
%% This is file `dirtree.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% dirtree.dtx (with options: `tex')
%%
%% IMPORTANT NOTICE:
%%
%% For the copyright see the source file.
%%
%% Any modified versions of this file must be renamed
%% with new filenames distinct from dirtree.tex.
%%
%% For distribution of the original source see the terms
%% for copying and modification in the file dirtree.dtx.
%%
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%
%% Package `dirtree.dtx'
%% -----------------------------------------------
%% Copyright (C) 2004-2006 Jean-C\^ome Charpentier
%% -----------------------------------------------
%%
%% This work 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.3 or later is part of all distributions of LaTeX
%% version 2003/12/01 or later.
%%
%% See CTAN archives in directory macros/latex/base/lppl.txt.
%%
%% CONTENTS:
%% This work consists of the files dirtree.ins and dirtree.dtx.
%% Derived files are dirtree.tex and dirtree.sty.
%%
%% DESCRIPTION:
%% dirtree is a package displaying directory trees.
%%
\def\fileversion{0.2}
\def\filedate{2006/01/25}
\message{`dirtree' v\fileversion, \filedate\space (jcc)}
\edef\DTAtCode{\the\catcode`\@}
\catcode`\@=11
\long\def\LOOP#1\REPEAT{%
\def\ITERATE{#1\relax\expandafter\ITERATE\fi}%
\ITERATE
\let\ITERATE\relax
}
\let\REPEAT=\fi
\expandafter\ifx\csname DT@fromsty\endcsname\relax
\def\@namedef#1{\expandafter\def\csname #1\endcsname}
\def\@nameuse#1{\csname #1\endcsname}
\long\def\@gobble#1{}
\fi
\def\@nameedef#1{\expandafter\edef\csname #1\endcsname}
\newdimen\DT@offset \DT@offset=0.2em
\newdimen\DT@width \DT@width=1em
\newdimen\DT@sep \DT@sep=0.2em
\newdimen\DT@all
\DT@all=\DT@offset
\advance\DT@all \DT@width
\advance\DT@all \DT@sep
\newdimen\DT@rulewidth \DT@rulewidth=0.4pt
\newdimen\DT@dotwidth \DT@dotwidth=1.6pt
\newdimen\DTbaselineskip \DTbaselineskip=\baselineskip
\newcount\DT@counti
\newcount\DT@countii
\newcount\DT@countiii
\newcount\DT@countiv
\def\DTsetlength#1#2#3#4#5{%
\DT@offset=#1\relax
\DT@width=#2\relax
\DT@sep=#3\relax
\DT@all=\DT@offset
\advance\DT@all by\DT@width
\advance\DT@all by\DT@sep
\DT@rulewidth=#4\relax
\DT@dotwidth=#5\relax
}
\expandafter\ifx\csname DT@fromsty\endcsname\relax
\def\DTstyle{\tt}
\def\DTstylecomment{\rm}
\else
\def\DTstyle{\ttfamily}
\def\DTstylecomment{\rmfamily}
\fi
\def\DTcomment#1{%
\kern\parindent\dotfill
{\DTstylecomment{#1}}%
}
\def\dirtree#1{%
\let\DT@indent=\parindent
\parindent=\z@
\let\DT@parskip=\parskip
\parskip=\z@
\let\DT@baselineskip=\baselineskip
\baselineskip=\DTbaselineskip
\let\DT@strut=\strut
\def\strut{\vrule width\z@ height0.7\baselineskip depth0.3\baselineskip}%
\DT@counti=\z@
\let\next\DT@readarg
\next#1\@nil
\dimen\z@=\hsize
\advance\dimen\z@ -\DT@offset
\advance\dimen\z@ -\DT@width
\setbox\z@=\hbox to\dimen\z@{%
\hsize=\dimen\z@
\vbox{\@nameuse{DT@body@1}}%
}%
\dimen\z@=\ht\z@
\advance\dimen0 by\dp\z@
\advance\dimen0 by-0.7\baselineskip
\ht\z@=0.7\baselineskip
\dp\z@=\dimen\z@
\par\leavevmode
\kern\DT@offset
\kern\DT@width
\box\z@
\endgraf
\DT@countii=\@ne
\DT@countiii=\z@
\dimen3=\dimen\z@
\@namedef{DT@lastlevel@1}{-0.7\baselineskip}%
\loop
\ifnum\DT@countii<\DT@counti
\advance\DT@countii \@ne
\advance\DT@countiii \@ne
\dimen\z@=\@nameuse{DT@level@\the\DT@countii}\DT@all
\advance\dimen\z@ by\DT@offset
\advance\dimen\z@ by-\DT@all
\leavevmode
\kern\dimen\z@
\DT@countiv=\DT@countii
\count@=\z@
\LOOP
\advance\DT@countiv \m@ne
\ifnum\@nameuse{DT@level@\the\DT@countiv} >
\@nameuse{DT@level@\the\DT@countii}\relax
\else
\count@=\@ne
\fi
\ifnum\count@=\z@
\REPEAT
\edef\DT@hsize{\the\hsize}%
\count@=\@nameuse{DT@level@\the\DT@countii}\relax
\dimen\z@=\count@\DT@all
\advance\hsize by-\dimen\z@
\setbox\z@=\vbox{\@nameuse{DT@body@\the\DT@countii}}%
\hsize=\DT@hsize
\dimen\z@=\ht\z@
\advance\dimen\z@ by\dp\z@
\advance\dimen\z@ by-0.7\baselineskip
\ht\z@=0.7\baselineskip
\dp\z@=\dimen\z@
\@nameedef{DT@lastlevel@\the\DT@countii}{\the\dimen3}%
\advance\dimen3 by\dimen\z@
\advance\dimen3 by0.7\baselineskip
\dimen\z@=\@nameuse{DT@lastlevel@\the\DT@countii}\relax
\advance\dimen\z@ by-\@nameuse{DT@lastlevel@\the\DT@countiv}\relax
\advance\dimen\z@ by0.3\baselineskip
\ifnum\@nameuse{DT@level@\the\DT@countiv} <
\@nameuse{DT@level@\the\DT@countii}\relax
\advance\dimen\z@ by-0.5\baselineskip
\fi
\kern-0.5\DT@rulewidth
\hbox{\vbox to\z@{\vss\hrule width\DT@rulewidth height\dimen\z@}}%
\kern-0.5\DT@rulewidth
\kern-0.5\DT@dotwidth
\vrule width\DT@dotwidth height0.5\DT@dotwidth depth0.5\DT@dotwidth
\kern-0.5\DT@dotwidth
\vrule width\DT@width height0.5\DT@rulewidth depth0.5\DT@rulewidth
\kern\DT@sep
\box\z@
\endgraf
\repeat
\parindent=\DT@indent
\parskip=\DT@parskip
\DT@baselineskip=\baselineskip
\let\strut\DT@strut
}
\def\DT@readarg.#1 #2. #3\@nil{%
\advance\DT@counti \@ne
\@namedef{DT@level@\the\DT@counti}{#1}%
\@namedef{DT@body@\the\DT@counti}{\strut{\DTstyle{#2}\strut}}%
\ifx\relax#3\relax
\let\next\@gobble
\fi
\next#3\@nil
}
\catcode`\@=\DTAtCode\relax
\endinput
%%
%% End of file `dirtree.tex'.
|