summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/synttree
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2006-07-21 23:47:43 +0000
committerKarl Berry <karl@freefriends.org>2006-07-21 23:47:43 +0000
commitc3ea4d2926cc433f86635f1d9d122be96311c55f (patch)
tree03180fca9c5e6288c81b7c2bbd4dcea80c7eb0ab /Master/texmf-dist/tex/latex/synttree
parent51e3a37989b9f2ace36eb360c42fee6dcff11458 (diff)
synttree update (20jul06)
git-svn-id: svn://tug.org/texlive/trunk@1891 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/synttree')
-rw-r--r--Master/texmf-dist/tex/latex/synttree/synttree.sty188
1 files changed, 72 insertions, 116 deletions
diff --git a/Master/texmf-dist/tex/latex/synttree/synttree.sty b/Master/texmf-dist/tex/latex/synttree/synttree.sty
index 9f4075af960..4a0c345f3e1 100644
--- a/Master/texmf-dist/tex/latex/synttree/synttree.sty
+++ b/Master/texmf-dist/tex/latex/synttree/synttree.sty
@@ -20,10 +20,10 @@
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
-%% \CheckSum{806}
+%% \CheckSum{747}
%% synttree.dtx
%% Package `synttree' for use with LaTeX 2e
-%% Version 1.3.1
+%% Version 1.4.1
%% \CharacterTable
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
@@ -78,24 +78,21 @@
\newif\ifMTr@uselabel
\newbox\MTr@labelbox
\newbox\MTr@treebox
-\def\MTr@makechildcounter#1{
+\def\MTr@makechildcounter#1{%
\expandafter\newcount\csname MTr@child#1\endcsname%
}
-\def\MTr@makechildstoreage#1{
+\def\MTr@makechildstoreage#1{%
\expandafter\newsavebox\csname MTr@child#1box\endcsname%
- \MTr@makechildcounter{#1x}
- \MTr@makechildcounter{#1y}
- \MTr@makechildcounter{#1v}
- \MTr@makechildcounter{#1w}
- \MTr@makechildcounter{#1height}
- \MTr@makechildcounter{#1depth}
- \MTr@makechildcounter{#1branchmult}
- \expandafter\newcount\csname MTr@pic#1height\endcsname
- \expandafter\newif\csname ifMTr@child#1triangle\endcsname%
+ \MTr@makechildcounter{#1x}%
+ \MTr@makechildcounter{#1y}%
+ \MTr@makechildcounter{#1v}%
+ \MTr@makechildcounter{#1w}%
+ \MTr@makechildcounter{#1height}%
+ \MTr@makechildcounter{#1depth}%
+ \MTr@makechildcounter{#1branchmult}%
+ \MTr@makechildcounter{#1picheight}%
+ \MTr@makechildcounter{#1triangle}%
}
-\MTr@makechildstoreage{i}
-\MTr@makechildstoreage{ii}
-\MTr@makechildstoreage{iii}
\def\MTr@childparam#1#2{\csname MTr@child#1#2\endcsname}
\newcount\MTr@treev
\newcount\MTr@treew
@@ -112,6 +109,7 @@
\newcount\MTr@picwidth
\newcount\MTr@picheight
\newlength{\MTr@templength}
+\newcount\MTr@loopcnta
\newcount\MTr@tempcnta
\newcount\MTr@tempcntb
\newcount\MTr@tempcntc
@@ -164,7 +162,7 @@
\advance\MTr@level by -1%
\MTr@dorightbracket%
\ifnum\MTr@level=0%
- \unhbox\MTr@childibox%
+ \unhbox\MTr@childibox{}%
\else
\@AfterFi{\MTr@parserightbracket}%
\fi%
@@ -175,16 +173,16 @@
\MTr@mytrianglefalse%
\MTr@parsedot#1.: \END%
\fi%
- \ifx:#2
- \else
+ \ifx:#2%
+ \else%
\MTr@doleftbracket%
\advance\MTr@level by 1%
\@AfterFi{\MTr@parseleftbracket#2\END}%
\fi%
}
-\def\MTr@parsedot#1.#2 #3\END{
- \ifx:#2
- \setbox\MTr@labelbox\hbox{#1}
+\def\MTr@parsedot#1.#2 #3\END{%
+ \ifx:#2%
+ \setbox\MTr@labelbox\hbox{\ignorespaces#1\unskip}%
\else
\ifx#2b\MTr@bottomnodetrue\else%
\ifx#2x\MTr@bottomnodetrue\MTr@mytriangletrue\else%
@@ -208,19 +206,23 @@
\def\MTr@savecurrentchildbox{%
\advance\MTr@numchildren by 1
\ifnum\MTr@numchildren<1%
- \typeout{There is no child box to save.}%
+ \typeout{synttree internal warning: There is no child box to save.}%
\else
- \ifnum\MTr@numchildren>3%
- \typeout{I can save at most three child boxes.}%
- \else
- \MTr@savechildbox{\romannumeral\MTr@numchildren}%
+ \ifnum\MTr@numchildren>10%
+ \typeout{synttree warning: More than 10 child boxes.
+ Can this be true?}%
\fi
+ \MTr@savechildbox{\romannumeral\MTr@numchildren}%
\fi
}
\def\MTr@savechildbox#1{%
+ \expandafter
+ \ifx\csname MTr@child#1box\endcsname\relax%
+ \MTr@makechildstoreage{#1}%
+ \fi%
\setbox%
- \csname MTr@child#1box\endcsname%
- \hbox{\unhbox\MTr@treebox}%
+ \csname MTr@child#1box\endcsname%
+ \hbox{\unhbox\MTr@treebox}%
\csname MTr@child#1v\endcsname\MTr@treev%
\csname MTr@child#1w\endcsname\MTr@treew%
\csname MTr@child#1x\endcsname\MTr@treev%
@@ -228,18 +230,11 @@
\csname MTr@child#1depth\endcsname\MTr@treedepth%
\csname MTr@child#1branchmult\endcsname\MTr@branchmult%
\ifMTr@triangle%
- \csname MTr@child#1triangletrue\endcsname%
+ \csname MTr@child#1triangle\endcsname 1%
\else%
- \csname MTr@child#1trianglefalse\endcsname%
+ \csname MTr@child#1triangle\endcsname 0%
\fi
}
-\def\MTr@drawchild#1{%
- \MTr@tempcnta\MTr@childparam{#1}{x}
- \advance\MTr@tempcnta-\MTr@childparam{#1}{v}
- \put(\MTr@tempcnta,\MTr@childparam{#1}{y}){%
- \makebox(0,0)[tl]{%
- \usebox{\csname MTr@child#1box\endcsname}}}%
-}
\def\MTr@bottomnodetrue{%
\MTr@branchmult\MTr@maxlevel%
\advance\MTr@branchmult-\MTr@level%
@@ -263,7 +258,7 @@
\advance\MTr@tempcnta-\MTr@labelheight%
\advance\MTr@tempcnta\csname MTr@child#1height\endcsname%
\csname MTr@child#1y\endcsname\MTr@tempcnta%
- \csname MTr@pic#1height\endcsname\MTr@tempcntb%
+ \csname MTr@child#1picheight\endcsname\MTr@tempcntb%
}
\def\MTr@adjustdistance#1#2{%
\MTr@tempcnta\MTr@childparam{#1}{w}%
@@ -321,7 +316,8 @@
\def\MTr@drawchildline#1{
\MTr@tempcnta\MTr@childparam{#1}{y}
\advance\MTr@tempcnta\MTr@lineoffset%
- \csname ifMTr@child#1triangle\endcsname%
+ \expandafter
+ \ifnum\csname MTr@child#1triangle\endcsname=1%
\MTr@tempcntb\MTr@childparam{#1}{x}%
\MTr@tempcntc\MTr@tempcntb%
\advance\MTr@tempcntb \MTr@childparam{#1}{w}%
@@ -348,17 +344,11 @@
\MTr@labelhalfwidth\wd\MTr@labelbox%
\divide\MTr@labelhalfwidth 2%
\ifnum\MTr@numchildren=0%
- \global\setbox\MTr@treebox\hbox{\MTr@outputlabel}
- \fi
- \ifnum\MTr@numchildren=1%
- \global\setbox\MTr@treebox\hbox{\MTr@outputonechild}
- \fi
- \ifnum\MTr@numchildren=2%
- \global\setbox\MTr@treebox\hbox{\MTr@outputtwochildren}
- \fi
- \ifnum\MTr@numchildren=3%
- \global\setbox\MTr@treebox\hbox{\MTr@outputthreechildren}
- \fi
+ \global\setbox\MTr@treebox\hbox{\MTr@outputlabel}%
+ \fi%
+ \ifnum\MTr@numchildren>0%
+ \global\setbox\MTr@treebox\hbox{\MTr@outputchildren{\the\MTr@numchildren}}%
+ \fi%
\global\MTr@branchmult\MTr@mybranchmult%
\ifMTr@mytriangle%
\global\MTr@triangletrue%
@@ -395,71 +385,37 @@
\usebox{\MTr@labelbox}}}%
\end{picture}%
}
-\def\MTr@outputonechild{%
- \MTr@setparentdimens{i}{i}%
- \advance\MTr@childix\MTr@morex%
- \MTr@setverticalchilddimens{i}%
- \MTr@picheight\MTr@piciheight%
- \MTr@setpictureparameters%
- \begin{picture}%
- (\MTr@picwidth,\MTr@picheight)%
- (0,-\MTr@picheight)%
- %\put(0,-\MTr@picheight){\framebox(\MTr@picwidth,\MTr@picheight){}}%
- \MTr@drawlabel%
- \MTr@drawchild{i}%
- \MTr@drawchildline{i}
- \end{picture}%
-}
-\def\MTr@outputtwochildren{%
- \MTr@adjustdistance{i}{ii}%
- \MTr@setparentdimens{i}{ii}%
- \advance\MTr@childix\MTr@morex%
- \advance\MTr@childiix\MTr@morex%
- \MTr@setverticalchilddimens{i}%
- \MTr@setverticalchilddimens{ii}%
- \ifnum\MTr@piciheight>\MTr@piciiheight%
- \MTr@picheight\MTr@piciheight%
- \else%
- \MTr@picheight\MTr@piciiheight%
- \fi%
- \MTr@setpictureparameters%
- \begin{picture}(\MTr@picwidth,\MTr@picheight)(0,-\MTr@picheight)%
- %\put(0,-\MTr@picheight){\framebox(\MTr@picwidth,\MTr@picheight){}}%
- \MTr@drawlabel%
- \MTr@drawchild{i}
- \MTr@drawchild{ii}
- \MTr@drawchildline{i}
- \MTr@drawchildline{ii}
- \end{picture}%
-}
-\def\MTr@outputthreechildren{%
- \MTr@adjustdistance{i}{ii}%
- \MTr@adjustdistance{ii}{iii}%
- \MTr@setparentdimens{i}{iii}%
- \advance\MTr@childix\MTr@morex%
- \advance\MTr@childiix\MTr@morex%
- \advance\MTr@childiiix\MTr@morex%
- \MTr@setverticalchilddimens{i}%
- \MTr@setverticalchilddimens{ii}%
- \MTr@setverticalchilddimens{iii}%
- \MTr@picheight\MTr@piciheight%
- \ifnum\MTr@piciiheight>\MTr@picheight%
- \MTr@picheight\MTr@piciiheight%
- \fi%
- \ifnum\MTr@piciiiheight>\MTr@picheight%
- \MTr@picheight\MTr@piciiiheight%
- \fi%
- \MTr@setpictureparameters%
- \begin{picture}(\MTr@picwidth,\MTr@picheight)(0,-\MTr@picheight)%
- %\put(0,-\MTr@picheight){\framebox(\MTr@picwidth,\MTr@picheight){}}%
- \MTr@drawlabel%
- \MTr@drawchild{i}%
- \MTr@drawchild{ii}%
- \MTr@drawchild{iii}%
- \MTr@drawchildline{i}
- \MTr@drawchildline{ii}
- \MTr@drawchildline{iii}
- \end{picture}%
+\def\MTr@outputchildren#1{%
+ \ifnum#1>1
+ \MTr@loopcnta 1
+ \loop
+\edef\MTr@temp{\romannumeral\MTr@loopcnta}%
+\ifnum\MTr@loopcnta<#1
+ \advance \MTr@loopcnta by 1
+ \MTr@adjustdistance{\MTr@temp}{\romannumeral\MTr@loopcnta}%
+ \repeat
+ \fi
+ \MTr@setparentdimens{i}{\romannumeral#1}%
+ \MTr@picheight 0%
+ \MTr@loopcnta #1
+ \loop
+ \edef\MTr@temp{\romannumeral\MTr@loopcnta}%
+ \advance\MTr@childparam{\MTr@temp}{x}\MTr@morex%
+ \MTr@setverticalchilddimens{\romannumeral\MTr@loopcnta}%
+ \ifnum\MTr@childparam{\MTr@temp}{picheight}>\MTr@picheight%
+\MTr@picheight\MTr@childparam{\MTr@temp}{picheight}%
+ \fi%
+ \advance \MTr@loopcnta by -1 \ifnum\MTr@loopcnta>0 \repeat
+ \MTr@setpictureparameters%
+ \begin{picture}(\MTr@picwidth,\MTr@picheight)(0,-\MTr@picheight)%
+ %\put(0,-\MTr@picheight){\framebox(\MTr@picwidth,\MTr@picheight){}}%
+ \MTr@drawlabel%
+ \MTr@loopcnta #1
+ \loop
+ \expandafter\MTr@drawchild{\romannumeral\MTr@loopcnta}%
+ \expandafter\MTr@drawchildline{\romannumeral\MTr@loopcnta}
+ \advance \MTr@loopcnta by -1 \ifnum\MTr@loopcnta>0 \repeat
+ \end{picture}%
}
\endinput
%%