summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/forest
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2016-12-19 22:12:23 +0000
committerKarl Berry <karl@freefriends.org>2016-12-19 22:12:23 +0000
commite1425b370048a49ecbf068c6dae629eac6c6fb10 (patch)
tree52fda7b94044b1f0c6ce6e2a2eb8073962291a83 /Master/texmf-dist/tex/latex/forest
parenta7a330379a8d0b08547fe2b5dddacbf1b95152fb (diff)
forest (19dec16)
git-svn-id: svn://tug.org/texlive/trunk@42750 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/forest')
-rw-r--r--Master/texmf-dist/tex/latex/forest/forest-index.sty21
-rw-r--r--Master/texmf-dist/tex/latex/forest/forest.sty85
2 files changed, 64 insertions, 42 deletions
diff --git a/Master/texmf-dist/tex/latex/forest/forest-index.sty b/Master/texmf-dist/tex/latex/forest/forest-index.sty
index 6bd6fb774ed..36690d8664f 100644
--- a/Master/texmf-dist/tex/latex/forest/forest-index.sty
+++ b/Master/texmf-dist/tex/latex/forest/forest-index.sty
@@ -73,7 +73,7 @@
\forestset{
declare boolean register=print,
declare boolean register=index,
- declare boolean register=short, short,
+ declare boolean register=short,
declare toks={key}{},
declare toks={argument}{},
declare toks={index key}{},
@@ -100,7 +100,7 @@
every index end/.style={},
declare toks register=stage,
@index/.style n args={3}{
- print, index, index entry type=normal, set'={},
+ print, index, index entry type=normal, set'={}, short,
for nodewalk={
split={#3}{>}{create@main@entry@node, create@subentry@node},
if n=0{
@@ -134,10 +134,17 @@
},
stage={},
if index={
- index@hypertarget/.expanded={.\forestoption{index key}},
+ index@hypertarget/.process={OS_= ? l_ w2}
+ {index key}
+ {}
+ {}{.}
+ {##2##1},
for descendants={
- index@hypertarget/.process= {OOw2}
- {!parent.index@hypertarget} {index key} {##1.##2},
+ index@hypertarget/.process={OO S _l1= ? w2 }
+ {!parent.index@hypertarget}{index key}
+ {}
+ {##1} % empty index key
+ {##1.##2} % otherwise
},
}{},
if index={
@@ -250,8 +257,8 @@
\noexpand\immediate\noexpand\write\noexpand\forestindex@out{%
\noexpand\string\noexpand\indexdefineshortkey\noexpand\unexpanded{{\forestoption{key}}{\forestoption{content}}}%
}%
- }{}%
- }
+ }%
+ }{}
}
}
}
diff --git a/Master/texmf-dist/tex/latex/forest/forest.sty b/Master/texmf-dist/tex/latex/forest/forest.sty
index dedd3159561..7443fbdf7ae 100644
--- a/Master/texmf-dist/tex/latex/forest/forest.sty
+++ b/Master/texmf-dist/tex/latex/forest/forest.sty
@@ -44,7 +44,7 @@
%% - LICENCE
%% To use the package, only the files marked with + need to be installed.
%%
-\ProvidesPackage{forest}[2016/12/05 v2.1 Drawing (linguistic) trees]
+\ProvidesPackage{forest}[2016/12/18 v2.1.1 Drawing (linguistic) trees]
\RequirePackage{tikz}[2013/12/13]
\usetikzlibrary{shapes}
@@ -931,11 +931,11 @@
\def\forestmathtype@unitless{P} % <decimal> (a unitless dimension) (P because pgfmath returns such numbers)
\def\forestmathtype@textasc{t} % text (ascending)
\def\forestmathtype@textdesc{T} % text (descending)
-\def\forestmathtype@array{a} % array - internal
\def\forestmathtype@none{} % internal (for requests - means whatever)
\def\forestmathresult{}
\let\forestmathresulttype\forestmathtype@generic
-\def\forest@tryprocess{%
+\def\forest@tryprocess#1{%
+ \def\forest@tryprocess@returnarray{#1}%
\expandafter\forest@tryprocess@a\romannumeral-`0}
\def\forest@tryprocess@a{\futurelet\forest@temp@token\forest@tryprocess@b}
\def\forest@tryprocess@b{%
@@ -947,12 +947,12 @@
}
\def\forest@spacegen{ \forest@spacegen}
\def\forest@tryprocess@yes#1#2\forest@spacegen{%
- \forest@process{false}#2\forest@eov
+ \expandafter\forest@process\expandafter{\forest@tryprocess@returnarray}#2\forest@eov
\@firstoftwo
}
\def\forest@tryprocess@no#1\forest@spacegen{\@secondoftwo}
\def\forestmathsetcount#1#2{%
- \forest@tryprocess#2\forest@spacegen{%
+ \forest@tryprocess{false}#2\forest@spacegen{%
#1=\forest@process@result\relax
}{%
\forestmathsetcount@#1{#2}%
@@ -966,7 +966,7 @@
}%
}
\def\forestmathsetlength#1#2{%
- \forest@tryprocess#2\forest@spacegen{%
+ \forest@tryprocess{false}#2\forest@spacegen{%
#1=\forest@process@result\relax
}{%
\forestmathsetlength@#1{#2}%
@@ -980,7 +980,7 @@
}%
}
\def\forestmathtruncatemacro#1#2{%
- \forest@tryprocess#2\forest@spacegen{%
+ \forest@tryprocess{false}#2\forest@spacegen{%
\forest@temp@count=\forest@process@result\relax
\edef#1{\the\forest@temp@count}%
}{%
@@ -995,7 +995,7 @@
}%
}
\def\forestmathsetlengthmacro#1#2{%
- \forest@tryprocess#2\forest@spacegen{%
+ \forest@tryprocess{false}#2\forest@spacegen{%
\forest@temp@dimen=\forest@process@result\relax
\edef#1{\the\forest@temp@dimen}%
}{%
@@ -1010,12 +1010,12 @@
}%
}
\def\forestmathsetmacro#1#2{%
- \forest@tryprocess#2\forest@spacegen{%
+ \forest@tryprocess{false}#2\forest@spacegen{%
\let#1\forest@process@result
\let\forestmathresulttype\forest@process@result@type
}{%
\forestmathsetmacro@#1{#2}%
- \def\forestmathresulttype{P}%
+ \let\forestmathresulttype\forestmathtype@unitless
}%
}
\def\forestmathsetmacro@#1#2{%
@@ -1026,12 +1026,12 @@
}%
}
\def\forestmathparse#1{%
- \forest@tryprocess#1\forest@spacegen{%
+ \forest@tryprocess{false}#1\forest@spacegen{%
\let\forestmathresult\forest@process@result
\let\forestmathresulttype\forest@process@result@type
}{%
\forestmathparse@{#1}%
- \def\forestmathresulttype{P}%
+ \let\forestmathresulttype\forestmathtype@unitless
}%
}
\def\forestmathparse@#1{%
@@ -1041,6 +1041,14 @@
\pgfmathsetmacro\forestmathresult{#1}%
}%
}
+ %\def\forestmathparse@returnarray#1{% same as above, but returns the result as an array (used only internally)
+ % \forest@tryprocess{true}#1\forest@spacegen{}{%
+ % \forestmathparse@{#1}%
+ % \let\forest@process@result@type\forestmathtype@unitless
+ % \forest@process@result@clear
+ % \forest@process@result@letappend\forestmathresult
+ % }%
+ %}
\csdef{forest@bh@0}{0}
\csdef{forest@bh@false}{0}
\csdef{forest@bh@1}{1}
@@ -1082,11 +1090,11 @@
\csdef{forestmath@convert@from@P@to@_}#1{\unexpanded{#1}}
\def\forestmathsettypefrom#1{%
\forest@isnumdim{%
- \let\forestmathresulttype\forest@result@type@numexpr
+ \let\forestmathresulttype\forestmathtype@count
}{%
- \let\forestmathresulttype\forest@result@type@dimexpr
+ \let\forestmathresulttype\forestmathtype@dimen
}{%
- \let\forestmathresulttype\forest@result@type@pgfmath
+ \let\forestmathresulttype\forestmathtype@unitless
}%
}
\def\forestmathadd#1#2{\edef\forestmathresult{%
@@ -2842,12 +2850,12 @@
\forest@process@right@clear
\forest@process@saved@clear
\let\forest@process@savedtype\forestmathtype@generic
- \ExpandIfT{forestdebug}{%
- \edef\forest@process@debug@args{\unexpanded{#2}}%
- \typeout{[forest .process] Start "\unexpanded{#2}"}%
- }%
\csname forest@process@returnarray@#1\endcsname
\def\forest@topextend@next{%
+ \ExpandIfT{forestdebug}{%
+ \edef\forest@process@debug@args{\unexpanded{#2}}%
+ \forest@processor@debuginfo@template{Start "\unexpanded{#2}}%
+ }%
\forest@process@catregime
\endlinechar=-1
\scantokens{#2}%
@@ -2867,10 +2875,10 @@
\def\forest@process@finish{%
\ifforest@process@returnarray@
\forest@process@finish@array
- \global\let\forest@process@result@type\forest@result@type@array
\else
\forest@process@finish@single
\fi
+ \global\let\forest@process@result@type\forestmathresulttype
\ifforestdebugprocess\forest@process@debug@end\fi
\endgroup
}
@@ -2885,7 +2893,6 @@
\else
\forest@process@lengtherror
\fi
- \global\let\forest@process@result@type\forestmathresulttype
}
\csdef{forest@process@finish@single@10}{\forest@process@left@toppop\forest@temp}
\csdef{forest@process@finish@single@01}{\forest@process@right@toppop\forest@temp}
@@ -2915,7 +2922,7 @@
}
\fi
\def\forest@process@debug@end{%
- \typeout{[forest .process] \space\space\space End "\expandonce{\forest@process@debug@args}" -> "\forest@process@left@values\forest@process@right@values"}%
+ \typeout{[forest .process] End "\expandonce{\forest@process@debug@args}" -> "\forest@process@left@values\forest@process@right@values"}%
}
\def\forest@process@lengtherror{%
\PackageError{forest}{%
@@ -2997,7 +3004,7 @@
}
\def\forest@def@processor@debuginfo#1{% #1 = instruction call
\ifforestdebug
- \expandonce{\forest@processor@debuginfo@template{#1}}%
+ \expandonce{\forest@processor@debuginfo@template{\space\space After #1}}%
\fi
}
\def\forest@processor@debuginfo@template#1{%
@@ -3005,7 +3012,7 @@
\edef\forest@temp@left{\forest@process@left@values}%
\edef\forest@temp@right{\forest@process@right@values}%
\edef\forest@temp@saved{\forest@process@saved@values}%
- \typeout{[forest .process]\space\space\space\space After #1: left="\expandonce{\forest@temp@left}", right="\expandonce{\forest@temp@right}", saved="\expandonce{\forest@temp@saved}", type=\forestmathresulttype}%
+ \typeout{[forest .process] #1: left="\expandonce{\forest@temp@left}", right="\expandonce{\forest@temp@right}", saved="\expandonce{\forest@temp@saved}", type=\forestmathresulttype}%
\fi
}
\newcount\forest@process@n
@@ -3040,6 +3047,15 @@
\forest@process@left@letappend\pgfmathresult
\let\forestmathresulttype\forestmathtype@unitless
}
+\forest@def@processor{p}{1}*{}{% process expression
+ \forest@process@right@bottompop\forest@temp@a
+ \def\forest@temp{\forest@process{true}}%
+ \expandafter\forest@temp\forest@temp@a\forest@eov
+ \let\forest@topextend@next\relax
+ \edef\forest@temp{\forest@process@result@values}%
+ \expandafter\forest@process@left@topextend\forest@temp\forest@eov
+ \let\forestmathresulttype\forest@process@result@type
+}
\forest@def@processor{t}{1}*{}{% text
\forest@process@right@bottompop\forest@temp
\forest@process@left@letappend\forest@temp
@@ -3115,7 +3131,7 @@
\forest@loop
\ifnum\forest@temparray@N>0
\forest@temparray@toppop\forest@temp
- \expandafter\forest@process@right@setprepend\expandafter{\expandafter{\forest@temp}}%
+ \expandafter\forest@process@right@setprepend\expandafter{\forest@temp}%
\forest@repeat
}
\def\forest@process@check@mn#1#2#3#4{%
@@ -3211,7 +3227,7 @@
\forest@process@n\forest@process@saved@N\relax
\fi
\expandafter\forest@processor@U@@@\expandafter{%
- \the\numexpr\forest@process@saved@N-\forest@temp@count}%
+ \the\numexpr\forest@process@saved@N-\forest@process@n}%
}
\def\forest@processor@U@@@#1{%
\forest@temp@count#1
@@ -3223,14 +3239,14 @@
\forest@repeat
\let\forestmathresulttype\forest@process@savedtype
\ifforest@temp
- \let\forest@process@savedtype\forest@result@type@any
+ \let\forest@process@savedtype\forestmathtype@none
\forest@process@saved@N#1
\fi
}
\forest@def@processor{&}{2}{}{% and
\def\forest@tempa{1}%
\forest@repeat@n@times{\forest@process@n}{%
- \forest@process@left@bottompop\forest@tempb
+ \forest@process@left@toppop\forest@tempb
\edef\forest@tempa{\ifnum10<\forest@tempa\forest@tempb\space 1\else0\fi}%
}%
\forest@process@left@esetappend{\forest@tempa}%
@@ -3239,7 +3255,7 @@
\forest@def@processor{|}{2}{}{% or
\def\forest@tempa{0}%
\forest@repeat@n@times{\forest@process@n}{%
- \forest@process@left@bottompop\forest@tempb
+ \forest@process@left@toppop\forest@tempb
\edef\forest@tempa{\ifnum0=\forest@tempa\forest@tempb\space 0\else1\fi}%
}%
\forest@process@left@esetappend{\forest@tempa}%
@@ -4738,11 +4754,10 @@
{\noexpand\forest@forstepwrapper{#1\ifnum\forest@nodewalkstephandler@nargs>0=\fi\forest@util@nargs{####}{\number\numexpr\forest@nodewalkstephandler@nargs}{0}}{####\number\numexpr\forest@nodewalkstephandler@nargs+1}},
}%
\fi\fi
- % Uncomment this to collect a list of for-based spatial propagators
- %\appto\bigbadforlist{[#1]}%
\fi
},
}
+{\csname forest@@doc@@hook@bigbadforlist\endcsname}%
\pgfqkeys{/handlers}{
.nodewalk style/.code={\forest@handlers@savecurrentpath\pgfkeysalso{%
\forest@currentpath/nodewalk/\forest@currentname/.style={#1}%
@@ -6898,11 +6913,11 @@
\forest@node@boundary\forest@negative@node@edge\forest@positive@node@edge
\forestolet{negative@edge@#1}\forest@negative@node@edge
\forestolet{positive@edge@#1}\forest@positive@node@edge
- \get@edges@merge{negative}{#1}%
- \get@edges@merge{positive}{#1}%
+ \forest@get@edges@merge{negative}{#1}%
+ \forest@get@edges@merge{positive}{#1}%
%}%
}
-\def\get@edges@merge#1#2{%
+\def\forest@get@edges@merge#1#2{%
\ifnum\forestove{n children}>0
\forestoget{#1@edge@#2}\forest@node@edge
\forest@pointanchor{parent anchor}%
@@ -9201,7 +9216,7 @@
}%
}{}%
\setbox0\hbox{%
- \begin{pgfpicture}% this is expensive: so that's why caching
+ \begin{pgfpicture}%
\if\relax\forestOve{#1}{#2}\relax
\pgfpointanchor{\forestOve{#1}{\forest@pa@temp@name}}{center}%
\else