summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/eclbip
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/eclbip
Initial commit
Diffstat (limited to 'macros/latex/contrib/eclbip')
-rw-r--r--macros/latex/contrib/eclbip/ecltree.sty150
-rw-r--r--macros/latex/contrib/eclbip/ecltreesample.pdfbin0 -> 39387 bytes
-rw-r--r--macros/latex/contrib/eclbip/ecltreesample.tex248
3 files changed, 398 insertions, 0 deletions
diff --git a/macros/latex/contrib/eclbip/ecltree.sty b/macros/latex/contrib/eclbip/ecltree.sty
new file mode 100644
index 0000000000..234829c17c
--- /dev/null
+++ b/macros/latex/contrib/eclbip/ecltree.sty
@@ -0,0 +1,150 @@
+% ecltree.sty (C) hideki isozaki Nov. 12, 1990
+% FMi fix: use \protected@edef instead of \edef (2002/11)
+%
+% It may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.2
+% 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.2 or later is part of all distributions of LaTeX
+% version 1999/12/01 or later.
+%
+% In this style file, I intentionally didn't use ordinary
+% terms such as \tree, \subtree, \leaf etc.
+% because I will use different tree macros in one file.
+%
+% This macro needs epic.sty
+% Confirm your epic.sty does not contain \makeatother at EOF.
+%
+
+\makeatletter
+\typeout{ECL Tree graph macro by isozaki, Nov. 12, 1990 + 2e FIX}
+
+% Ignore End Of Line
+
+\endlinechar=-1\relax
+
+% Dimensions and Boxes : See below
+
+\newdimen\@BundleWidth
+\newdimen\@BundleDepth
+\newdimen\@BundleHeight
+\newbox\@NodeBox
+\newdimen\GapDepth
+\GapDepth=15\p@
+\newdimen\GapWidth
+\GapWidth=4\p@
+\newdimen\EdgeLabelSep
+\EdgeLabelSep=7\p@
+
+%
+% --------------- -
+% | \@TopLabel | |
+% --------------- - |
+% (\@SupportX,\@SupportY) | |
+% / \ | |
+% / \ | |
+% / \ | \GapDepth | \@BundleHeight
+% / \ | |
+% / \ | |
+%(\@HandleX,0) \ | |
+% -------------- -------------- - -
+% | \@NodeBox | | \@NodeBox | | \@BundleDepth
+% | | -------------- |
+% -------------- -
+% |---|
+% \GapWidth
+%
+% |-----------------------------|
+% \@PicWidth
+
+%
+% The main environment to make a (sub)tree: bundle
+% \begin{bundle} \chunk_1 \chunk_2 ... \chunk_n \end{bundle}
+%
+\def\bundle#1{\leavevmode\hbox\bgroup
+ \endlinechar=-1
+ \def\@TopLabel{#1}
+ \def\@HandleList{}
+ \def\@EdgeLabels{}
+ \protected@edef\@EdgeLabelsY{\expandafter\@RemoveDim\the\EdgeLabelSep}
+ \unitlength=\p@
+ \@BundleWidth=\z@
+ \@BundleHeight=\z@
+ \@BundleDepth=\z@
+ \ignorespaces}
+
+\def\endbundle{
+ \advance\@BundleWidth by -\GapWidth
+ \hskip-\GapWidth
+ \setbox\@NodeBox=\hbox{\vbox{\null\@TopLabel}}
+ \advance\@BundleHeight by \GapDepth
+ \advance\@BundleHeight by \ht\@NodeBox
+ \advance\@BundleHeight by \dp\@NodeBox
+ \vrule\@height\@BundleHeight\@width\z@\@depth\@BundleDepth
+ \protected@edef\@SupportY{\expandafter\@RemoveDim\the\GapDepth}
+ \protected@edef\@SupportX{\expandafter\@RemoveDim\the\@BundleWidth}
+ \setbox\@NodeBox=\hbox to \z@{\hss\@TopLabel\hss}
+ \hskip-\@BundleWidth
+ \protected@edef\@EdgeLabels{\@EdgeLabels{}}
+ \protected@edef\@PicWidth{\expandafter\@RemoveDim\the\@BundleWidth}
+ \@BundleWidth=0.5\@BundleWidth
+ \protected@edef\@SupportX{\expandafter\@RemoveDim\the\@BundleWidth}
+ \@DrawBundle}
+
+
+\def\@DrawBundle{
+ \begin{picture}(\@PicWidth,0)(0,0)
+ \protected@edef\@HandleList{\expandafter\@cdr\@HandleList\@nil}
+ \@for\@HandleX:=\@HandleList\do{
+ \@DrawLine(\@SupportX,\@SupportY)(\@HandleX,0)
+ \put(\@HandleX,\@EdgeLabelsY){
+ \makebox(0,0){\expandafter\@car\@EdgeLabels\@nil}}
+ \protected@edef\@EdgeLabels{\expandafter\@cdr\@EdgeLabels\@nil}}
+ \put(\@SupportX,\@SupportY){\raise\dp\@NodeBox\box\@NodeBox}
+ \end{picture}\egroup}
+
+
+%
+% \chunk[#1]{#2} means a leaf or a subtree.
+% #1 ... Label for the edge which connects the leaf or the subtree
+% with its parent node. (optional argument)
+% #2 ... Label for the leaf or the subtree
+%
+
+\def\chunk{\@ifnextchar[{\@chunk}{\@chunk[]}}
+
+\def\@chunk[#1]#2{\protected@edef\@EdgeLabels{\@EdgeLabels{#1}}
+ \setbox\@NodeBox=\vtop{\null\hbox{#2}}
+ \advance\@BundleWidth by 0.5\wd\@NodeBox
+ \ifnum\@BundleDepth<\dp\@NodeBox
+ \@BundleDepth=\dp\@NodeBox\fi
+ \protected@edef\@HandleList{\@HandleList,
+ \expandafter\@RemoveDim\the\@BundleWidth}
+ \advance\@BundleWidth by 0.5\wd\@NodeBox
+ \advance\@BundleWidth by \GapWidth
+ \box\@NodeBox\hskip\GapWidth
+ \ignorespaces}
+
+% To change line attribute
+% ex.
+% \drawwith{\path} ... efficient solid line defined by eepic.sty
+% \drawwith{\dashline{2}}
+
+\def\drawwith#1{\def\@DrawLine{#1}}
+
+% Default
+\drawwith{\drawline}
+
+% Ordinary catcode for p and t is 11
+% Application of \the to dimen generates text such as 1.0pt.
+% This pt's catcode is 12.
+
+{\catcode`\p=12 \catcode`\t=12
+\gdef\@RemoveDim#1pt{#1}}
+
+% Restore original End Of Line
+
+\endlinechar=13\relax
+
+\endinput
diff --git a/macros/latex/contrib/eclbip/ecltreesample.pdf b/macros/latex/contrib/eclbip/ecltreesample.pdf
new file mode 100644
index 0000000000..0d4baf5efc
--- /dev/null
+++ b/macros/latex/contrib/eclbip/ecltreesample.pdf
Binary files differ
diff --git a/macros/latex/contrib/eclbip/ecltreesample.tex b/macros/latex/contrib/eclbip/ecltreesample.tex
new file mode 100644
index 0000000000..ef0b9746cc
--- /dev/null
+++ b/macros/latex/contrib/eclbip/ecltreesample.tex
@@ -0,0 +1,248 @@
+\documentclass{article}
+\usepackage{epic,eepic,ecltree}
+
+\title{A tree macro}
+
+\author{Hideki ISOZAKI\\NTT Basic Research Labs \& Stanford Univ.}
+
+\date{Nov. 30, 1990}
+
+
+\addtolength{\textwidth}{12pt}
+
+\begin{document}
+
+\maketitle
+
+
+\section{Setup}
+
+Include epic.sty and ecltree.sty\footnote{Electrical Communications Labs}
+in your document as below:
+\begin{verbatim}
+\documentclass{article}
+\usepackage{epic,ecltree}
+\end{verbatim}
+If your printer driver accepts tpic commands,
+you should specify eepic.sty after epic.sty.
+\begin{verbatim}
+\usepackage{epic,eepic,ecltree}
+\end{verbatim}
+As eepic.sty redefines some macros defined in epic.sty,
+Do not reverse this order.
+
+\section{bundle environment}
+
+A tree is drawn by {\it bundle} environment.
+The {\it bundle} environment has one argument.
+This argument specifies the top node label.
+Leaves should be specified by \verb|\chunk| in this environment.
+
+If you write
+\begin{verbatim}
+\begin{bundle}{xxx}
+\chunk{aaa}
+\chunk{bbb}
+\chunk{ccc}
+\end{bundle}
+\end{verbatim}
+you get
+\begin{bundle}{xxx}
+\chunk{aaa}
+\chunk{bbb}
+\chunk{ccc}
+\end{bundle}.
+
+You can nest the {\it bundle} environment.
+If you write
+\begin{verbatim}
+\begin{bundle}{xxx}
+\chunk{aaa}
+\chunk{
+ \begin{bundle}{yyy}
+ \chunk{bbb}
+ \chunk{ddd}
+ \end{bundle}}
+\chunk{ccc}
+\end{bundle}
+\end{verbatim}
+you get
+\begin{bundle}{xxx}
+\chunk{aaa}
+\chunk{
+ \begin{bundle}{yyy}
+ \chunk{bbb}
+ \chunk{ddd}
+ \end{bundle}}
+\chunk{ccc}
+\end{bundle}.
+
+\section{Line attribute}
+
+You can draw not only solid lines but also
+dotted lines and dash lines.
+epic.sty and eepic.sty define several commands for them.
+If you want to use
+\begin{verbatim}
+\dashline[65]{3}(x1,y1)(x2,y2)
+\end{verbatim}
+to draw lines, use \verb|\drawwith| command
+before (or in) the bundle environment.
+\begin{verbatim}
+\drawwith{\dashline[65]{3}}
+\end{verbatim}
+
+\drawwith{\dashline[65]{3}}
+Then you get
+\begin{bundle}{xxx}
+\chunk{aaa}
+\chunk{
+ \begin{bundle}{yyy}
+ \chunk{bbb}
+ \chunk{ddd}
+ \end{bundle}}
+\chunk{ccc}
+\end{bundle}.
+
+The argument of \verb|\drawwith| is evaluated
+at \verb|\end{bundle}|. Hence, if you write
+\begin{verbatim}
+\begin{bundle}{xxx}
+\chunk{aaa}
+\chunk{
+ \begin{bundle}{yyy}
+ \drawwith{\drawline}
+ \chunk{bbb}
+ \drawwith{\dashline[65]{3}}
+ \chunk{ddd}
+ \end{bundle}}
+\drawwith{\dottedline{3}}
+\chunk{ccc}
+\end{bundle}
+\end{verbatim}
+you get
+\begin{bundle}{xxx}
+\chunk{aaa}
+\chunk{
+ \begin{bundle}{yyy}
+ \drawwith{\drawline}
+ \chunk{bbb}
+ \drawwith{\dashline[65]{3}}
+ \chunk{ddd}
+ \end{bundle}}
+\drawwith{\dottedline{3}}
+\chunk{ccc}
+\end{bundle}.
+
+You can nest the \verb|\drawwith|. If you write
+\begin{verbatim}
+\drawwith{\drawwith{\drawwith{\dottedline{3}}\drawline}\dashline{3}}
+\begin{bundle}{xxx}
+\chunk{aaa}
+\chunk{
+ \begin{bundle}{yyy}
+ \chunk{bbb}
+ \chunk{ddd}
+ \chunk{eee}
+ \end{bundle}}
+\chunk{ccc}
+\chunk{fff}
+\end{bundle}
+\end{verbatim}
+you get
+\drawwith{\drawwith{\drawwith{\dottedline{3}}\drawline}\dashline{3}}
+\begin{bundle}{xxx}
+\chunk{aaa}
+\chunk{
+ \begin{bundle}{yyy}
+ \chunk{bbb}
+ \chunk{ddd}
+ \chunk{eee}
+ \end{bundle}}
+\chunk{ccc}
+\chunk{fff}
+\end{bundle}.
+Thus the nested \verb|\drawwith| is used in the reverse order.
+
+\section{Edge labels}
+
+You can write edge labels. They should be specified as the optional
+argument of \verb|\chunk|. Note that the width of an edge label
+is neglected. If you write
+\drawwith{\drawline}
+\begin{verbatim}
+\begin{bundle}{xxx}
+\chunk[left]{aaa}
+\chunk{
+ \begin{bundle}{yyy}
+ \chunk{bbb}
+ \chunk{ddd}
+ \end{bundle}}
+\chunk[right]{ccc}
+\end{bundle}
+\end{verbatim}
+you get
+\begin{bundle}{xxx}
+\chunk[left]{aaa}
+\chunk{
+ \begin{bundle}{yyy}
+ \chunk{bbb}
+ \chunk{ddd}
+ \end{bundle}}
+\chunk[right]{ccc}
+\end{bundle}.
+
+
+\section{Spacing}
+
+The {\it bundle} environment
+has three parameters for spacing.
+
+\begin{itemize}
+
+\item \verb|\GapDepth| means minimum height of gaps between
+adjacent nodes.
+
+\item \verb|\GapWidth| means minimum width of gaps between
+adjacent nodes.
+
+\item \verb|\EdgeLabelSep| means height of an edge label
+from the lower node of the edge.
+
+\end{itemize}
+
+You should set these parameters before the {\tt bundle} environment
+if you dislike default values.
+
+If you write
+\begin{verbatim}
+\begin{bundle}{xxx}
+\chunk{aaa}
+\chunk{
+ \setlength{\GapDepth}{5pt}
+ \setlength{\GapWidth}{5pt}
+ \begin{bundle}{yyy}
+ \chunk{bbb}
+ \chunk{ddd}
+ \end{bundle}}
+\chunk{ccc}
+\end{bundle}
+\end{verbatim}
+you get
+\begin{bundle}{xxx}
+\chunk{aaa}
+\chunk{
+ \setlength{\GapDepth}{5pt}
+ \setlength{\GapWidth}{5pt}
+ \begin{bundle}{yyy}
+ \chunk{bbb}
+ \chunk{ddd}
+ \end{bundle}}
+\chunk{ccc}
+\end{bundle}.
+
+
+
+
+\end{document}
+