Debian Codegraph @

texmf-dist/tex/latex/forest-ext/forest-lib-ext.multi-debug.sty

raw
1 %%
2 %% This is file `forest-lib-ext.multi-debug.sty',
3 %% generated with the docstrip utility.
4 %%
5 %% The original source files were:
6 %%
7 %% forest-ext-multi.dtx (with options: `sty,debug')
8 %% Copyright (C) 2025-2026 Clea F. Rees.
9 %%
10 %% This work may be distributed and/or modified under the
11 %% conditions of the LaTeX Project Public License, either version 1.3c
12 %% of this license or (at your option) any later version.
13 %% The latest version of this license is in
14 %% https://www.latex-project.org/lppl.txt
15 %% and version 1.3c or later is part of all distributions of LaTeX
16 %% version 2008-05-04 or later.
17 %%
18 %% This work has the LPPL maintenance status `maintained'.
19 %%
20 %% The Current Maintainer of this work is Clea F. Rees.
21 %%
22 %% This file may only be distributed together with a copy of the package
23 %% forest-ext. You may however distribute the package forest-ext without
24 %% such generated files.
25 %%
26 %% This work consists of all files listed in manifest.txt.
27 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
28 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
29 \NeedsTeXFormat{LaTeX2e}
30 %% $Id: forest-ext-multi.dtx 11668 2026-02-21 02:34:38Z cfrees $}
31 \ProvidesForestLibrary{ext.multi-debug}[2025-12-05 v0.1]
32 \disable@package@load {forest-lib-ext.multi}
33 {%
34 \PackageWarning {ext.multi-debug (forest library)}
35 {Only one of ext.multi and ext.multi-debug should be loaded.
36 Since the
37 ext.multi-debug
38 library has already been loaded, I will ignore your request for
39 ext.multi.%
40 }%
41 }
42 \SetDefaultHookLabel{forest-ext/multi}
43 \forestset{
44 declare keylist={every parent}{},
45 declare keylist={other parents}{},
46 declare boolean={multi@connector}{0},
47 declare count={multi@n@parents}{0},
48 declare count={multi@connects@fosterling}{-1},
49 declare count={multi@connects@foster@parent}{-1},
50 declare keylist={multi@foster@parents}{},
51 declare keylist={multi@fosterlings}{},
52 declare keylist={multi@all@parents}{},
53 declare toks={multi@edge}{},
54 declare toks={multi@edge@subpath}{edge},
55 declare toks={multi@edge@sublast}{--},
56 declare toks={multi@edge@route}{--},
57 declare toks={multi@parent@of}{},
58 declare boolean register={debug multi phantoms},
59 not debug multi phantoms,
60 declare count register={multi@temp@counta},
61 multi@temp@counta=0,
62 declare toks register={multi@temp@toksa},
63 multi@temp@toksa={},
64 declare toks register={multi@temp@toksb},
65 multi@temp@toksb={},
66 define long step={fosterlings}{}{%
67 if multi@fosterlings={}{}{%
68 split option={multi@fosterlings}{,}{id}%
69 }%
70 },
71 define long step={foster parents}{}{%
72 if multi@foster@parents={}{}{%
73 split option={multi@foster@parents}{,}{id}%
74 }%
75 },
76 define long step={every fosterling}{n args=1}{%
77 filter={#1}{>O_=!{multi@foster@parents}{}}%
78 },
79 define long step={every foster parent}{n args=1}{%
80 filter={#1}{>O_=!{multi@fosterlings}{}}%
81 },
82 define long step={c fosterling}{}{%
83 id/.option=multi@connects@fosterling%
84 },
85 define long step={c foster parent}{}{%
86 id/.option=multi@connects@foster@parent%
87 },
88 multi/.style={%
89 debug@multi=Execute style multi at,
90 debug@multi@option=id,
91 split={#1}{,}{multi@parent},
92 debug@multi@option=multi@n@parents,
93 debug@multi@option=multi@all@parents,
94 before typesetting nodes={%
95 multi@parents/.process={%
96 OOOw
97 {name}
98 {multi@n@parents}
99 {multi@all@parents}
100 {{##1}}%
101 },
102 delay n=2{%
103 multi@edge+= {(.child anchor) },
104 multi@temp@counta'=0,
105 split option={multi@all@parents}{,}{multi@also@parent},
106 },
107 delay n=3{%
108 debug@multi@option=id,
109 debug@multi@option=multi@edge,
110 edge path'/.option=multi@edge,
111 },
112 },
113 },
114 multi@also@parent/.style={%
115 debug@multi=Execute style multi@also@parent to for #1 at,
116 debug@multi@option=id,
117 multi@temp@counta'+=1,
118 multi@edge+/.process={
119 OR= ? O w
120 {multi@n@parents}{multi@temp@counta}
121 {multi@edge@sublast}{multi@edge@subpath}
122 {##1 (#1.parent anchor) }
123 },
124 },
125 multi@parent/.style={%
126 debug@multi=Execute style multi@parent to add #1 at,
127 debug@multi@option=id,
128 debug@multi@option=every parent,
129 multi@n@parents'+=1,
130 delay/.process={Ow{multi@n@parents}{%
131 multi@all@parents+/.process={Ow{name}{parent ##1 of ####1}},
132 insert before/.process={%
133 OOw2{name}{every parent}
134 {%
135 [#1,name=parent ##1 of ####1,multi@parent@of=####1,
136 ####2]%
137 }%
138 },
139 }%
140 },
141 },
142 multi@parents/.style n args=3{%
143 debug@multi=Executing style multi@parents with,
144 debug@multi=options #1 #2 and #3,
145 if={>nw+P{#2}{isodd(##1)}}{%
146 multi@temp@counta/.expanded=\inteval{(#2 + 1)/2},
147 for nodewalk={%
148 name/.expanded=parent \foresteregister{multi@temp@counta} of #1 %
149 }{%
150 append=#1,
151 },
152 }{%
153 multi@temp@counta/.expanded=\inteval{#2/2},
154 debug@multi@register=multi@temp@counta,
155 for nodewalk={%
156 name/.expanded=parent \foresteregister{multi@temp@counta} of #1 %
157 }{%
158 insert after={%
159 [,coordinate,no edge,
160 tier=multi@tier@#1@parents,
161 delay={%
162 debug@multi=Appending #1 to,
163 debug@multi@option=name,
164 append=#1,
165 },
166 ]%
167 },
168 },
169 },
170 },
171 multi@add@parent/.style n args=4{%
172 debug@multi=Execute style multi@add@parent to add #4 at,
173 debug@multi@option=id,
174 debug@multi=Arguments: #1: #2: #3: #4,
175 debug@multi@option=every parent,
176 delay n=2{%
177 for nodewalk={%
178 id=#4%
179 }{%
180 multi@fosterlings+=#1,
181 debug@multi=dynamic action #2,
182 debug@multi@option=parent anchor,
183 #2={%
184 [,
185 multi@phantom,
186 multi@connector,
187 multi@connects@fosterling=#1,
188 multi@connects@foster@parent=#4,
189 for current/.option=!{id=#1}.every parent,
190 delay n=3{%
191 do dynamics,
192 edge path'/.process={%
193 Ow {!{id=#1}.multi@edge@route} {%
194 (!c fosterling.child anchor)
195 ##1 (!c foster parent.parent anchor) %
196 }%
197 },
198 also={#3},
199 debug@multi@option=id,
200 debug@multi=edge path and edge,
201 typeout/.option=edge path,
202 debug@multi@option=edge,
203 },
204 ]%
205 },%
206 },
207 },
208 },
209 also parent/.style 2 args={%
210 debug@multi=Executing style also parent at,
211 debug@multi@option=id,
212 delay={%
213 split={#2}{:}{multi@temp@toksa,multi@temp@toksb},
214 debug@multi@register=multi@temp@toksa,
215 debug@multi@register=multi@temp@toksb,
216 if nodewalk valid={name/.register=multi@temp@toksa}{%
217 multi@temp@counta/.option=!{name/.register=multi@temp@toksa}.id,
218 }{%
219 multi@temp@counta/.option/.process={Rw{multi@temp@toksa}{##1.id}},
220 },
221 debug@multi@register=multi@temp@counta,
222 multi@foster@parents+/.register=multi@temp@counta,
223 multi@add@parent/.process={%
224 O_RwR
225 {id}
226 {#1}
227 {multi@temp@toksb}
228 {{##1}}
229 {multi@temp@counta}%
230 },
231 },
232 },
233 +also parent/.style={%
234 debug@multi=Executing style +also parent at,
235 debug@multi@option=id,
236 also parent={prepend}{#1},
237 },
238 also parent+/.style={%
239 debug@multi=Executing style also parent+ at,
240 debug@multi@option=id,
241 also parent={append}{#1},
242 },
243 multi@phantom/.style={
244 before drawing tree={%
245 if debug multi phantoms={%
246 rectangle,
247 if content={}{,
248 draw=red,
249 }{%
250 red,
251 },
252 }{%
253 coordinate,
254 },
255 typeset node,
256 },
257 },
258 debug@multi/.code={%
259 \ExpandArgs {e} \typeout{[Forest ext.multi debug]:: \detokenize{#1}}%
260 },
261 debug@multi@register/.code={%
262 \ExpandArgs {e} \typeout{[Forest ext.multi debug]:: \detokenize{#1}
263 = \foresteregister{#1}%
264 }%
265 },
266 debug@multi@option/.code={%
267 \ExpandArgs {e} \typeout{[Forest ext.multi debug]:: \detokenize{#1}
268 = \foresteoption{#1}%
269 }%
270 },
271 libraries/ext.multi-debug/defaults/.style=
272 {},
273 }
274 \AddToHook{begindocument}{%
275 \IfPackageLoadedT{forest-lib-edges}{%
276 \PackageInfo{forest-lib-ext.multi-debug}
277 {Found the edges library. Enabling support code.}%
278 \usetikzlibrary{ext.paths.ortho}%
279 \forestset{%
280 multi@forked@edge/.style={%
281 /forest/.cd,
282 /tikz/ext/ortho/distance/.process={Ow{fork sep}{-##1}},
283 every parent+={%
284 forked edge,
285 /tikz/ext/ortho/distance/.process={Ow{fork sep}{-##1}},
286 },
287 multi@edge@subpath={%
288 (.child anchor) -|-
289 },
290 multi@edge@sublast={%
291 (.child anchor) -|-
292 },
293 multi@edge@route={%
294 -|-
295 },
296 },
297 libraries/ext.multi-debug/defaults/.style=
298 {%
299 default preamble+={
300 Autoforward={fork sep}{%
301 every parent+={%
302 fork sep=##1,
303 edge+={/tikz/ext/ortho/distance=-##1},
304 },
305 edge+={/tikz/ext/ortho/distance=-##1},
306 },
307 fork sep'=0.5em,
308 forked edge'/.forward to=/forest/multi@forked@edge,
309 },
310 },
311 libraries/edges/defaults/.append style={%
312 libraries/ext.multi-debug/defaults,
313 /utils/exec={%
314 \PackageInfo{forest-lib-ext.multi-debug}
315 {%
316 Appending compatibility code for forked edges to default settings.%
317 }%
318 },
319 }%
320 }%
321 }%
322 \ifcsname l_forestext_tagging_custom_bool\endcsname
323 \PackageInfo{forest-lib-ext.multi-debug}
324 {%
325 Found the ext.tagging or ext.tagging-debug library.
326 Enabling support code.%
327 }%
328 \forestset{%
329 libraries/ext.multi-debug/defaults/.append style=
330 {%
331 also parent/.append style={%
332 before collating tags={%
333 alt text+/.process={Ow{##2.content}{ also child of ####1 }},
334 },
335 },
336 multi/.append style={%
337 before collating tags={%
338 alt text+={multiple parents: },
339 split={#1}{,}{multi@to@alt},
340 },
341 multi@to@alt/.style={%
342 alt text+={#1, },
343 },
344 },
345 },
346 }%
347 \fi
348 }
349 \endinput
350 %%
351 %% End of file `forest-lib-ext.multi-debug.sty'.