summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2014-01-25 22:42:24 +0000
committerKarl Berry <karl@freefriends.org>2014-01-25 22:42:24 +0000
commit40d79de6e8268eb6f3dcd9b24b656fe6643b5792 (patch)
tree43b6737e0ff6d7b6d8f26459c471471729a720a7
parent1db7092b704f1203699f36e7065b822324747a3a (diff)
sa-tikz (25jan14)
git-svn-id: svn://tug.org/texlive/trunk@32788 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/latex/sa-tikz/README6
-rw-r--r--Master/texmf-dist/doc/latex/sa-tikz/pgfmanual-en-macros.tex1058
-rw-r--r--Master/texmf-dist/doc/latex/sa-tikz/sa-tikz-doc.pdfbin837178 -> 887202 bytes
-rw-r--r--Master/texmf-dist/doc/latex/sa-tikz/sa-tikz-doc.tex142
-rw-r--r--Master/texmf-dist/tex/latex/sa-tikz/sa-tikz.sty48
-rw-r--r--Master/texmf-dist/tex/latex/sa-tikz/tikzlibraryswitching-architectures.code.tex46
6 files changed, 922 insertions, 378 deletions
diff --git a/Master/texmf-dist/doc/latex/sa-tikz/README b/Master/texmf-dist/doc/latex/sa-tikz/README
index cf8bd3b2dac..93c2a940d89 100644
--- a/Master/texmf-dist/doc/latex/sa-tikz/README
+++ b/Master/texmf-dist/doc/latex/sa-tikz/README
@@ -1,7 +1,7 @@
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
% Sa-TikZ: TikZ library to draw switching architectures
%
-% Version v0.6 28/09/2013 - (C) Claudio Fiandrino
+% Version v0.7 2014/1/21 - (C) Claudio Fiandrino
%
% E-mail: claudio dot fiandrino at gmail dot com
%
@@ -9,5 +9,5 @@
% See http://www.latex-project.org/lppl.txt
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
%
-% The library provides an easy way to draw switching architectures
-% and to customize their aspect.
+% The library provides tools to draw switching architectures
+% and to customize their aspect. \ No newline at end of file
diff --git a/Master/texmf-dist/doc/latex/sa-tikz/pgfmanual-en-macros.tex b/Master/texmf-dist/doc/latex/sa-tikz/pgfmanual-en-macros.tex
index 116cde6d9bf..e687ae3c426 100644
--- a/Master/texmf-dist/doc/latex/sa-tikz/pgfmanual-en-macros.tex
+++ b/Master/texmf-dist/doc/latex/sa-tikz/pgfmanual-en-macros.tex
@@ -7,8 +7,7 @@
%
% See the file doc/generic/pgf/licenses/LICENSE for more details.
-% $Header: /cvsroot/pgf/pgf/doc/generic/pgf/macros/pgfmanual-en-macros.tex,v 1.45 2009/11/15 13:13:24 ludewich Exp $
-
+% $Header: /cvsroot/pgf/pgf/doc/generic/pgf/macros/pgfmanual-en-macros.tex,v 1.79 2013/12/20 15:22:35 tantau Exp $
\providecommand\href[2]{\texttt{#1}}
@@ -18,20 +17,34 @@
\colorlet{examplefill}{yellow!80!black}
\definecolor{graphicbackground}{rgb}{0.96,0.96,0.8}
-\definecolor{codebackground}{rgb}{0.8,0.8,1}
+\definecolor{codebackground}{rgb}{0.9,0.9,1}
\newenvironment{pgfmanualentry}{\list{}{\leftmargin=2em\itemindent-\leftmargin\def\makelabel##1{\hss##1}}}{\endlist}
-\newcommand\pgfmanualentryheadline[1]{\itemsep=0pt\parskip=0pt\item\strut{#1}\par\topsep=0pt}
+\newcommand\pgfmanualentryheadline[1]{\itemsep=0pt\parskip=0pt{\raggedright\item\strut{#1}\par}\topsep=0pt}
\newcommand\pgfmanualbody{\parskip3pt}
+\let\origtexttt=\texttt
+\def\texttt#1{{\def\textunderscore{\char`\_}\def\textbraceleft{\char`\{}\def\textbraceright{\char`\}}\origtexttt{#1}}}
+\def\exclamationmarktext{!}
+\def\atmarktext{@}
+
+{
+ \catcode`\|=12
+ \gdef\pgfmanualnormalbar{|}
+ \catcode`\|=13
+ \AtBeginDocument{\gdef|{\ifmmode\pgfmanualnormalbar\else\expandafter\verb\expandafter|\fi}}
+}
+
\newenvironment{pgflayout}[1]{
\begin{pgfmanualentry}
- \pgfmanualentryheadline{\texttt{\string\pgfpagesuselayout\char`\{\declare{#1}\char`\}}\oarg{options}}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \texttt{\string\pgfpagesuselayout\char`\{\declare{#1}\char`\}}\oarg{options}%
+ }
\index{#1@\protect\texttt{#1} layout}%
\index{Page layouts!#1@\protect\texttt{#1}}%
- \pgfmanualpdflabel{#1}{}%
\pgfmanualbody
}
{
@@ -48,12 +61,149 @@
\end{pgfmanualentry}
}
+\makeatletter
+
+\def\includeluadocumentationof#1{
+ \directlua{require 'pgf.manual.DocumentParser'}
+ \directlua{pgf.manual.DocumentParser.include '#1'}
+}
+
+\newenvironment{luageneric}[4]{
+ \pgfmanualentry
+ \pgfmanualentryheadline{#4 \texttt{#1\declare{#2}}#3}
+ \index{#2@\protect\texttt{#2} (Lua)}%
+ \def\temp{#1}
+ \ifx\temp\pgfutil@empty\else
+ \index{#1@\protect\texttt{#1}!#2@\protect\texttt{#2} (Lua)}%
+ \fi
+ \pgfmanualbody
+}{\endpgfmanualentry}
+
+\newenvironment{luatable}[3]{
+ \medskip
+ \luageneric{#1}{#2}{ (declared in \texttt{#3})}{\textbf{Lua table}}
+}{\endluageneric}
+
+\newenvironment{luafield}[1]{
+ \pgfmanualentry
+ \pgfmanualentryheadline{Field \texttt{\declare{#1}}}
+ \pgfmanualbody
+}{\endpgfmanualentry}
+
+
+\newenvironment{lualibrary}[1]{
+ \pgfmanualentry
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Graph Drawing Library} \texttt{\declare{#1}}%
+ }
+ \index{#1@\protect\texttt{#1} graph drawing library}%
+ \index{Libraries!#1@\protect\texttt{#1}}%
+ \index{Graph drawing libraries!#1@\protect\texttt{#1}}%
+ \vskip.25em
+ {\ttfamily\char`\\usegdlibrary\char`\{\declare{#1}\char`\}\space\space \char`\%\space\space \LaTeX\space and plain \TeX}\\
+ {\ttfamily\char`\\usegdlibrary[\declare{#1}]\space \char`\%\space\space Con\TeX t}\smallskip\par
+ \pgfmanualbody
+}{\endpgfmanualentry}
+
+\newenvironment{luadeclare}[4]{
+ \pgfmanualentry
+ \def\manual@temp@default{#3}%
+ \def\manual@temp@initial{#4}%
+ \def\manual@temp@{#3#4}%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ {\ttfamily/graph
+ drawing/\declare{#1}\opt{=}}\opt{#2}\hfill%
+ \ifx\manual@temp@\pgfutil@empty\else%
+ (\ifx\manual@temp@default\pgfutil@empty\else%
+ default {\ttfamily #3}\ifx\manual@temp@initial\pgfutil@empty\else, \fi%
+ \fi%
+ \ifx\manual@temp@initial\pgfutil@empty\else%
+ initially {\ttfamily #4}%
+ \fi%
+ )\fi%
+ }%
+ \index{#1@\protect\texttt{#1} key}%
+ \pgfmanualbody
+ \gdef\myname{#1}%
+% \keyalias{tikz}
+% \keyalias{tikz/graphs}
+}{\endpgfmanualentry}
+
+\newenvironment{luadeclarestyle}[4]{
+ \pgfmanualentry
+ \def\manual@temp@para{#2}%
+ \def\manual@temp@default{#3}%
+ \def\manual@temp@initial{#4}%
+ \def\manual@temp@{#3#4}%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ {\ttfamily/graph drawing/\declare{#1}}\ifx\manual@temp@para\pgfutil@empty\else\opt{\texttt=}\opt{#2}\fi\hfill%
+ (style\ifx\manual@temp@\pgfutil@empty\else, %
+ \ifx\manual@temp@default\pgfutil@empty\else%
+ default {\ttfamily #3}\ifx\manual@temp@initial\pgfutil@empty\else, \fi%
+ \fi%
+ \ifx\manual@temp@initial\pgfutil@empty\else%
+ initially {\ttfamily #4}%
+ \fi%
+ \fi)%
+ }%
+ \index{#1@\protect\texttt{#1} key}%
+ \pgfmanualbody%
+ \gdef\myname{#1}%
+% \keyalias{tikz}
+% \keyalias{tikz/graphs}
+}{\endpgfmanualentry}
+
+\newenvironment{luanamespace}[2]{
+ \luageneric{#1}{#2}{}{\textbf{Lua namespace}}
+}{\endluageneric}
+
+\newenvironment{luafiledescription}[1]{}{}
+
+\newenvironment{luacommand}[4]{
+ \hypertarget{pgf/lua/#1}{\luageneric{#2}{#3}{\texttt{(#4)}}{\texttt{function}}}
+}{\endluageneric}
+
+\newenvironment{luaparameters}{\par\emph{Parameters:}%
+ \parametercount=0\relax%
+ \let\item=\parameteritem%
+ \let\list=\restorelist%
+}
+{\par
+}
+
+\newenvironment{luareturns}{\par\emph{Returns:}%
+ \parametercount=0\relax%
+ \let\item=\parameteritem%
+ \let\list=\restorelist%
+}
+{\par
+}
+
+\newcount\parametercount
+
+\newenvironment{parameterdescription}{\unskip%
+ \parametercount=0\relax%
+ \let\item=\parameteritem%
+ \let\list=\restorelist%
+}
+{\par
+}
+\let\saveditemcommand=\item
+\let\savedlistcommand=\list
+\def\denselist#1#2{\savedlistcommand{#1}{#2}\parskip0pt\itemsep0pt}
+\def\restorelist{\let\item=\saveditemcommand\denselist}
+\def\parameteritem{\pgfutil@ifnextchar[\parameteritem@{}}%}
+\def\parameteritem@[#1]{\advance\parametercount by1\relax\hskip0.15em plus 1em\emph{\the\parametercount.}\kern1ex\def\test{#1}\ifx\test\pgfutil@empty\else#1\kern.5em\fi}
+
\newenvironment{commandlist}[1]{%
- \begin{pgfmanualentry}
- \foreach \xx in {#1} {%
- \expandafter\extractcommand\xx\@@
- }%
- \pgfmanualbody
+ \begin{pgfmanualentry}
+ \foreach \xx in {#1} {%
+ \expandafter\extractcommand\xx\@@
+ }%
+ \pgfmanualbody
}{%
\end{pgfmanualentry}
}%
@@ -64,20 +214,21 @@
% \begin{internallist}[register]{\pgf@xa,\pgf@xb}
% \end{internallist}
\newenvironment{internallist}[2][register]{%
- \begin{pgfmanualentry}
- \foreach \xx in {#2} {%
- \expandafter\extractinternalcommand\expandafter{\xx}{#1}%
- }%
- \pgfmanualbody
+ \begin{pgfmanualentry}
+ \foreach \xx in {#2} {%
+ \expandafter\extractinternalcommand\expandafter{\xx}{#1}%
+ }%
+ \pgfmanualbody
}{%
\end{pgfmanualentry}
}%
\def\extractinternalcommand#1#2{%
- \pgfmanualentryheadline{Internal #2 \declare{\texttt{\string#1}}}%
\removeats{#1}%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{\textbackslash\strippedat}{}%
+ Internal #2 \declare{\texttt{\string#1}}}%
\index{Internals!\strippedat @\protect\myprintocmmand{\strippedat}}%
\index{\strippedat @\protect\myprintocmmand{\strippedat}}%
- \pgfmanualpdflabel{\textbackslash\strippedat}{}%
}
%% MW: START MATH MACROS
@@ -89,120 +240,147 @@
\def\extractmathfunctionname@#1(#2)#3\tmpb{\def\mathname{#1}}
\makeatother
-
+
\newenvironment{math-function}[1]{
- \def\mathdefaultname{#1}
- \extractmathfunctionname{#1}
- \edef\mathurl{{math:\mathname}}\expandafter\hypertarget\expandafter{\mathurl}{}%
- \begin{pgfmanualentry}
- \pgfmanualentryheadline{\texttt{#1}}%
- \index{\mathname @\protect\texttt{\mathname} math function}%
- \index{Math functions!\mathname @\protect\texttt{\mathname}}%
- \pgfmanualbody
+ \def\mathdefaultname{#1}
+ \extractmathfunctionname{#1}
+ \edef\mathurl{{math:\mathname}}\expandafter\hypertarget\expandafter{\mathurl}{}%
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{\texttt{#1}}%
+ \index{\mathname @\protect\texttt{\mathname} math function}%
+ \index{Math functions!\mathname @\protect\texttt{\mathname}}%
+ \pgfmanualbody
}
{
- \end{pgfmanualentry}
+ \end{pgfmanualentry}
}
\def\pgfmanualemptytext{}
\def\pgfmanualvbarvbar{\char`\|\char`\|}
\newenvironment{math-operator}[4][]{%
- \begin{pgfmanualentry}
- \csname math#3operator\endcsname{#2}{#4}
- \def\mathtest{#4}%
- \ifx\mathtest\pgfmanualemptytext%
- \def\mathtype{(#3 operator)}
- \else%
- \def\mathtype{(#3 operator; uses the \texttt{#4} function)}
- \fi%
- \pgfmanualentryheadline{\mathexample\hfill\mathtype}%
- \def\mathtest{#1}%
- \ifx\mathtest\pgfmanualemptytext%
- \index{#2@\protect\texttt{#2} #3 math operator}%
- \index{Math operators!#2@\protect\texttt{#2}}%
- \fi%
- \pgfmanualbody
+ \begin{pgfmanualentry}
+ \csname math#3operator\endcsname{#2}{#4}
+ \def\mathtest{#4}%
+ \ifx\mathtest\pgfmanualemptytext%
+ \def\mathtype{(#3 operator)}
+ \else%
+ \def\mathtype{(#3 operator; uses the \texttt{#4} function)}
+ \fi%
+ \pgfmanualentryheadline{\mathexample\hfill\mathtype}%
+ \def\mathtest{#1}%
+ \ifx\mathtest\pgfmanualemptytext%
+ \index{#2@\protect\texttt{#2} #3 math operator}%
+ \index{Math operators!#2@\protect\texttt{#2}}%
+ \fi%
+ \pgfmanualbody
}
{\end{pgfmanualentry}}
\newenvironment{math-operators}[5][]{%
- \begin{pgfmanualentry}
- \csname math#4operator\endcsname{#2}{#3}
- \def\mathtest{#5}%
- \ifx\mathtest\pgfmanualemptytext%
- \def\mathtype{(#4 operators)}
- \else%
- \def\mathtype{(#4 operators; use the \texttt{#5} function)}
- \fi%
- \pgfmanualentryheadline{\mathexample\hfill\mathtype}%
- \def\mathtest{#1}%
- \ifx\mathtest\pgfmanualemptytext%
- \index{#2#3@\protect\texttt{#2\protect\ #3} #4 math operators}%
- \index{Math operators!#2#3@\protect\texttt{#2\protect\ #3}}%
- \fi%
- \pgfmanualbody
+ \begin{pgfmanualentry}
+ \csname math#4operator\endcsname{#2}{#3}
+ \def\mathtest{#5}%
+ \ifx\mathtest\pgfmanualemptytext%
+ \def\mathtype{(#4 operators)}
+ \else%
+ \def\mathtype{(#4 operators; use the \texttt{#5} function)}
+ \fi%
+ \pgfmanualentryheadline{\mathexample\hfill\mathtype}%
+ \def\mathtest{#1}%
+ \ifx\mathtest\pgfmanualemptytext%
+ \index{#2#3@\protect\texttt{#2\protect\ #3} #4 math operators}%
+ \index{Math operators!#2#3@\protect\texttt{#2\protect\ #3}}%
+ \fi%
+ \pgfmanualbody
}
{\end{pgfmanualentry}}
\def\mathinfixoperator#1#2{%
- \def\mathoperator{\texttt{#1}}%
- \def\mathexample{\mvar{x}\space\texttt{#1}\space\mvar{y}}%
+ \def\mathoperator{\texttt{#1}}%
+ \def\mathexample{\mvar{x}\space\texttt{#1}\space\mvar{y}}%
}
\def\mathprefixoperator#1#2{%
- \def\mathoperator{\texttt{#1}}%
- \def\mathexample{\texttt{#1}\mvar{x}}%
+ \def\mathoperator{\texttt{#1}}%
+ \def\mathexample{\texttt{#1}\mvar{x}}%
}
\def\mathpostfixoperator#1#2{%
- \def\mathoperator{\texttt{#1}}
- \def\mathexample{\mvar{x}\texttt{#1}}%
+ \def\mathoperator{\texttt{#1}}
+ \def\mathexample{\mvar{x}\texttt{#1}}%
}
\def\mathgroupoperator#1#2{%
- \def\mathoperator{\texttt{#1\ #2}}%
- \def\mathexample{\texttt{#1}\mvar{x}\texttt{#2}}%
+ \def\mathoperator{\texttt{#1\ #2}}%
+ \def\mathexample{\texttt{#1}\mvar{x}\texttt{#2}}%
}
\expandafter\let\csname matharray accessoperator\endcsname=\mathgroupoperator
\expandafter\let\csname matharrayoperator\endcsname=\mathgroupoperator
\def\mathconditionaloperator#1#2{%
- \def\mathoperator{#1\space#2}
- \def\mathexample{\mvar{x}\ \texttt{#1}\ \mvar{y}\ {\texttt{#2}}\ \mvar{z}}
+ \def\mathoperator{#1\space#2}
+ \def\mathexample{\mvar{x}\ \texttt{#1}\ \mvar{y}\ {\texttt{#2}}\ \mvar{z}}
}
\newcommand\mathcommand[1][\mathdefaultname]{%
- \expandafter\makemathcommand#1(\empty)\stop%
- \expandafter\extractcommand\mathcommandname\@@%
- \medskip
+ \expandafter\makemathcommand#1(\empty)\stop%
+ \expandafter\extractcommand\mathcommandname\@@%
+ \medskip
}
\makeatletter
\def\makemathcommand#1(#2)#3\stop{%
- \expandafter\def\expandafter\mathcommandname\expandafter{\csname pgfmath#1\endcsname}%
- \ifx#2\empty%
- \else%
- \@makemathcommand#2,\stop,
- \fi}
+ \expandafter\def\expandafter\mathcommandname\expandafter{\csname pgfmath#1\endcsname}%
+ \ifx#2\empty%
+ \else%
+ \@makemathcommand#2,\stop,
+ \fi}
\def\@makemathcommand#1,{%
- \ifx#1\stop%
- \else%
- \expandafter\def\expandafter\mathcommandname\expandafter{\mathcommandname{\ttfamily\char`\{#1\char`\}}}%
- \expandafter\@makemathcommand%
- \fi}
+ \ifx#1\stop%
+ \else%
+ \expandafter\def\expandafter\mathcommandname\expandafter{\mathcommandname{\ttfamily\char`\{#1\char`\}}}%
+ \expandafter\@makemathcommand%
+ \fi}
\makeatother
\def\calcname{\textsc{calc}}
+
+\newenvironment{math-keyword}[1]{
+ \extracttikzmathkeyword#1@
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{\texttt{\color{red}\mathname}\mathrest}%
+ \index{\mathname @\protect\texttt{\mathname} tikz math function}%
+ \index{TikZ math functions!\mathname @\protect\texttt{\mathname}}%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\def\extracttikzmathkeyword#1#2@{%
+ \def\mathname{#1}%
+ \def\mathrest{#2}%
+}
+
%% MW: END MATH MACROS
\def\extractcommand#1#2\@@{%
- \pgfmanualentryheadline{\declare{\texttt{\string#1}}#2}%
\removeats{#1}%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{\textbackslash\strippedat}{}%
+ \declare{\texttt{\string#1}}#2%
+ }%
\index{\strippedat @\protect\myprintocmmand{\strippedat}}
- \pgfmanualpdflabel{\textbackslash\strippedat}{}%
+}
+
+\def\luaextractcommand#1#2\relax{%
+ \declare{\texttt{\string#1}}#2\par%
+% \removeats{#1}%
+ % \index{\strippedat @\protect\myprintocmmand{\strippedat}}
+ % \pgfmanualpdflabel{\textbackslash\strippedat}{}%
}
@@ -217,12 +395,14 @@
}
\def\extractenvironement#1#2\@@{%
- \pgfmanualentryheadline{{\ttfamily\char`\\begin\char`\{\declare{#1}\char`\}}#2}%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ {\ttfamily\char`\\begin\char`\{\declare{#1}\char`\}}#2%
+ }%
\pgfmanualentryheadline{{\ttfamily\ \ }\meta{environment contents}}%
\pgfmanualentryheadline{{\ttfamily\char`\\end\char`\{\declare{#1}\char`\}}}%
\index{#1@\protect\texttt{#1} environment}%
\index{Environments!#1@\protect\texttt{#1}}
- \pgfmanualpdflabel{#1}{}%
}
@@ -263,10 +443,26 @@
\newenvironment{shape}[1]{
\begin{pgfmanualentry}
- \pgfmanualentryheadline{Shape {\ttfamily\declare{#1}}}%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Shape} {\ttfamily\declare{#1}}%
+ }%
\index{#1@\protect\texttt{#1} shape}%
\index{Shapes!#1@\protect\texttt{#1}}
- \pgfmanualpdflabel{#1}{}%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{pictype}[2]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Pic type} {\ttfamily\declare{#1}#2}%
+ }%
+ \index{#1@\protect\texttt{#1} pic type}%
+ \index{Pic Types!#1@\protect\texttt{#1}}
\pgfmanualbody
}
{
@@ -275,10 +471,11 @@
\newenvironment{shading}[1]{
\begin{pgfmanualentry}
- \pgfmanualentryheadline{Shading {\ttfamily\declare{#1}}}%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Shading} {\ttfamily\declare{#1}}}%
\index{#1@\protect\texttt{#1} shading}%
\index{Shadings!#1@\protect\texttt{#1}}
- \pgfmanualpdflabel{#1}{}%
\pgfmanualbody
}
{
@@ -286,12 +483,58 @@
}
+\newenvironment{graph}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Graph} {\ttfamily\declare{#1}}}%
+ \index{#1@\protect\texttt{#1} graph}%
+ \index{Graphs!#1@\protect\texttt{#1}}
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{gdalgorithm}[2]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Layout} {\ttfamily/graph drawing/\declare{#1}\opt{=}}\opt{\meta{options}}}%
+ \index{#1@\protect\texttt{#1} layout}%
+ \index{Layouts!#1@\protect\texttt{#1}}%
+ \foreach \algo in {#2}
+ {\edef\marshal{\noexpand\index{#2@\noexpand\protect\noexpand\texttt{#2} algorithm}}\marshal}%
+ \index{Graph drawing layouts!#1@\protect\texttt{#1}}
+ \item{\small alias {\ttfamily/tikz/#1}}\par
+ \item{\small alias {\ttfamily/tikz/graphs/#1}}\par
+ \item{\small Employs {\ttfamily algorithm=#2}}\par
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
\newenvironment{dataformat}[1]{
\begin{pgfmanualentry}
- \pgfmanualentryheadline{Format {\ttfamily\declare{#1}}}%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Format} {\ttfamily\declare{#1}}}%
\index{#1@\protect\texttt{#1} format}%
\index{Formats!#1@\protect\texttt{#1}}
- \pgfmanualpdflabel{#1}{}%
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{stylesheet}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Style sheet} {\ttfamily\declare{#1}}}%
+ \index{#1@\protect\texttt{#1} style sheet}%
+ \index{Style sheets!#1@\protect\texttt{#1}}
\pgfmanualbody
}
{
@@ -309,10 +552,11 @@
\def\gobble#1{}
\def\extracthandler#1#2\@nil{%
- \pgfmanualentryheadline{Key handler \meta{key}{\ttfamily/\declare{#1}}#2}%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{/handlers/#1}{}%
+ \textbf{Key handler} \meta{key}{\ttfamily/\declare{#1}}#2}%
\index{\gobble#1@\protect\texttt{#1} handler}%
\index{Key handlers!#1@\protect\texttt{#1}}
- \pgfmanualpdflabel{/handlers/#1}%
}
@@ -336,17 +580,17 @@
% \mchoice{choice1,choice2,choice3}
\newcommand\mchoice[1]{%
- \begingroup
- \firstchoicetrue
- \foreach \mchoice@ in {#1} {%
- \iffirstchoice
- \global\firstchoicefalse
- \else
- \choicesep
- \fi
- \choicearg{\mchoice@}%
- }%
- \endgroup
+ \begingroup
+ \firstchoicetrue
+ \foreach \mchoice@ in {#1} {%
+ \iffirstchoice
+ \global\firstchoicefalse
+ \else
+ \choicesep
+ \fi
+ \choicearg{\mchoice@}%
+ }%
+ \endgroup
}%
% \begin{key}{/path/x=value}
@@ -369,39 +613,39 @@
% #1: the key
% #2: a default path (or empty)
\def\insertpathifneeded#1#2{%
- \def\insertpathifneeded@@{#2}%
- \ifx\insertpathifneeded@@\empty
- \def\mykey{#1}%
- \else
- \insertpathifneeded@#2\@nil
- \ifpgfutil@in@
- \def\mykey{#2/#1}%
- \else
- \def\mykey{#1}%
- \fi
- \fi
+ \def\insertpathifneeded@@{#2}%
+ \ifx\insertpathifneeded@@\empty
+ \def\mykey{#1}%
+ \else
+ \insertpathifneeded@#2\@nil
+ \ifpgfutil@in@
+ \def\mykey{#2/#1}%
+ \else
+ \def\mykey{#1}%
+ \fi
+ \fi
}%
\def\insertpathifneeded@#1#2\@nil{%
- \def\insertpathifneeded@@{#1}%
- \def\insertpathifneeded@@@{/}%
- \ifx\insertpathifneeded@@\insertpathifneeded@@@
- \pgfutil@in@true
- \else
- \pgfutil@in@false
- \fi
+ \def\insertpathifneeded@@{#1}%
+ \def\insertpathifneeded@@@{/}%
+ \ifx\insertpathifneeded@@\insertpathifneeded@@@
+ \pgfutil@in@true
+ \else
+ \pgfutil@in@false
+ \fi
}%
% \begin{keylist}[default path]
-% {/path/option 1=value,/path/option 2=value2}
+% {/path/option 1=value,/path/option 2=value2}
% \end{keylist}
\newenvironment{keylist}[2][]{%
- \begin{pgfmanualentry}
+ \begin{pgfmanualentry}
\def\extrakeytext{}%
- \foreach \xx in {#2} {%
- \expandafter\insertpathifneeded\expandafter{\xx}{#1}%
- \expandafter\extractkey\mykey\@nil%
- }%
- \pgfmanualbody
+ \foreach \xx in {#2} {%
+ \expandafter\insertpathifneeded\expandafter{\xx}{#1}%
+ \expandafter\extractkey\mykey\@nil%
+ }%
+ \pgfmanualbody
}{%
\end{pgfmanualentry}
}%
@@ -415,12 +659,14 @@
\ifpgfutil@in@%
\extractequalinitial#1\@nil%
\else
- \pgfmanualentryheadline{{\ttfamily\declare{#1}}\hfill(\extrakeytext no value)}%
+ \pgfmanualentryheadline{%
\def\mykey{#1}%
\def\mypath{}%
- \def\myname{}%
+ \gdef\myname{}%
\firsttimetrue%
+ \pgfmanualdecomposecount=0\relax%
\decompose#1/\nil%
+ {\ttfamily\declare{#1}}\hfill(\extrakeytext no value)}%
\fi
\fi%
}
@@ -434,31 +680,49 @@
\ifpgfutil@in@%
\extractinitial{#1}#2\@nil%
\else
- \pgfmanualentryheadline{{\ttfamily\declare{#1}=}#2\hfill(\extrakeytext no default)}%
+ \pgfmanualentryheadline{%
+ \def\mykey{#1}%
+ \def\mypath{}%
+ \gdef\myname{}%
+ \firsttimetrue%
+ \pgfmanualdecomposecount=0\relax%
+ \decompose#1/\nil%
+ {\ttfamily\declare{#1}=}#2\hfill(\extrakeytext no default)}%
\fi%
\fi%
- \def\mykey{#1}%
- \def\mypath{}%
- \def\myname{}%
- \firsttimetrue%
- \decompose#1/\nil%
}
\def\extractdefault#1#2(default #3)\@nil{%
- \pgfmanualentryheadline{{\ttfamily\declare{#1}\opt{=}}\opt{#2}\hfill (\extrakeytext default {\ttfamily#3})}%
+ \pgfmanualentryheadline{%
+ \def\mykey{#1}%
+ \def\mypath{}%
+ \gdef\myname{}%
+ \firsttimetrue%
+ \pgfmanualdecomposecount=0\relax%
+ \decompose#1/\nil%
+ {\ttfamily\declare{#1}\opt{=}}\opt{#2}\hfill (\extrakeytext default {\ttfamily#3})}%
}
\def\extractinitial#1#2(initially #3)\@nil{%
- \pgfmanualentryheadline{{\ttfamily\declare{#1}=}#2\hfill (\extrakeytext no default, initially {\ttfamily#3})}%
+ \pgfmanualentryheadline{%
+ \def\mykey{#1}%
+ \def\mypath{}%
+ \gdef\myname{}%
+ \firsttimetrue%
+ \pgfmanualdecomposecount=0\relax%
+ \decompose#1/\nil%
+ {\ttfamily\declare{#1}=}#2\hfill (\extrakeytext no default, initially {\ttfamily#3})}%
}
\def\extractequalinitial#1 (initially #2)\@nil{%
- \pgfmanualentryheadline{{\ttfamily\declare{#1}}\hfill (\extrakeytext initially {\ttfamily#2})}%
- \def\mykey{#1}%
- \def\mypath{}%
- \def\myname{}%
- \firsttimetrue%
- \decompose#1/\nil%
+ \pgfmanualentryheadline{%
+ \def\mykey{#1}%
+ \def\mypath{}%
+ \gdef\myname{}%
+ \firsttimetrue%
+ \pgfmanualdecomposecount=0\relax%
+ \decompose#1/\nil%
+ {\ttfamily\declare{#1}}\hfill (\extrakeytext initially {\ttfamily#2})}%
}
% Introduces a key alias '/#1/<name of current key>'
@@ -468,6 +732,7 @@
}
\newif\iffirsttime
+\newcount\pgfmanualdecomposecount
\makeatother
@@ -477,26 +742,48 @@
% aha.
\index{#1@\protect\texttt{#1} key}%
\index{\mypath#1@\protect\texttt{#1}}%
- \def\myname{#1}%
+ \gdef\myname{#1}%
+ \pgfmanualpdflabel{#1}{}
\else%
- \iffirsttime
- \begingroup
- % also make a pdf link anchor with full key path.
- \def\hyperlabelwithoutslash##1/\nil{%
- \pgfmanualpdflabel{##1}{}%
- }%
- \hyperlabelwithoutslash/#1/#2\nil
- \endgroup
- \def\mypath{#1@\protect\texttt{/#1/}!}%
- \firsttimefalse
- \else
- \expandafter\def\expandafter\mypath\expandafter{\mypath#1@\protect\texttt{#1/}!}%
- \fi
- \def\firsttime{}
- \decompose/#2\nil%
+ \advance\pgfmanualdecomposecount by1\relax%
+ \ifnum\pgfmanualdecomposecount>2\relax%
+ \decomposetoodeep#1/#2\nil%
+ \else%
+ \iffirsttime%
+ \begingroup%
+ % also make a pdf link anchor with full key path.
+ \def\hyperlabelwithoutslash##1/\nil{%
+ \pgfmanualpdflabel{##1}{}%
+ }%
+ \hyperlabelwithoutslash/#1/#2\nil%
+ \endgroup%
+ \def\mypath{#1@\protect\texttt{/#1/}!}%
+ \firsttimefalse%
+ \else%
+ \expandafter\def\expandafter\mypath\expandafter{\mypath#1@\protect\texttt{#1/}!}%
+ \fi%
+ \def\firsttime{}%
+ \decompose/#2\nil%
+ \fi%
\fi%
}
+\def\decomposetoodeep#1/#2/\nil{%
+ % avoid too-deep nesting in index
+ \index{#1/#2@\protect\texttt{#1/#2} key}%
+ \index{\mypath#1/#2@\protect\texttt{#1/#2}}%
+ \decomposefindlast/#1/#2/\nil%
+}
+\makeatletter
+\def\decomposefindlast/#1/#2\nil{%
+ \def\test{#2}%
+ \ifx\test\pgfutil@empty%
+ \gdef\myname{#1}%
+ \else%
+ \decomposefindlast/#2\nil%
+ \fi%
+}
+\makeatother
\def\indexkey#1{%
\def\mypath{}%
\decompose#1/\nil%
@@ -511,21 +798,23 @@
\end{pgfmanualentry}
}
\def\extractpredefinedmethod#1(#2)\@nil{%
- \pgfmanualentryheadline{Method \declare{\ttfamily #1}\texttt(#2\texttt) \hfill(predefined for all classes)}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ Method \declare{\ttfamily #1}\texttt(#2\texttt) \hfill(predefined for all classes)}
\index{#1@\protect\texttt{#1} method}%
\index{Methods!#1@\protect\texttt{#1}}
- \pgfmanualpdflabel{#1}{}%
}
\newenvironment{ooclass}[1]{
\begin{pgfmanualentry}
\def\currentclass{#1}
- \pgfmanualentryheadline{Class \declare{\texttt{#1}}}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Class} \declare{\texttt{#1}}}
\index{#1@\protect\texttt{#1} class}%
\index{Class #1@Class \protect\texttt{#1}}%
\index{Classes!#1@\protect\texttt{#1}}
- \pgfmanualpdflabel{#1}{}%
\pgfmanualbody
}
{
@@ -543,14 +832,17 @@
\def\extractmethod#1(#2)\@nil{%
\def\test{#1}
\ifx\test\currentclass
- \pgfmanualentryheadline{Constructor \declare{\ttfamily #1}\texttt(#2\texttt)}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ Constructor \declare{\ttfamily #1}\texttt(#2\texttt)}
\else
- \pgfmanualentryheadline{Method \declare{\ttfamily #1}\texttt(#2\texttt)}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ Method \declare{\ttfamily #1}\texttt(#2\texttt)}
\fi
\index{#1@\protect\texttt{#1} method}%
\index{Methods!#1@\protect\texttt{#1}}
\index{Class \currentclass!#1@\protect\texttt{#1}}%
- \pgfmanualpdflabel{#1}{}%
}
\newenvironment{attribute}[1]{
@@ -564,24 +856,28 @@
\def\extractattribute#1=#2;\@nil{%
\def\test{#2}%
\ifx\test\@empty
- \pgfmanualentryheadline{Private attribute \declare{\ttfamily #1} \hfill (initially empty)}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ Private attribute \declare{\ttfamily #1} \hfill (initially empty)}
\else
- \pgfmanualentryheadline{Private attribute \declare{\ttfamily #1} \hfill (initially {\ttfamily #2})}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ Private attribute \declare{\ttfamily #1} \hfill (initially {\ttfamily #2})}
\fi
\index{#1@\protect\texttt{#1} attribute}%
\index{Attributes!#1@\protect\texttt{#1}}
\index{Class \currentclass!#1@\protect\texttt{#1}}%
- \pgfmanualpdflabel{#1}{}%
}
\newenvironment{predefinednode}[1]{
\begin{pgfmanualentry}
- \pgfmanualentryheadline{Predefined node {\ttfamily\declare{#1}}}%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Predefined node} {\ttfamily\declare{#1}}}%
\index{#1@\protect\texttt{#1} node}%
\index{Predefined node!#1@\protect\texttt{#1}}
- \pgfmanualpdflabel{#1}{}%
\pgfmanualbody
}
{
@@ -590,10 +886,11 @@
\newenvironment{coordinatesystem}[1]{
\begin{pgfmanualentry}
- \pgfmanualentryheadline{Coordinate system {\ttfamily\declare{#1}}}%
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{Coordinate system} {\ttfamily\declare{#1}}}%
\index{#1@\protect\texttt{#1} coordinate system}%
\index{Coordinate systems!#1@\protect\texttt{#1}}
- \pgfmanualpdflabel{#1}{}%
\pgfmanualbody
}
{
@@ -602,7 +899,7 @@
\newenvironment{snake}[1]{
\begin{pgfmanualentry}
- \pgfmanualentryheadline{Snake {\ttfamily\declare{#1}}}%
+ \pgfmanualentryheadline{\textbf{Snake} {\ttfamily\declare{#1}}}%
\index{#1@\protect\texttt{#1} snake}%
\index{Snakes!#1@\protect\texttt{#1}}
\pgfmanualbody
@@ -613,7 +910,7 @@
\newenvironment{decoration}[1]{
\begin{pgfmanualentry}
- \pgfmanualentryheadline{Decoration {\ttfamily\declare{#1}}}%
+ \pgfmanualentryheadline{\textbf{Decoration} {\ttfamily\declare{#1}}}%
\index{#1@\protect\texttt{#1} decoration}%
\index{Decorations!#1@\protect\texttt{#1}}
\pgfmanualbody
@@ -627,14 +924,17 @@
\makeatletter
\newenvironment{pathoperation}[3][]{
\begin{pgfmanualentry}
- \pgfmanualentryheadline{\textcolor{gray}{{\ttfamily\char`\\path}\
+ \def\pgfmanualtest{#1}%
+ \pgfmanualentryheadline{%
+ \ifx\pgfmanualtest\@empty%
+ \pgfmanualpdflabel{#2}{}%
+ \fi%
+ \textcolor{gray}{{\ttfamily\char`\\path}\
\ \dots}
\declare{\texttt{#2}}#3\ \textcolor{gray}{\dots\texttt{;}}}%
- \def\pgfmanualtest{#1}%
\ifx\pgfmanualtest\@empty%
\index{#2@\protect\texttt{#2} path operation}%
\index{Path operations!#2@\protect\texttt{#2}}%
- \pgfmanualpdflabel{#2}{}%
\fi%
\pgfmanualbody
}
@@ -643,14 +943,17 @@
}
\newenvironment{datavisualizationoperation}[3][]{
\begin{pgfmanualentry}
- \pgfmanualentryheadline{\textcolor{gray}{{\ttfamily\char`\\datavisualization}\
+ \def\pgfmanualtest{#1}%
+ \pgfmanualentryheadline{%
+ \ifx\pgfmanualtest\@empty%
+ \pgfmanualpdflabel{#2}{}%
+ \fi%
+ \textcolor{gray}{{\ttfamily\char`\\datavisualization}\
\ \dots}
\declare{\texttt{#2}}#3\ \textcolor{gray}{\dots\texttt{;}}}%
- \def\pgfmanualtest{#1}%
\ifx\pgfmanualtest\@empty%
\index{#2@\protect\texttt{#2} (data visualization)}%
\index{Data visualization!#2@\protect\texttt{#2}}%
- \pgfmanualpdflabel{#2}{}%
\fi%
\pgfmanualbody
}
@@ -659,19 +962,14 @@
}
\makeatother
-\def\extractcommand#1#2\@@{%
- \pgfmanualentryheadline{\declare{\texttt{\string#1}}#2}%
- \removeats{#1}%
- \index{\strippedat @\protect\myprintocmmand{\strippedat}}
- \pgfmanualpdflabel{\textbackslash\strippedat}{}%
-}
-
\def\doublebs{\texttt{\char`\\\char`\\}}
\newenvironment{package}[1]{
\begin{pgfmanualentry}
- \pgfmanualentryheadline{{\ttfamily\char`\\usepackage\char`\{\declare{#1}\char`\}\space\space \char`\%\space\space \LaTeX}}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ {\ttfamily\char`\\usepackage\char`\{\declare{#1}\char`\}\space\space \char`\%\space\space \LaTeX}}
\index{#1@\protect\texttt{#1} package}%
\index{Packages and files!#1@\protect\texttt{#1}}%
\pgfmanualentryheadline{{\ttfamily\char`\\input \declare{#1}.tex\space\space\space \char`\%\space\space plain \TeX}}
@@ -685,13 +983,14 @@
\newenvironment{pgfmodule}[1]{
\begin{pgfmanualentry}
- \pgfmanualentryheadline{{\ttfamily\char`\\usepgfmodule\char`\{\declare{#1}\char`\}\space\space\space
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ {\ttfamily\char`\\usepgfmodule\char`\{\declare{#1}\char`\}\space\space\space
\char`\%\space\space \LaTeX\space and plain \TeX\space and pure pgf}}
\index{#1@\protect\texttt{#1} module}%
\index{Modules!#1@\protect\texttt{#1}}%
\pgfmanualentryheadline{{\ttfamily\char`\\usepgfmodule[\declare{#1}]\space\space \char`\%\space\space Con\TeX t\space and pure pgf}}
\pgfmanualbody
- \pgfmanualpdflabel{#1}{}%
}
{
\end{pgfmanualentry}
@@ -699,17 +998,37 @@
\newenvironment{pgflibrary}[1]{
\begin{pgfmanualentry}
- \pgfmanualentryheadline{{\ttfamily\char`\\usepgflibrary\char`\{\declare{#1}\char`\}\space\space\space
- \char`\%\space\space \LaTeX\space and plain \TeX\space and pure pgf}}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{\tikzname\ Library} \texttt{\declare{#1}}}
\index{#1@\protect\texttt{#1} library}%
\index{Libraries!#1@\protect\texttt{#1}}%
- \pgfmanualentryheadline{{\ttfamily\char`\\usepgflibrary[\declare{#1}]\space\space \char`\%\space\space Con\TeX t\space and pure pgf}}
- \pgfmanualentryheadline{{\ttfamily\char`\\usetikzlibrary\char`\{\declare{#1}\char`\}\space\space
- \char`\%\space\space \LaTeX\space and plain \TeX\space when using \tikzname}}
- \pgfmanualentryheadline{{\ttfamily\char`\\usetikzlibrary[\declare{#1}]\space
- \char`\%\space\space Con\TeX t\space when using \tikzname}}
+ \vskip.25em%
+ {{\ttfamily\char`\\usepgflibrary\char`\{\declare{#1}\char`\}\space\space\space
+ \char`\%\space\space \LaTeX\space and plain \TeX\space and pure pgf}}\\
+ {{\ttfamily\char`\\usepgflibrary[\declare{#1}]\space\space \char`\%\space\space Con\TeX t\space and pure pgf}}\\
+ {{\ttfamily\char`\\usetikzlibrary\char`\{\declare{#1}\char`\}\space\space
+ \char`\%\space\space \LaTeX\space and plain \TeX\space when using \tikzname}}\\
+ {{\ttfamily\char`\\usetikzlibrary[\declare{#1}]\space
+ \char`\%\space\space Con\TeX t\space when using \tikzname}}\\[.5em]
+ \pgfmanualbody
+}
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{purepgflibrary}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{{\small PGF} Library} \texttt{\declare{#1}}}
+ \index{#1@\protect\texttt{#1} library}%
+ \index{Libraries!#1@\protect\texttt{#1}}%
+ \vskip.25em%
+ {{\ttfamily\char`\\usepgflibrary\char`\{\declare{#1}\char`\}\space\space\space
+ \char`\%\space\space \LaTeX\space and plain \TeX}}\\
+ {{\ttfamily\char`\\usepgflibrary[\declare{#1}]\space\space \char`\%\space\space Con\TeX t}}\\[.5em]
\pgfmanualbody
- \pgfmanualpdflabel{#1}{}%
}
{
\end{pgfmanualentry}
@@ -717,12 +1036,15 @@
\newenvironment{tikzlibrary}[1]{
\begin{pgfmanualentry}
- \pgfmanualentryheadline{{\ttfamily\char`\\usetikzlibrary\char`\{\declare{#1}\char`\}\space\space \char`\%\space\space \LaTeX\space and plain \TeX}}
+ \pgfmanualentryheadline{%
+ \pgfmanualpdflabel{#1}{}%
+ \textbf{\tikzname\ Library} \texttt{\declare{#1}}}
\index{#1@\protect\texttt{#1} library}%
\index{Libraries!#1@\protect\texttt{#1}}%
- \pgfmanualentryheadline{{\ttfamily\char`\\usetikzlibrary[\declare{#1}]\space \char`\%\space\space Con\TeX t}}
+ \vskip.25em%
+ {{\ttfamily\char`\\usetikzlibrary\char`\{\declare{#1}\char`\}\space\space \char`\%\space\space \LaTeX\space and plain \TeX}}\\
+ {{\ttfamily\char`\\usetikzlibrary[\declare{#1}]\space \char`\%\space\space Con\TeX t}}\\[.5em]
\pgfmanualbody
- \pgfmanualpdflabel{#1}{}%
}
{
\end{pgfmanualentry}
@@ -858,89 +1180,225 @@
\def\noindexing{\let\index=\@gobble}
+\newenvironment{arrowtipsimple}[1]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{\textbf{Arrow Tip Kind} {\ttfamily#1}}
+ \index{#1@\protect\texttt{#1} arrow tip}%
+ \index{Arrow tips!#1@\protect\texttt{#1}}%
+ \def\currentarrowtype{#1}
+ \pgfmanualbody}
+{
+ \end{pgfmanualentry}
+}
-\newcommand\symarrow[1]{
+\newenvironment{arrowtip}[4]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{\textbf{Arrow Tip Kind} {\ttfamily#1}}
+ \index{#1@\protect\texttt{#1} arrow tip}%
+ \index{Arrow tips!#1@\protect\texttt{#1}}%
+ \pgfmanualbody
+ \def\currentarrowtype{#1}
+ \begin{minipage}[t]{10.25cm}
+ #2
+ \end{minipage}\hskip5mm\begin{minipage}[t]{4.75cm}
+ \leavevmode\vskip-2em
+ \tikz{
+ \draw [black!50,line width=5mm,-{#1[#3,color=black]}] (-4,0) -- (0,0);
+ \foreach \action in {#4}
+ { \expandafter\processaction\action\relax }
+ }
+ \end{minipage}\par\smallskip
+ }
+{
+ \end{pgfmanualentry}
+}
+
+\newenvironment{arrowcap}[5]{
+ \begin{pgfmanualentry}
+ \pgfmanualentryheadline{\textbf{Arrow Tip Kind} {\ttfamily#1}}
+ \index{#1@\protect\texttt{#1} arrow tip}%
+ \index{Arrow tips!#1@\protect\texttt{#1}}%
+ \pgfmanualbody
+ \def\currentarrowtype{#1}
+ \begin{minipage}[t]{10.25cm}
+ #2
+ \end{minipage}\hskip5mm\begin{minipage}[t]{4.75cm}
+ \leavevmode\vskip-2em
+ \tikz{
+ \path [tips, line width=10mm,-{#1[#3,color=black]}] (-4,0) -- (0,0);
+ \draw [line width=10mm,black!50] (-3,0) -- (#5,0);
+ \foreach \action in {#4}
+ { \expandafter\processaction\action\relax }
+ }
+ \end{minipage}\par\smallskip
+ }
+{
+ \end{pgfmanualentry}
+}
+
+\def\processaction#1=#2\relax{
+ \expandafter\let\expandafter\pgf@temp\csname manual@action@#1\endcsname
+ \ifx\pgf@temp\relax\else
+ \pgf@temp#2/0/\relax
+ \fi
+}
+\def\manual@action@length#1/#2/#3\relax{%
+ \draw [red,|<->|,semithick,xshift=#2] ([yshift=4pt]current bounding
+ box.north -| -#1,0) coordinate (last length) -- node
+ [above=-2pt] {|length|} ++(#1,0);
+}
+\def\manual@action@width#1/#2/#3\relax{%
+ \draw [overlay, red,|<->|,semithick] (.5,-#1/2) -- node [below,sloped] {|width|} (.5,#1/2);
+}
+\def\manual@action@inset#1/#2/#3\relax{%
+ \draw [red,|<->|,semithick,xshift=#2] ([yshift=-4pt]current bounding
+ box.south -| last length) -- node [below] {|inset|} ++(#1,0);
+}
+
+\newenvironment{arrowexamples}
+{\begin{tabbing}
+ \hbox to \dimexpr\linewidth-5.5cm\relax{\emph{Appearance of the below at line width} \hfil} \=
+ \hbox to 1.9cm{\emph{0.4pt}\hfil} \= \hbox to 2cm{\emph{0.8pt}\hfil} \= \emph{1.6pt} \\
+ }
+{\end{tabbing}\vskip-1em}
+
+\newenvironment{arrowcapexamples}
+{\begin{tabbing}
+ \hbox to \dimexpr\linewidth-5.5cm\relax{\emph{Appearance of the below at line width} \hfil} \=
+ \hbox to 1.9cm{\emph{1ex}\hfil} \= \hbox to 2cm{\emph{1em}\hfil} \\
+ }
+{\end{tabbing}\vskip-1em}
+
+\def\arrowcapexample#1[#2]{\def\temp{#1}\ifx\temp\pgfutil@empty\arrowcapexample@\currentarrowtype[{#2}]\else\arrowcapexample@#1[{#2}]\fi}
+\def\arrowcapexample@#1[#2]{%
+ {\sfcode`\.1000\small\texttt{#1[#2]}} \>
+ \kern-.5ex\tikz [baseline,>={#1[#2]}] \draw [line
+ width=1ex,->] (0,.5ex) -- (2em,.5ex); \>
+ \kern-.5em\tikz [baseline,>={#1[#2]}] \draw [line
+ width=1em,->] (0,.5ex) -- (2em,.5ex); \\
+}
+
+\def\arrowexample#1[#2]{\def\temp{#1}\ifx\temp\pgfutil@empty\arrowexample@\currentarrowtype[{#2}]\else\arrowexample@#1[{#2}]\fi}
+\def\arrowexample@#1[#2]{%
+ {\sfcode`\.1000\small\texttt{#1[#2]}} \>
+ \tikz [baseline,>={#1[#2]}] \draw [line
+ width=0.4pt,->] (0,.5ex) -- (2em,.5ex); thin \>
+ \tikz [baseline,>={#1[#2]}] \draw [line
+ width=0.8pt,->] (0,.5ex) -- (2em,.5ex); \textbf{thick} \>
+ \tikz [baseline,>={#1[#2]}] \draw [line
+ width=1.6pt,->] (0,.5ex) -- (3em,.5ex); \\
+}
+\def\arrowexampledup[#1]{\arrowexample[{#1] \currentarrowtype[}]}
+\def\arrowexampledupdot[#1]{\arrowexample[{#1] . \currentarrowtype[}]}
+
+\def\arrowexampledouble#1[#2]{\def\temp{#1}\ifx\temp\pgfutil@empty\arrowexampledouble@\currentarrowtype[{#2}]\else\arrowexampledouble@#1[{#2}]\fi}
+\def\arrowexampledouble@#1[#2]{%
+ {\sfcode`\.1000\small\texttt{#1[#2]} on double line} \>
+ \tikz [baseline,>={#1[#2]}]
+ \draw [double equal sign distance,line width=0.4pt,->] (0,.5ex) -- (2em,.5ex); thin \>
+ \tikz [baseline,>={#1[#2]}]
+ \draw [double equal sign distance,line width=0.8pt,->] (0,.5ex) -- (2em,.5ex); \textbf{thick} \>
+ \tikz [baseline,>={#1[#2]}]
+ \draw [double equal sign distance, line width=1.6pt,->] (0,.5ex) -- (3em,.5ex); \\
+}
+
+
+
+\newcommand\symarrow[1]{%
\index{#1@\protect\texttt{#1} arrow tip}%
- \index{Arrow tips!#1@\protect\texttt{#1}}
+ \index{Arrow tips!#1@\protect\texttt{#1}}%
\texttt{#1}& yields thick
\begin{tikzpicture}[arrows={#1-#1},thick,baseline]
- \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
\draw (0pt,.5ex) -- (1cm,.5ex);
\end{tikzpicture} and thin
\begin{tikzpicture}[arrows={#1-#1},thin,baseline]
- \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
\draw (0pt,.5ex) -- (1cm,.5ex);
\end{tikzpicture}
}
-\newcommand\symarrowdouble[1]{
+\newcommand\symarrowdouble[1]{%
\index{#1@\protect\texttt{#1} arrow tip}%
- \index{Arrow tips!#1@\protect\texttt{#1}}
+ \index{Arrow tips!#1@\protect\texttt{#1}}%
\texttt{#1}& yields thick
\begin{tikzpicture}[arrows={#1-#1},thick,baseline]
- \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
\draw (0pt,.5ex) -- (1cm,.5ex);
\end{tikzpicture}
and thin
\begin{tikzpicture}[arrows={#1-#1},thin,baseline]
- \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
\draw (0pt,.5ex) -- (1cm,.5ex);
\end{tikzpicture}, double
\begin{tikzpicture}[arrows={#1-#1},thick,baseline]
- \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
\draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex);
\end{tikzpicture} and
\begin{tikzpicture}[arrows={#1-#1},thin,baseline]
- \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
\draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex);
\end{tikzpicture}
}
-\newcommand\sarrow[2]{
+\newcommand\sarrow[2]{%
\index{#1@\protect\texttt{#1} arrow tip}%
- \index{Arrow tips!#1@\protect\texttt{#1}}
+ \index{Arrow tips!#1@\protect\texttt{#1}}%
\index{#2@\protect\texttt{#2} arrow tip}%
- \index{Arrow tips!#2@\protect\texttt{#2}}
+ \index{Arrow tips!#2@\protect\texttt{#2}}%
\texttt{#1-#2}& yields thick
\begin{tikzpicture}[arrows={#1-#2},thick,baseline]
- \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
\draw (0pt,.5ex) -- (1cm,.5ex);
\end{tikzpicture} and thin
\begin{tikzpicture}[arrows={#1-#2},thin,baseline]
- \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
\draw (0pt,.5ex) -- (1cm,.5ex);
\end{tikzpicture}
}
-\newcommand\sarrowdouble[2]{
+\newcommand\sarrowdouble[2]{%
\index{#1@\protect\texttt{#1} arrow tip}%
- \index{Arrow tips!#1@\protect\texttt{#1}}
+ \index{Arrow tips!#1@\protect\texttt{#1}}%
\index{#2@\protect\texttt{#2} arrow tip}%
- \index{Arrow tips!#2@\protect\texttt{#2}}
+ \index{Arrow tips!#2@\protect\texttt{#2}}%
\texttt{#1-#2}& yields thick
\begin{tikzpicture}[arrows={#1-#2},thick,baseline]
- \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
\draw (0pt,.5ex) -- (1cm,.5ex);
\end{tikzpicture} and thin
\begin{tikzpicture}[arrows={#1-#2},thin,baseline]
- \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
\draw (0pt,.5ex) -- (1cm,.5ex);
\end{tikzpicture}, double
\begin{tikzpicture}[arrows={#1-#2},thick,baseline]
- \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
\draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex);
\end{tikzpicture} and
\begin{tikzpicture}[arrows={#1-#2},thin,baseline]
- \useasboundingbox (0pt,-0.5ex) rectangle (1cm,2ex);
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.1cm,2ex);
+ \fill [black!15] (1cm,-.5ex) rectangle (1.1cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
\draw[double,double equal sign distance] (0pt,.5ex) -- (1cm,.5ex);
\end{tikzpicture}
}
-\newcommand\carrow[1]{
+\newcommand\carrow[1]{%
\index{#1@\protect\texttt{#1} arrow tip}%
- \index{Arrow tips!#1@\protect\texttt{#1}}
+ \index{Arrow tips!#1@\protect\texttt{#1}}%
\texttt{#1}& yields for line width 1ex
\begin{tikzpicture}[arrows={#1-#1},line width=1ex,baseline]
- \useasboundingbox (0pt,-0.5ex) rectangle (1.5cm,2ex);
+ \useasboundingbox (-1mm,-0.5ex) rectangle (1.6cm,2ex);
+ \fill [black!15] (1.5cm,-.5ex) rectangle (1.6cm,1.5ex) (-1mm,-.5ex) rectangle (0mm,1.5ex) ;
\draw (0pt,.5ex) -- (1.5cm,.5ex);
\end{tikzpicture}
}
@@ -1046,32 +1504,62 @@
% a proper replacement sequence for tabs (as many spaces as
% configured)
\def\codeexample@tabinit{%
- \ifnum\pgfkeysvalueof{/codeexample/tabsize}=0\relax
- \let\codeexample@tabinit@replacementchars=\relax
- \let\codeexample@tabinit@catcode=\relax
- \else
- \let\codeexample@tabinit@catcode=\codeexample@tabinit@catcode@
- \let\codeexample@tabinit@replacementchars=\codeexample@tabinit@replacementchars@
- \fi
+ \ifnum\pgfkeysvalueof{/codeexample/tabsize}=0\relax
+ \let\codeexample@tabinit@replacementchars=\relax
+ \let\codeexample@tabinit@catcode=\relax
+ \else
+ \let\codeexample@tabinit@catcode=\codeexample@tabinit@catcode@
+ \let\codeexample@tabinit@replacementchars=\codeexample@tabinit@replacementchars@
+ \fi
}
+\newif\ifpgfmanualtikzsyntaxhilighting
+
\pgfqkeys{/codeexample}{%
- width/.code= {\setlength\codeexamplewidth{#1}},
- graphic/.code= {\colorlet{graphicbackground}{#1}},
- code/.code= {\colorlet{codebackground}{#1}},
- execute code/.is if=code@execute,
- code only/.code= {\code@executefalse},
- pre/.store in=\code@pre,
- post/.store in=\code@post,
+ width/.code= {\setlength\codeexamplewidth{#1}},
+ graphic/.code= {\colorlet{graphicbackground}{#1}},
+ code/.code= {\colorlet{codebackground}{#1}},
+ execute code/.is if=code@execute,
+ code only/.code= {\code@executefalse},
+ pre/.store in=\code@pre,
+ post/.store in=\code@post,
% #1 is the *complete* environment contents as it shall be
% typeset. In particular, the catcodes are NOT the normal ones.
- typeset listing/.code= {#1},
- render instead/.store in=\code@render,
- vbox/.code= {\def\code@pre{\vbox\bgroup\setlength{\hsize}{\linewidth-6pt}}\def\code@post{\egroup}},
- ignorespaces/.code= {\let\@gobble@till@return=\@gobble@till@return@ignore},
- leave comments/.code= {\def\code@catcode@hook{\catcode`\%=12}\let\commenthandler=\relax\let\typesetcomment=\relax},
- tabsize/.initial=0,% FIXME : this here is merely used for indentation. It is just a TAB REPLACEMENT.
- every codeexample/.style={width=4cm+7pt},
+ typeset listing/.code= {#1},
+ render instead/.store in=\code@render,
+ vbox/.code= {\def\code@pre{\vbox\bgroup\setlength{\hsize}{\linewidth-6pt}}\def\code@post{\egroup}},
+ ignorespaces/.code= {\let\@gobble@till@return=\@gobble@till@return@ignore},
+ leave comments/.code= {\def\code@catcode@hook{\catcode`\%=12}\let\commenthandler=\relax\let\typesetcomment=\relax},
+ tabsize/.initial=0,% FIXME : this here is merely used for indentation. It is just a TAB REPLACEMENT.
+ every codeexample/.style={width=4cm+7pt, tikz syntax=true},
+ from file/.code={\codeexamplefromfiletrue\def\codeexamplesource{#1}},
+ tikz syntax/.is if=pgfmanualtikzsyntaxhilighting,
+}
+
+
+\newread\examplesource
+
+
+% Opening, reading and closing the results file
+
+\def\opensource#1{
+ \immediate\openin\examplesource=#1
+}
+\def\do@codeexamplefromfile{%
+ \immediate\openin\examplesource\expandafter{\codeexamplesource}%
+ \def\examplelines{}%
+ \readexamplelines
+ \closein\examplesource
+ \expandafter\endofcodeexample\expandafter{\examplelines}%
+}
+
+\def\readexamplelines{
+ \ifeof\examplesource%
+ \else
+ \immediate\read\examplesource to \exampleline
+ \expandafter\expandafter\expandafter\def\expandafter\expandafter\expandafter\examplelines\expandafter\expandafter\expandafter{\expandafter\examplelines\exampleline}
+ \expandafter\readexamplelines%
+ \fi
}
\let\code@pre\pgfutil@empty
@@ -1079,6 +1567,7 @@
\let\code@render\pgfutil@empty
\def\code@catcode@hook{}
+\newif\ifcodeexamplefromfile
\newdimen\codeexamplewidth
\newif\ifcode@execute
\newbox\codeexamplebox
@@ -1086,6 +1575,10 @@
\begingroup%
\code@executetrue
\pgfqkeys{/codeexample}{every codeexample,#1}%
+ \ifpgfmanualtikzsyntaxhilighting%
+ \pgfkeys{/codeexample/syntax hilighting}%
+ \fi%
+ \ifcodeexamplefromfile\begingroup\fi
\codeexample@tabinit% assigns \codeexample@tabinit@[catcode,replacementchars]
\parindent0pt
\begingroup%
@@ -1100,7 +1593,11 @@
\code@catcode@hook%
\codeexample@tabinit@catcode
\relax%
- \find@example}
+ \ifcodeexamplefromfile%
+ \expandafter\do@codeexamplefromfile%
+ \else%
+ \expandafter\find@example%
+ \fi}
\def\endofcodeexample#1{%
\endgroup%
\ifcode@execute%
@@ -1155,6 +1652,7 @@
\fi%
\code@mid%
\colorbox{codebackground}{%
+ \pgfkeysvalueof{/codeexample/prettyprint/base color}%
\begin{minipage}[t]{\code@width}%
{%
\let\do\@makeother
@@ -1179,7 +1677,7 @@
\code@end%
\par%
\medskip
- \end{codeexample}
+ \endcodeexample\endgroup
}
\def\endcodeexample{\endgroup}
@@ -1189,16 +1687,52 @@
\usepackage{pgfmanual}
-\makeatletter
-% \pgfautoxrefs will be defined by 'make dist'
-\pgfutil@ifundefined{pgfautoxrefs}{%
- \def\pgfmanualpdflabel#1#2{#2}% NO-OP
- \def\pgfmanualpdfref#1#2{#2}%
- \pgfkeys{
- /pdflinks/codeexample links=false,% DISABLED.
- }%
-}{}
-\makeatother
+
+% autoxref is now always on
+
+% \makeatletter
+% % \pgfautoxrefs will be defined by 'make dist'
+% \pgfutil@ifundefined{pgfautoxrefs}{%
+% \renewcommand\pgfmanualpdflabel[3][]{#3}% NO-OP
+% \def\pgfmanualpdfref#1#2{#2}%
+% \pgfkeys{
+% /pdflinks/codeexample links=false,% DISABLED.
+% }%
+% }{}
+% \makeatother
+
+\newdimen\pgfmanualcslinkpreskip
+
+% Styling of the pretty printer
+\pgfkeys{
+ /codeexample/syntax hilighting/.style={
+ /codeexample/prettyprint/key name/.code={\textcolor{green!50!black}{\pgfmanualpdfref{##1}{##1}}},
+ /codeexample/prettyprint/key name with handler/.code 2 args={\textcolor{green!50!black}{\pgfmanualpdfref{##1}{##1}}/\textcolor{blue!70!black}{\pgfmanualpdfref{/handlers/##2}{##2}}},
+ /codeexample/prettyprint/key value display only/.code={\textcolor{green!50!black}{{\itshape{\let\pgfmanualwordstartup\relax\pgfmanualprettyprintcode{##1}}}}},
+ /codeexample/prettyprint/cs/.code={\textcolor{blue!70!black}{\pgfmanualcslinkpreskip4.25pt\pgfmanualpdfref{##1}{##1}}},
+ /codeexample/prettyprint/cs with args/.code 2 args={\textcolor{black}{\pgfmanualcslinkpreskip4.25pt\pgfmanualpdfref{##1}{##1}}\{\textcolor{black}{\pgfmanualprettyprintcode{##2}}\pgfmanualclosebrace},
+ /codeexample/prettyprint/cs arguments/pgfkeys/.initial=1,
+ /codeexample/prettyprint/cs/pgfkeys/.code 2 args={\textcolor{black}{\pgfmanualcslinkpreskip4.25pt\pgfmanualpdfref{##1}{##1}}\{\textcolor{black}{\pgfmanualprettyprintpgfkeys{##2}}\pgfmanualclosebrace},
+ /codeexample/prettyprint/cs arguments/begin/.initial=1,
+ /codeexample/prettyprint/cs/begin/.code 2 args={\textcolor{black}{##1}\{\textcolor{blue!70!black}{\pgfmanualpdfref{##2}{##2}}\pgfmanualclosebrace},
+ /codeexample/prettyprint/cs arguments/end/.initial=1,
+ /codeexample/prettyprint/cs/end/.code 2 args={\textcolor{black}{##1}\{\textcolor{blue!70!black}{\pgfmanualpdfref{##2}{##2}}\pgfmanualclosebrace},
+ /codeexample/prettyprint/word/.code={\pgfmanualwordstartup{\begingroup\pgfkeyssetvalue{/pdflinks/search key prefixes in}{}\pgfmanualpdfref{##1}{##1}\endgroup}},
+ /codeexample/prettyprint/point/.code={\textcolor{violet}{##1}},%
+ /codeexample/prettyprint/point with cs/.code 2 args={\textcolor{violet}{(\pgfmanualpdfref{##1}{##1}:##2}},%
+ /codeexample/prettyprint/comment font=\itshape,
+ /codeexample/prettyprint/base color/.initial=\color{black!55},
+ /pdflinks/render hyperlink/.code={%
+ {\setbox0=\hbox{##1}%
+ \rlap{{\color{white}\dimen0\wd0\advance\dimen0by-\pgfmanualcslinkpreskip\hskip\pgfmanualcslinkpreskip\vrule width\dimen0 height-1pt depth1.6pt}}%
+ \box0%
+ }%
+ }
+ }
+}
+
+\def\pgfmanualwordstartup{\textcolor{black}}
+
%%% Local Variables:
%%% mode: latex
diff --git a/Master/texmf-dist/doc/latex/sa-tikz/sa-tikz-doc.pdf b/Master/texmf-dist/doc/latex/sa-tikz/sa-tikz-doc.pdf
index 19408d7d244..6d28614332b 100644
--- a/Master/texmf-dist/doc/latex/sa-tikz/sa-tikz-doc.pdf
+++ b/Master/texmf-dist/doc/latex/sa-tikz/sa-tikz-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/latex/sa-tikz/sa-tikz-doc.tex b/Master/texmf-dist/doc/latex/sa-tikz/sa-tikz-doc.tex
index bf3ec67f415..4e8d4d73bf8 100644
--- a/Master/texmf-dist/doc/latex/sa-tikz/sa-tikz-doc.tex
+++ b/Master/texmf-dist/doc/latex/sa-tikz/sa-tikz-doc.tex
@@ -51,8 +51,8 @@
/pdflinks/show labels=false,
}
\makeindex
-\newcommand{\version}{0.6}
-\newcommand{\versiondate}{September 28, 2013}
+\newcommand{\version}{0.7}
+\newcommand{\versiondate}{January 21, 2014}
\title{\saTikZ\footnote{This package has version number \textit{v}\version\ of \versiondate; it is released under and subject to the \href{http://www.latex-project.org/lppl/}{\LaTeX\ Project Public License (LPPL)}.}}
\author{Claudio Fiandrino \\ \small\href{mailto:claudio.fiandrino@gmail.com}{\texttt{claudio.fiandrino@gmail.com}}}
@@ -64,9 +64,9 @@
\section*{Introduction}
\addcontentsline{toc}{section}{Introduction}
-The \saTikZ\ library helps in drawing \emph{switching-architectures}. In particular, one of its aims, is to help students to verify the correctness of their exercises. It could also help teachers in preparing lecture notes. The repository of the library is \href{https://github.com/cfiandra/Sa-TikZ}{https://github.com/cfiandra/Sa-TikZ}.
+The \saTikZ\ library is a tool for drawing \emph{switching-architectures}. In particular, one of its aims, is to help students to verify the correctness of their exercises, but it could also help teachers in preparing lecture notes. The official webpage of the project is hosted on \href{http://cfiandra.github.io/Sa-TikZ/}{http://cfiandra.github.io/Sa-TikZ/} and a public repository of the library can be found in \href{https://github.com/cfiandra/Sa-TikZ}{https://github.com/cfiandra/Sa-TikZ}.
-The \saTikZ\ library can be loaded in the preamble by means of:
+The \saTikZ\ library can be loaded in a \LaTeX\ preamble by means of:
\begin{flushleft}
\verb|\usetikzlibrary{|\bgroup\color{red!75!black}\verb|switching-architectures|\egroup\verb|}|
\end{flushleft}
@@ -78,9 +78,9 @@ or by means of:
\begin{flushleft}
\verb|\usepackage{|\bgroup\color{red!75!black}\verb|sa-tikz|\egroup\verb|}|
\end{flushleft}
-In both cases the libraries \bgroup\color{red!75!black}\verb|calc|\egroup{}, \bgroup\color{red!75!black}\verb|positioning|\egroup\ and \bgroup\color{red!75!black}\verb|decorations.pathreplacing|\egroup\ are loaded automatically and in the latter case also the \Tikz\ package is loaded.
+In both cases the auxiliary \Tikz\ libraries \bgroup\color{red!75!black}\verb|calc|\egroup{}, \bgroup\color{red!75!black}\verb|decorations.pathreplacing|\egroup\ and \bgroup\color{red!75!black}\verb|positioning|\egroup\ are automatically loaded; in the latter case also the \Tikz\ package is loaded.
-The version \textit{v}\version\ provides a way to draw Clos Networks Strictly-non-Blocking (snb) and Rearrangeable (rear), Benes Networks and Banyan Networks (in particular Omega\footnote{Implementation of Omega Networks by João Gabriel Reis.} and Flip Networks); moreover, the package provides the possibility to fully customize the aspect of the drawn network: the dimensions of module, their distance and the font used are some examples. Finally, \saTikZ\ let the user to draw connections among the stages by accessing the single ports of the modules.
+The version \textit{v}\version\ is compliant with \Tikz\ 3.0.0 and provides a way to draw Clos Networks Strictly-non-Blocking (snb) and Rearrangeable (rear), Benes Networks and Banyan Networks (in particular Omega\footnote{Implementation of Omega Networks by João Gabriel Reis.} and Flip Networks); moreover, the package provides the possibility to fully customize the aspect of the drawn network: the dimensions of module, their distance and the font used are some examples. Finally, \saTikZ\ let users to draw connections among the stages by accessing the single ports of the modules.
\section{Basic usage}
The simplest use of the package is to define a
@@ -128,7 +128,7 @@ The following example shows a Strictly-non-Blocking Clos Network.
\end{tikzpicture}
\end{codeexample}
-Notice from the examples that automatically the library is able to compute the constraints that define a Clos Network to be Strictly-non-Blocking or Rearrangeable. Moreover, the network drawn is characterized by:
+Notice from the examples that the library is able to compute \textit{automatically} the constraints defining a Clos Network to be Strictly-non-Blocking or Rearrangeable. The network drawn is characterized by:
\begin{itemize}
\item the first stage with:
\begin{itemize}
@@ -163,10 +163,10 @@ The algorithm in which the internal connections of the |benes complete| networks
\subsection{Examples of Banyan Networks}
-The following examples show the two Banyan Network architectures handled by the library.
+The following examples show the two Banyan Network architectures that \saTikZ\ can draw.
-\begin{minipage}{0.99\textwidth}
-\tikzset{every node/.append style={scale=0.95,transform shape}}
+\bgroup
+\tikzset{every node/.append style={scale=0.9,transform shape}}
\begin{codeexample}[]
\begin{tikzpicture}
% Omega Network on the left
@@ -178,21 +178,21 @@ The following examples show the two Banyan Network architectures handled by the
\end{tikzpicture}
\end{codeexample}
\tikzset{every node/.append style={scale=1,transform shape}}
-\end{minipage}
+\egroup
\section{The options}
\subsection{Designing choices}
-This subsection illustrates which are the parameters that could be customized to draw Clos, Benes and Omega Networks. In particular:
+This subsection provides a detailed analysis of the options and parameters that can be used to draw Clos, Benes and Omega Networks. In particular:
\begin{itemize}
\item Clos Networks are analysed in \ref{subsubsec:clos};
\item Benes Networks are analysed in \ref{subsubsec:benes};
\item Banyan Networks are analysed in \ref{subsubsec:banyan}.
\end{itemize}
-In each part the keys will be presented and simple examples will be provided.
+Each subsection presents the keys' definitions and simple examples to help the reader.
\subsubsection{Clos Networks}
\label{subsubsec:clos}
-The two first important design parameters are the total number of input ports of the first stage and the total number of output ports of the last stage. These two parameters could be modified by means of:
+The two first important design parameters are the total number of input ports of the first stage and the total number of output ports of the last stage. These two parameters could be customized by means of:
\begin{key}{/tikz/N=\marg{value} (initially 10)}
This is the number of total input ports in the first stage.
@@ -202,7 +202,7 @@ The two first important design parameters are the total number of input ports of
This is the number of total output ports in the last stage.
\end{key}
-Usually, a second design parameter is the number of modules present in the first and last stage. \saTikZ\ defines:
+Usually, a second important design parameter is the number of modules present in the first and last stage. \saTikZ\ defines:
\begin{key}{/tikz/r1=\marg{value} (initially 5)}
This is the number of modules in the first stage.
@@ -228,7 +228,7 @@ Some examples considering |N|=9, |r1|=3, |M|=9 and |r3|=3.
\end{tikzpicture}
\end{codeexample}
-Notice a very important thing: the type of the architecture should be loaded \emph{after} all the design choices in case they have been set in the \cs{node}; indeed, if you do not respect this constraint you will end up with an architecture with default values. For example:
+Notice a very important thing: when the keys are set within the \cs{node}, the type of the architecture should be loaded \emph{after} all the design parameters; if this constraint is not respected, you will end up with an architecture which has default values. For example:
\begin{codeexample}[]
\begin{tikzpicture}
@@ -238,7 +238,7 @@ Notice a very important thing: the type of the architecture should be loaded \em
\subsubsection{Benes Networks}
\label{subsubsec:benes}
-Benes Networks are Clos Rearrangeable Networks composed of $2 \times 2$ modules, so as design choice it just possible to select which is the number of input/output ports:
+Benes Networks are Clos Rearrangeable Networks composed of $2 \times 2$ modules. Hence, as design choice, it just possible to select the number of input/output ports:
\begin{key}{/tikz/P=\marg{value} (initially 8)}
This is the number of total input/output ports in the first/third stage.
@@ -248,9 +248,9 @@ Notice that |P| could assume values
\[P=2^p \qquad p=2,3,4,\ldots\]
and the user is responsible to correctly set this parameter.
-For low values of $p$ there are no problems in visualizing the network, but as $p$ increases the user should take care of the modules' dimension and the modules' separation (vertical and horizontal): they could be customized as explained in the subsection \ref{subsec:customization}. Actually, for |benes complete| networks, the number of $p$ is crucial: when it is above 7, thus for networks bigger than $128\times 128$, PGF can not properly work due to internal limitations.
+For low values of $p$ there are no problems in visualizing the network, but as $p$ increases, the user should take care of the modules' dimension and the modules' separation (vertical and horizontal): these parameters could be customized as explained in the subsection \ref{subsec:customization}. Actually, for |benes complete| networks, the number of $p$ is crucial: when it is above 7, namely the network is bigger than $128\times 128$, PGF can not properly work due to internal limitations.
-Notice that actually, for |P|=4 the |benes| network and the |benes complete| network are indistinguishable:
+Notice that, for |P|=4 the |benes| network and the |benes complete| network are indistinguishable:
\begin{codeexample}[]
\begin{tikzpicture}
\tikzset{module size=0.5cm,
@@ -263,7 +263,6 @@ Notice that actually, for |P|=4 the |benes| network and the |benes complete| net
\end{tikzpicture}
\end{codeexample}
-
Here is an example of Benes Network with |P|=16:
\begin{codeexample}[]
\begin{tikzpicture}
@@ -271,14 +270,13 @@ Here is an example of Benes Network with |P|=16:
\end{tikzpicture}
\end{codeexample}
-It holds the same concept already said for Clos Networks: set the parameter |P| before declaring the \cs{node} be a Benes Network.
-
+It holds the same concept afore-mentioned for Clos Networks: set the parameter |P| before declaring the \cs{node} to be a Benes Network.
\subsubsection{Banyan Networks}
\label{subsubsec:banyan}
Banyan Networks are architectures based on Benes Networks: they have particular interconnections properties. As well as Benes Networks, only the number of inputs and outputs ports can be selected and it is |P|.
-\saTikZ is able to represent Omega and Flip Banyan Networks. An example of $4\times 4$ |banyan omega| network:
+\saTikZ is able to represent Omega and Flip Banyan Networks. Omega networks are based on João Gabriel Reis' implementation. An example of $4\times 4$ |banyan omega| network:
\begin{codeexample}[]
\begin{tikzpicture}
\node[P=4,banyan omega] {};
@@ -292,10 +290,9 @@ An example of $4\times 4$ |banyan flip| network:
\end{tikzpicture}
\end{codeexample}
-
\subsection{Output customization}
\label{subsec:customization}
-This subsection focuses on how to customize the aspect of the networks.
+This subsection presents the keys devoted to customize the networks' aspect.
\begin{key}{/tikz/module size=\marg{value} (initially 1cm)}
This option allows to set the module dimension.
@@ -325,7 +322,7 @@ This subsection focuses on how to customize the aspect of the networks.
This option, not active by default |connections disabled/.default=false|, allows to remove the connections between the stages when it is set to \opt{true}. Beware: this option is valid only for |clos snb|, |clos rear|, |benes| and |benes complete| networks, but it does not holds for the architectures explained in section \ref{sec:dida}.
\end{key}
-The following example shows a Rearrangeable Clos Network with some options customized. Notice that the |module label opacity| should be given as parameter of the desired network.
+The following example shows a Rearrangeable Clos Network with some custom options. Notice that the |module label opacity| should be given as parameter of the desired network.
\begin{codeexample}[]
\begin{tikzpicture}[N=9,r1=3,M=9,r3=3]
@@ -335,12 +332,12 @@ The following example shows a Rearrangeable Clos Network with some options custo
\end{tikzpicture}
\end{codeexample}
-The options could also be introduced with the standard \Tikz\ syntax:
+The options could be also introduced with the standard \Tikz\ syntax:
\begin{command}{{\tikzset}\marg{options}}
Command that process the various \meta{options}: they should be provided separated by commas.
\end{command}
-Therefore, the previous example could be modified into:
+Therefore, the previous example can be modified into:
\begin{codeexample}[]
\tikzset{module size=0.5cm,pin length factor=0.5,
module ysep=1, module xsep=1.25,}
@@ -366,7 +363,7 @@ It is also possible to declare \opt{styles} to set some options for later use: t
\end{tikzpicture}
\end{codeexample}
-Here is a Benes Network $4 \times 4$ with an extremely large font size for the module labels with the connections disabled:
+Here is a Benes Network $4 \times 4$ which presents an extremely large font size for the module labels and its interconnection paths are disabled:
\begin{codeexample}[]
\tikzset{my style/.style={
module size=0.75cm,
@@ -415,7 +412,7 @@ and its complete form:
\section{Advanced usage}
-This section presents some more advanced examples. More in detail, it is described how to add elements to the basic architecture; elements can be:
+This section presents some more advanced examples. More in detail, it is described how to add elements to the basic architecture; the elements can be:
\begin{itemize}
\item labels for the input and output ports;
\item paths interconnecting input and output ports.
@@ -516,7 +513,7 @@ Ti\textit{k}Z has very useful \verb|bin(|$x$\verb|)| function: it converts $x$ (
\foreach \module in {1,...,4}{
\foreach \port in {1,...,2}{
\stepcounter{porta}
- \pgfmathbin{\theporta-1}
+ \pgfmathbin{\theporta-1}% get the binary value of the counter
\node[left] at (r0-\module-front input-\port)
{\scriptsize{\pgfmathresult}};
\node[right] at (r3-\module-front output-\port)
@@ -686,7 +683,7 @@ The labels could be customized by means of:
An example with the default values for the labels:
\begin{codeexample}[]
-%\tikzset{N=8,r1=4,M=8,r3=4} % setting the parameters here is useless
+%\tikzset{N=8,r1=4,M=8,r3=4} % here, setting the parameters is useless
\begin{tikzpicture}
\node[clos example with labels] {};
\end{tikzpicture}
@@ -758,10 +755,10 @@ Indeed:
\end{tikzpicture}
}
\end{center}
-This parameter, therefore, allows to correctly draw all the modules of the network and, as it will be pointed out later better, its knowledge is important also to define the stages range of applicability of the algorithm. Notice the network symmetry: the connections from stage 1 to stage 4 are exactly the same from stage 7 to stage 4.
+This parameter, therefore, allows to correctly draw all the modules of the network. As it will be pointed out later better, knowing |P| is also important to define the range of applicability of the algorithm among the stages. Notice the network symmetry: the connections from stage 1 to stage 4 are exactly identical to the connections from stage 7 to stage 4.
\pagebreak
-The first step is \emph{labelling} modules and ports. \saTikZ\ uses this philosophy:
+The first step is \emph{labelling} modules and ports. \saTikZ\ uses this rationale:
\begin{itemize}
\item progressive numeration for modules of the same stage;
\item progressive numeration for ports of the same module.
@@ -792,7 +789,7 @@ Thus:
}
\end{center}
-Due to the network symmetry, at the beginning the attention will be focused only on the left side of the network, because for the right part things are dual:
+Due to the network symmetry, the attention will be focused only on the left side of the network initially. On the right part of the network, things are dual.
\begin{center}
\scalebox{0.75}{
@@ -881,15 +878,15 @@ Now, by drawing some connections, it is possible to find a common behaviour:
\[\textrm{end module}=\dfrac{st+\gamma}{2}\; , \; \textrm{port}=2 \]
\end{itemize}
-What is the term $\gamma$? It is a corrective term that depends on the starting stage. Consider indeed the connections of the output port 2 of the module 1 for the first and the second starting stages:
+What is the term $\gamma$? It is a corrective term that depends on the starting stage. Consider, indeed, the connections of the output port 2 of module 1 in the first and in the second starting stages:
\begin{flushleft}
\texttt{r1-1-output-2} \tikz[baseline=-0.5ex]\draw[-stealth](0,0)--(0.5,0); \texttt{r2-5-input-1}\\
\texttt{r2-1-output-2} \tikz[baseline=-0.5ex]\draw[-stealth](0,0)--(0.5,0); \texttt{r3-3-input-1}
\end{flushleft}
-In the first case it points to module 5 while in the second case to module 3, thus in the first case $\gamma=8$ and in the second case $\gamma=4$. This suggest that $\gamma$ is related in some sense to the stage of the start module: in the example |P|=16 so the relation is
+In the first case it points to module 5 while in the second case to module 3, thus $\gamma=8$ and $\gamma=4$ in the first case and in the second case respectively. This suggest that $\gamma$ is related in some sense to the stage of the start module: in our example |P|=16, hence the relation is
\[\gamma=\dfrac{P}{2^{stage}}\]
-Following this strategy, however, allows to draw just part of the connections:
+However, following this strategy allows to draw just part of the connections:
\begin{center}
\scalebox{0.75}{
\begin{tikzpicture}[module size=0.75cm, module ysep=1, module xsep=3.5, connections disabled=true]
@@ -915,8 +912,8 @@ Following this strategy, however, allows to draw just part of the connections:
\foreach \stg[evaluate=\stg as \nextstg using int(\stg+1)] in {1,...,3}{
\pgfmathtruncatemacro\applicationon{16/(2^\stg)}% number of modules over which the algorithm is applied
\foreach \startmodule in {1,...,\applicationon}{
- \pgfmathisodd{\startmodule}{initmodule}
- \ifnum\initmodule=1
+ \pgfmathisodd{\startmodule}
+ \ifnum\pgfmathresult=1
% if odd
\pgfmathtruncatemacro\endmodulei{int((\startmodule+1)/2)}
\pgfmathtruncatemacro\endmoduleii{int(ceil(\startmodule+1+\applicationon)/2)}
@@ -941,29 +938,78 @@ thus it is possible to claim that the algorithm has a \emph{module applicability
\item in the second stage it could be applied for half of the modules;
\item in the third stage it could be applied just for two modules.
\end{itemize}
-But, in the first stage $\gamma=8$ ($P/2^1$), in the second stage $\gamma=4$ ($P/2^2$) and in the third stage $\gamma=2$ ($P/2^3$): this means that $\gamma$ defines the \emph{module applicability range}.
+Since in the first stage $\gamma=8$ ($P/2^1$), in the second stage $\gamma=4$ ($P/2^2$) and in the third stage $\gamma=2$ ($P/2^3$): this means that $\gamma$ defines the \emph{module applicability range}.
-Notice now, that actually for the second stage and the third stage, the algorithm should be simply repeated:
+Notice now, that for the second stage and the third stage, the algorithm should be simply repeated:
\begin{itemize}
\item in the second stage 2 times;
\item in the third stage 4 times.
\end{itemize}
-The repetition $\psi$ depends on the stage with this relation:
+The repetition $\psi$ depends on the stage according to the following relation:
\[\psi= 2^{stage-1}\]
Now, to draw automatically all the connections, the algorithm should know which are the starting module and ending module of the \emph{module applicability range} during the repetitions: for example, in the second stage, how to identify automatically the applicability range \texttt{1-4}, \texttt{5-8}?
-\pagebreak
+
+\begin{center}
+\scalebox{0.75}{
+ \begin{tikzpicture}[module size=0.75cm, module ysep=1, module xsep=3.5, connections disabled=true]
+ \node[P=16, benes complete]{};
+ \foreach \stg in {2,...,6}{
+ \foreach \module in {1,...,8}{
+ \node[right,font=\scriptsize] at (r\stg-\module-output-1) {1};
+ \node[right,font=\scriptsize] at (r\stg-\module-output-2) {2};
+ \node[left,font=\scriptsize] at (r\stg-\module-input-1) {1};
+ \node[left,font=\scriptsize] at (r\stg-\module-input-2) {2};
+ }
+ }
+ \foreach \module in {1,...,8}{
+ \node[right,font=\scriptsize] at (r1-\module-output-1) {1};
+ \node[right,font=\scriptsize] at (r1-\module-output-2) {2};
+ }
+ \foreach \module in {1,...,8}{
+ \node[left,font=\scriptsize] at (r7-\module-input-1) {1};
+ \node[left,font=\scriptsize] at (r7-\module-input-2) {2};
+ }
+ % some connections
+ \begin{pgfonlayer}{background}
+ \filldraw[fill=blue!10,draw=white,rounded corners]($(r2-4)-(0.75,0.5)$)rectangle ($(r2-1)+(0.75,0.5)$);
+ \filldraw[fill=green!10,draw=white,rounded corners]($(r2-8)-(0.75,0.5)$)rectangle ($(r2-5)+(0.75,0.5)$);
+ \foreach \stg[evaluate=\stg as \nextstg using int(\stg+1)] in {1,...,3}{
+ \pgfmathtruncatemacro\applicationon{16/(2^\stg)}% number of modules over which the algorithm is applied
+ \foreach \startmodule in {1,...,\applicationon}{
+ \pgfmathisodd{\startmodule}
+ \ifnum\pgfmathresult=1
+ % if odd
+ \pgfmathtruncatemacro\endmodulei{int((\startmodule+1)/2)}
+ \pgfmathtruncatemacro\endmoduleii{int(ceil(\startmodule+1+\applicationon)/2)}
+ \draw[red](r\stg-\startmodule-output-1)--(r\nextstg-\endmodulei-input-1);
+ \draw[red](r\stg-\startmodule-output-2)--(r\nextstg-\endmoduleii-input-1);
+ \else
+ % if even
+ \pgfmathtruncatemacro\endmodulei{int((\startmodule)/2)}
+ \pgfmathtruncatemacro\endmoduleii{int((\startmodule+\applicationon)/2)}
+ \draw[red](r\stg-\startmodule-output-1)--(r\nextstg-\endmodulei-input-2);
+ \draw[red](r\stg-\startmodule-output-2)--(r\nextstg-\endmoduleii-input-2);
+ \fi
+ }
+ }
+
+ \draw($(r2-8)-(1,1)$)rectangle ($(r3-1)+(1,1)$);
+ \end{pgfonlayer}
+ \end{tikzpicture}
+}
+\end{center}
They could be defined as:
\begin{itemize}
\item starting module: $st_m=1+(\psi-1)\cdot\gamma $;
\item ending module: $end_m=(st_m+\gamma)-1$.
\end{itemize}
-Indeed for the second stage we have that $\gamma=4$ and $\psi=2\implies \{1,\, 2\}$, thus there are two starting and ending modules:
+Indeed, for the second stage we have that $\gamma=4$ and $\psi=2\implies \{1,\, 2\}$, hence there are two starting and ending modules:
\begin{itemize}
\item starting modules: $st_{m_1}=1+(1-1)\cdot 4=1$ and $st_{m_2}=1+(2-1)\cdot 4=5$;
\item ending modules: $end_{m_1}=(1+4)-1=4$ and $end_{m_2}=(5+4)-1=8$.
\end{itemize}
-Unfortunately, the knowledge of the starting and ending modules per stage is not sufficient to reach the goal: this because the algorithm works and draws the connections perfectly when the module labels start with 1, but during the repetitions the new starting module labels are different, so the computation of the end connection point fails. This difference should be compensated with \emph{shifts} of the ending modules that depend on the level of repetition. The rules are:
+Unfortunately, the knowledge of the starting and ending modules of each stage is not sufficient to reach the goal: the reason is that the algorithm works and draws the connections in a correct manner when the module labels start with 1. However, during the repetitions the new starting module labels are different, thus the computation of the end connection point fails. This difference should be compensated with \emph{shifts} of the ending modules that depend on the level of repetition. The rules are:
\begin{itemize}
\item if $\psi=1$ (the algorithm works for all modules of the stage), then the ending module of the connection is computed as:
\begin{itemize}
@@ -999,7 +1045,7 @@ Unfortunately, the knowledge of the starting and ending modules per stage is not
\[\textrm{end module}=\dfrac{st+\gamma}{2}+\dfrac{\gamma}{2}+\left(\dfrac{\gamma}{2}\cdot (t-2)\right)\; , \; \textrm{port}=2 \]
\end{itemize}
\end{itemize}
-Unfortunately, the rule $\psi>2$ when applied to the intermediate stages
+Unfortunately, the rule $\psi>2$ when it is applied to the intermediate stages
\[I_1=\lfloor\mathcal{S}\div 2\rfloor \hspace*{1cm} I_2=\mathcal{S}-(I_1-1)\]
does not work; this implies that:
\begin{itemize}
@@ -1018,7 +1064,7 @@ does not work; this implies that:
\end{itemize}
\end{itemize}
-To summarize, the algorithm to \textbf{d}raw \textbf{B}enes \textbf{n}etwork \textbf{c}onnections (dBnc) is reported in~\ref{algo_dBnc}: for the rules, please refer to the descriptions mentioned above.
+To summarize, the algorithm to \textbf{d}raw \textbf{B}enes \textbf{n}etwork \textbf{c}onnections (dBnc) is reported in~\ref{algo_dBnc}: for the rules, please refer to the afore-mentioned description.
\begin{algorithm}
compute $\mathcal{S}=2\log_2{P}-1$\;
diff --git a/Master/texmf-dist/tex/latex/sa-tikz/sa-tikz.sty b/Master/texmf-dist/tex/latex/sa-tikz/sa-tikz.sty
index b54c154e131..bb4d1983080 100644
--- a/Master/texmf-dist/tex/latex/sa-tikz/sa-tikz.sty
+++ b/Master/texmf-dist/tex/latex/sa-tikz/sa-tikz.sty
@@ -1,10 +1,10 @@
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
%
-% Sa-TikZ package v0.6 * * (C) Claudio Fiandrino 2012-2013
+% Sa-TikZ package v0.7 * * (C) Claudio Fiandrino 2012-2014
%
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{sa-tikz}[2013/9/28 v0.6 Switching architectures design library.]
+\ProvidesPackage{sa-tikz}[2014/1/21 v0.7 Switching architectures design library.]
\RequirePackage{tikz}
\usetikzlibrary{backgrounds,calc,positioning,decorations.pathreplacing}
@@ -12,22 +12,6 @@
% UTILITY
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-% PGFMATHISODD: 1 = true, 0 = false
-%
-% #1: number to be checked
-% #2: output macro
-%
-% example:
-%% \pgfmathisodd{32}{output}
-%% \ifnum\output=1
-%% \node{\output};
-%% \fi
-\newcommand*{\pgfmathisodd}[2]{
- \pgfmathparse{mod(#1,2)}
- \pgfmathtruncatemacro\res\pgfmathresult
- \global\expandafter\edef\csname #2\endcsname{\res}
-}
-
% PGFMATHOMEGAROTATION:
%
% #1: number to be rotated
@@ -35,8 +19,8 @@
% #3: output macro
%
\newcommand*{\pgfmathomegarotation}[3]{
- \pgfmathisodd{#1}{test}
- \ifnum\test=1
+ \pgfmathisodd{#1}
+ \ifnum\pgfmathresult=1
\pgfmathparse{#1/2 + 2^#2}
\else
\pgfmathparse{#1/2}
@@ -45,8 +29,6 @@
\global\expandafter\edef\csname #3\endcsname{\res}
}
-
-
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
% KEY DEFINITION - Design choices
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -912,9 +894,9 @@
\pgfmathtruncatemacro\startingpoint{1+((\t-1)*\applicationon)}
\pgfmathtruncatemacro\endingpoint{(\startingpoint+\applicationon)-1}
\foreach \startmodule in {\startingpoint,...,\endingpoint}{
- \pgfmathisodd{\startmodule}{initmodule}
+ \pgfmathisodd{\startmodule}
\ifnum\t=1
- \ifnum\initmodule=1
+ \ifnum\pgfmathresult=1
% if odd
\pgfmathtruncatemacro\endmodulei{int((\startmodule+1)/2)}
\pgfmathtruncatemacro\endmoduleii{int((\startmodule+1+\applicationon)/2)}
@@ -929,7 +911,7 @@
\fi
\fi
\ifnum\t=2
- \ifnum\initmodule=1
+ \ifnum\pgfmathresult=1
% if odd
\pgfmathtruncatemacro\endmodulei{int((\startmodule+1)/2+(\applicationon/2))}
\pgfmathtruncatemacro\endmoduleii{int((\startmodule+1+\applicationon)/2+(\applicationon/2))}
@@ -944,7 +926,7 @@
\fi
\fi
\ifnum\t>2
- \ifnum\initmodule=1
+ \ifnum\pgfmathresult=1
% if odd
\pgfmathtruncatemacro\endmodulei{int((\startmodule+1)/2+(\applicationon/2)+((\applicationon/2)*(\t-2)))}
\pgfmathtruncatemacro\endmoduleii{int((\startmodule+1+\applicationon)/2+(\applicationon/2)+((\applicationon/2)*(\t-2)))}
@@ -972,9 +954,9 @@
\pgfmathtruncatemacro\startingpoint{1+((\t-1)*\applicationon)}
\pgfmathtruncatemacro\endingpoint{(\startingpoint+\applicationon)-1}
\foreach \startmodule in {\startingpoint,...,\endingpoint}{
- \pgfmathisodd{\startmodule}{initmodule}
+ \pgfmathisodd{\startmodule}
\ifnum\t=1
- \ifnum\initmodule=1
+ \ifnum\pgfmathresult=1
% if odd
\pgfmathtruncatemacro\endmodulei{int((\startmodule+1)/2)}
\pgfmathtruncatemacro\endmoduleii{int((\startmodule+1+\applicationon)/2)}
@@ -989,7 +971,7 @@
\fi
\fi
\ifnum\t=2
- \ifnum\initmodule=1
+ \ifnum\pgfmathresult=1
% if odd
\pgfmathtruncatemacro\endmodulei{int((\startmodule+1)/2+(\applicationon/2))}
\pgfmathtruncatemacro\endmoduleii{int((\startmodule+1+\applicationon)/2+(\applicationon/2))}
@@ -1004,7 +986,7 @@
\fi
\fi
\ifnum\t>2
- \ifnum\initmodule=1
+ \ifnum\pgfmathresult=1
% if odd
\pgfmathtruncatemacro\endmodulei{int((\startmodule+1)/2+(\applicationon/2)+((\applicationon/2)*(\t-2)))}
\pgfmathtruncatemacro\endmoduleii{int((\startmodule+1+\applicationon)/2+(\applicationon/2)+((\applicationon/2)*(\t-2)))}
@@ -1036,8 +1018,8 @@
% Drawing
\foreach \startmodule in {1,...,\r}{
- \pgfmathisodd{\startmodule}{initmodule}
- \ifnum\initmodule=1
+ \pgfmathisodd{\startmodule}
+ \ifnum\pgfmathresult=1
% if odd
\pgfmathtruncatemacro\endmodule{int(\startmodule+1)}
\draw(r\middlestage-\startmodule-output-1)--(r\middlestagei-\startmodule-input-1);
@@ -1060,7 +1042,7 @@
% BANYAN NETWORKS
-% BANYAN-OMEGA (thanks to João Gabriel Reis)
+% BANYAN-OMEGA (thanks to João Gabriel Reis)
\tikzset{banyan omega/.code={
% Number of ports per module
diff --git a/Master/texmf-dist/tex/latex/sa-tikz/tikzlibraryswitching-architectures.code.tex b/Master/texmf-dist/tex/latex/sa-tikz/tikzlibraryswitching-architectures.code.tex
index 9b42c78ed5e..6b4351887a4 100644
--- a/Master/texmf-dist/tex/latex/sa-tikz/tikzlibraryswitching-architectures.code.tex
+++ b/Master/texmf-dist/tex/latex/sa-tikz/tikzlibraryswitching-architectures.code.tex
@@ -1,6 +1,6 @@
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
%
-% Sa-TikZ package v0.6 * * (C) Claudio Fiandrino 2012-2013
+% Sa-TikZ package v0.7 * * (C) Claudio Fiandrino 2012-2014
%
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -14,22 +14,6 @@
% UTILITY
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
-% PGFMATHISODD: 1 = true, 0 = false
-%
-% #1: number to be checked
-% #2: output macro
-%
-% example:
-%% \pgfmathisodd{32}{output}
-%% \ifnum\output=1
-%% \node{\output};
-%% \fi
-\newcommand*{\pgfmathisodd}[2]{
- \pgfmathparse{mod(#1,2)}
- \pgfmathtruncatemacro\res\pgfmathresult
- \global\expandafter\edef\csname #2\endcsname{\res}
-}
-
% PGFMATHOMEGAROTATION:
%
% #1: number to be rotated
@@ -37,8 +21,8 @@
% #3: output macro
%
\newcommand*{\pgfmathomegarotation}[3]{
- \pgfmathisodd{#1}{test}
- \ifnum\test=1
+ \pgfmathisodd{#1}
+ \ifnum\pgfmathresult=1
\pgfmathparse{#1/2 + 2^#2}
\else
\pgfmathparse{#1/2}
@@ -47,8 +31,6 @@
\global\expandafter\edef\csname #3\endcsname{\res}
}
-
-
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
% KEY DEFINITION - Design choices
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
@@ -914,9 +896,9 @@
\pgfmathtruncatemacro\startingpoint{1+((\t-1)*\applicationon)}
\pgfmathtruncatemacro\endingpoint{(\startingpoint+\applicationon)-1}
\foreach \startmodule in {\startingpoint,...,\endingpoint}{
- \pgfmathisodd{\startmodule}{initmodule}
+ \pgfmathisodd{\startmodule}
\ifnum\t=1
- \ifnum\initmodule=1
+ \ifnum\pgfmathresult=1
% if odd
\pgfmathtruncatemacro\endmodulei{int((\startmodule+1)/2)}
\pgfmathtruncatemacro\endmoduleii{int((\startmodule+1+\applicationon)/2)}
@@ -931,7 +913,7 @@
\fi
\fi
\ifnum\t=2
- \ifnum\initmodule=1
+ \ifnum\pgfmathresult=1
% if odd
\pgfmathtruncatemacro\endmodulei{int((\startmodule+1)/2+(\applicationon/2))}
\pgfmathtruncatemacro\endmoduleii{int((\startmodule+1+\applicationon)/2+(\applicationon/2))}
@@ -946,7 +928,7 @@
\fi
\fi
\ifnum\t>2
- \ifnum\initmodule=1
+ \ifnum\pgfmathresult=1
% if odd
\pgfmathtruncatemacro\endmodulei{int((\startmodule+1)/2+(\applicationon/2)+((\applicationon/2)*(\t-2)))}
\pgfmathtruncatemacro\endmoduleii{int((\startmodule+1+\applicationon)/2+(\applicationon/2)+((\applicationon/2)*(\t-2)))}
@@ -974,9 +956,9 @@
\pgfmathtruncatemacro\startingpoint{1+((\t-1)*\applicationon)}
\pgfmathtruncatemacro\endingpoint{(\startingpoint+\applicationon)-1}
\foreach \startmodule in {\startingpoint,...,\endingpoint}{
- \pgfmathisodd{\startmodule}{initmodule}
+ \pgfmathisodd{\startmodule}
\ifnum\t=1
- \ifnum\initmodule=1
+ \ifnum\pgfmathresult=1
% if odd
\pgfmathtruncatemacro\endmodulei{int((\startmodule+1)/2)}
\pgfmathtruncatemacro\endmoduleii{int((\startmodule+1+\applicationon)/2)}
@@ -991,7 +973,7 @@
\fi
\fi
\ifnum\t=2
- \ifnum\initmodule=1
+ \ifnum\pgfmathresult=1
% if odd
\pgfmathtruncatemacro\endmodulei{int((\startmodule+1)/2+(\applicationon/2))}
\pgfmathtruncatemacro\endmoduleii{int((\startmodule+1+\applicationon)/2+(\applicationon/2))}
@@ -1006,7 +988,7 @@
\fi
\fi
\ifnum\t>2
- \ifnum\initmodule=1
+ \ifnum\pgfmathresult=1
% if odd
\pgfmathtruncatemacro\endmodulei{int((\startmodule+1)/2+(\applicationon/2)+((\applicationon/2)*(\t-2)))}
\pgfmathtruncatemacro\endmoduleii{int((\startmodule+1+\applicationon)/2+(\applicationon/2)+((\applicationon/2)*(\t-2)))}
@@ -1038,8 +1020,8 @@
% Drawing
\foreach \startmodule in {1,...,\r}{
- \pgfmathisodd{\startmodule}{initmodule}
- \ifnum\initmodule=1
+ \pgfmathisodd{\startmodule}
+ \ifnum\pgfmathresult=1
% if odd
\pgfmathtruncatemacro\endmodule{int(\startmodule+1)}
\draw(r\middlestage-\startmodule-output-1)--(r\middlestagei-\startmodule-input-1);
@@ -1062,7 +1044,7 @@
% BANYAN NETWORKS
-% BANYAN-OMEGA (thanks to João Gabriel Reis)
+% BANYAN-OMEGA (thanks to João Gabriel Reis)
\tikzset{banyan omega/.code={
% Number of ports per module