%% %% This is file `forest-lib-ext.utils.sty', %% generated with the docstrip utility. %% %% The original source files were: %% %% forest-ext-utils.dtx (with options: `sty') %% Copyright (C) 2025-2026 Clea F. Rees. %% %% 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. %% The latest version of this license is in %% https://www.latex-project.org/lppl.txt %% and version 1.3c or later is part of all distributions of LaTeX %% version 2008-05-04 or later. %% %% This work has the LPPL maintenance status `maintained'. %% %% The Current Maintainer of this work is Clea F. Rees. %% %% This file may only be distributed together with a copy of the package %% forest-ext. You may however distribute the package forest-ext without %% such generated files. %% %% This work consists of all files listed in manifest.txt. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e} %% $Id: forest-ext-utils.dtx 11668 2026-02-21 02:34:38Z cfrees $} \ProvidesForestLibrary{ext.utils}[2025-12-05 v0.1] \disable@package@load {forest-lib-ext.utils-debug} {% \PackageWarning {ext.utils (forest library)} {Only one of ext.utils and ext.utils-debug should be loaded. Since the ext.utils library has already been loaded, I will ignore your request for ext.utils-debug.% }% } \SetDefaultHookLabel{forest-ext/utils} \ExplSyntaxOn \cs_new:Npn \forestext@toksapp#1#2{#1\expandafter{\the #1#2}} \@ifpackageloaded{memoize} {}{ \newif\ifmemoizing\memoizingfalse } \cs_if_free:NT \socket_get_plug:nN { \cs_new_protected_nopar:Npn \socket_get_plug:nN #1#2 { \str_set_eq:cN { l__socket_#1_plug_str } #2 } } \ExplSyntaxOn \tl_new:N \l__forestext_tmpa_tl \prop_new:N \l__forestext_tmpa_prop \seq_new:N \l__forestext_tmpa_seq \cs_new_protected_nopar:Npn \__forestext_fkeylist_declare:nn #1#2 { \prop_new:c {l__forestext_#1_prop} \__forestext_fkeylist_put_from_keyval:nn {#1}{#2} } \cs_new_protected_nopar:Npn \__forestext_fkeylist_redeclare:nn #1#2 { \prop_clear:c {l__forestext_#1_prop} \__forestext_fkeylist_put_from_keyval:nn {#1} {#2} } \cs_new_protected_nopar:Npn \__forestext_fkeylist_put_from_keyval:nn #1#2 { \exp_args:Nne \prop_put_from_keyval:ce {l__forestext_#1_prop} { \keyval_parse:NNn \__forestext_fkeylist_put_from_keyval_aux:n \__forestext_fkeylist_put_from_keyval_aux:nn {#2} } } \cs_new_nopar:Npn \__forestext_fkeylist_put_from_keyval_aux:n #1 { \__forestext_fkeylist_put_from_keyval_aux:nn {#1} {\q_no_value} } \cs_new_nopar:Npn \__forestext_fkeylist_put_from_keyval_aux:nn #1#2 { \exp_not:n { {#1} = {#2} }, } \cs_new_nopar:Npn \__forestext_fkeylist_to_keyval:n #1 { \prop_map_function:cN {l__forestext_#1_prop} \__forestext_fkeylist_to_keyval_aux:nn } \cs_new_nopar:Npn \__forestext_fkeylist_to_keyval_aux:nn #1#2 { \quark_if_no_value:nTF {#2} {\exp_not:n{#1},}{\exp_not:n{#1}=\exp_not:n{{#2}},} } \cs_new_protected_nopar:Npn \__forestext_fkeylist_put:nn #1#2 { \__forestext_fkeylist_put_from_keyval:nn {#1} {#2} } \cs_new_protected_nopar:Npn \__forestext_fkeylist_remove:nn #1#2 { \prop_remove:cn {l__forestext_#1_prop} {#2} } \cs_new_protected_nopar:Npn \__forestext_fkeylist_remove_if_match:nn #1#2 { \prop_set_eq:Nc \l__forestext_tmpa_prop {l__forestext_#1_prop} \keyval_parse:NNn \__forestext_fkeylist_remove_from_keyval_aux:n \__forestext_fkeylist_remove_from_keyval_aux:nn {#2} \prop_set_eq:cN {l__forestext_#1_prop} \l__forestext_tmpa_prop } \cs_new_protected_nopar:Npn \__forestext_fkeylist_remove_from_keyval_aux:n #1 { \__forestext_fkeylist_remove_from_keyval_aux:nn {#1} {\q_no_value} } \cs_new_protected_nopar:Npn \__forestext_fkeylist_remove_from_keyval_aux:nn #1#2 { \prop_get:NnN \l__forestext_tmpa_prop {#1} \l__forestext_tmpa_tl \tl_if_eq:NnT \l__forestext_tmpa_tl {#2} { \prop_remove:Nn \l__forestext_tmpa_prop {#1} } } \cs_new_eq:NN \forestext@keylist@declare \__forestext_fkeylist_declare:nn \cs_new_eq:NN \forestext@prop@to@keylist \__forestext_fkeylist_to_keyval:n \cs_new_eq:NN \forestext@keylist@put \__forestext_fkeylist_put:nn \cs_new_eq:NN \forestext@keylist@remove@key \__forestext_fkeylist_remove:nn \cs_new_eq:NN \forestext@keylist@remove \__forestext_fkeylist_remove_if_match:nn \cs_new_eq:NN \forestext@keylist@redeclare \__forestext_fkeylist_redeclare:nn \cs_generate_variant:Nn \prop_to_keyval:N {c} \cs_generate_variant:Nn \prop_put_from_keyval:Nn {ce} \ExplSyntaxOff \newtoks\forestext@toksa \forestset{% forestext utils debug/.style={% typeout={[Forest ext.utils debug]:: #1}, }, declare tagging keylist/.code 2 args={% \forestext@keylist@declare {#1}{#2}% \forestext@toksapp\forestext@toksa{% declare keylist/.process={_x{#1}{\forestext@prop@to@keylist{#1}}}, }% \pgfqkeys{/forest}{% forestext utils debug={Setting processing order for #1 to unique=tree.}, #1 processing order/.nodewalk style={unique=tree}, }% }, redeclare tagging keylist/.code 2 args={% \forestext@keylist@redeclare {#1}{#2}% }, tagging keylist put/.code 2 args={% \forestext@keylist@put {#1}{#2}% }, tagging keylist remove key/.code 2 args={% \forestext@keylist@remove@key {#1}{#2}% }, tagging keylist remove/.code 2 args={% \forestext@keylist@remove {#1}{#2}% }, } \AddToHook{env/forest/begin}[.]{% \expandafter\forestset\expandafter{\the\forestext@toksa}% \forestset{% tagging keylist error/.code={% \PackageError{ext.tagging (forest library)}{% The key '#1' cannot be used inside a forest environment.% }{% You need to use this key outside forest environments. Please see forest-ext's documentation for details.% }% }, declare tagging keylist/.style 2 args={% tagging keylist error=declare tagging keylist}, redeclare tagging keylist/.style 2 args={% tagging keylist error=redeclare tagging keylist}, tagging keylist put/.style 2 args={% tagging keylist error=tagging keylist put}, tagging keylist remove/.style 2 args={% tagging keylist error=tagging keylist remove}, tagging keylist remove key/.style 2 args={% tagging keylist error=tagging keylist remove key}, }% } \AddToHook{cmd/Forest/before}[.]{% \AddToHookNext{cmd/forest@config/before}{% \UseHook{env/forest/begin}% }% \AddToHookNext{cmd/forest@node@drawtree/after}{% \UseHook{env/forest/end}% }% } \forestset{ align middle child/.style={ before typesetting nodes={ if={ > Ow+P {n children}{isodd(##1)} }{ calign child/.process={ Ow+n {n children}{(##1+1)/2} }, calign=#1, }{}, }, }, align middle child/.default=child edge, align middle children/.style={ for tree={align middle child=#1}, }, align middle children/.default=child edge, declare keylist={utils@outer@label@opts}{}, declare keylist register={outer labels}, outer labels={anchor=base west}, declare boolean register=utils@has@outer@labels, utils@has@outer@labels=0, declare toks register=outer labels at, outer labels at=east, declare autowrapped toks={utils@outer@label}{}, /forest/ext/utils/outer@label/anchor/.initial=base, /forest/ext/utils/outer@label/anchor/.forward to=/tikz/anchor, /forest/ext/utils/outer@label/.search also={/tikz,/pgf}, outer label/.style={% split={#1}{:}{utils@outer@label,utils@outer@label@opts}, if utils@has@outer@labels={}{% utils@has@outer@labels, for root={% tikz+={% \coordinate (utils@outer@labels@align) at (current bounding box.\foresteregister{outer labels at}); }, before drawing tree={% where utils@outer@label={}{}{% tikz+/.process={% OOORw4 {utils@outer@label} {utils@outer@label@opts} {!u.grow} {outer labels} {% \path [% rotate=##3, ] node [% ##4, /forest/ext/utils/outer@label/.cd, ##2, ] at (.\pgfkeysvalueof{/forest/ext/utils/outer@label/anchor} |- utils@outer@labels@align) {##1}; }% }, }, }, }, }, }, libraries/ext.utils/defaults/.style= {}% } \endinput %% %% End of file `forest-lib-ext.utils.sty'.