Skip to content

Commit

Permalink
version 0.7a - fixed compatibility of pgfmathisodd with TikZ v 2.10
Browse files Browse the repository at this point in the history
  • Loading branch information
cfiandra committed Jan 29, 2014
1 parent 0c174a7 commit 20699ed
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
% Sa-TikZ: TikZ library to draw switching architectures
%
% Version v0.7 2014/1/21 - (C) Claudio Fiandrino
% Version v0.7a 2014/1/29 - (C) Claudio Fiandrino
%
% E-mail: claudio dot fiandrino at gmail dot com
%
Expand Down
Binary file modified doc/sa-tikz-doc.pdf
Binary file not shown.
12 changes: 6 additions & 6 deletions doc/sa-tikz-doc.tex
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ \section*{Index}\addcontentsline{toc}{section}{Index}
/pdflinks/show labels=false,
}
\makeindex
\newcommand{\version}{0.7}
\newcommand{\versiondate}{January 21, 2014}
\newcommand{\version}{0.7a}
\newcommand{\versiondate}{January 29, 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:[email protected]}{\texttt{[email protected]}}}
Expand Down Expand Up @@ -80,7 +80,7 @@ \section*{Introduction}
\end{flushleft}
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\ 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.
The version \textit{v}\version\ is compliant with \Tikz\ 3.0.0\footnote{In order to compile the documentation, and only for this scope, \Tikz\ 3.0.0 is \emph{mandatory}.} 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
Expand Down Expand Up @@ -380,7 +380,7 @@ \subsection{Output customization}
\end{tikzpicture}
\end{codeexample}

Consider the following $16 \times 16$ Omega Network:
The following example is a $16 \times 16$ Omega Network.
\begin{codeexample}[]
\tikzset{module size=0.6cm,pin length factor=0.6,
module ysep=0.65, module xsep=3.5,}
Expand Down Expand Up @@ -689,7 +689,7 @@ \section{Architectures for didactic purposes}
\end{tikzpicture}
\end{codeexample}

To have automatically all labels in math mode, use:
To have automatically all the labels in math mode, you can use:
\begin{key}{/tikz/set math mode labels=\mchoice{true,false} (default false)}
This option is normally disabled |set math mode labels/.default=false|; to ensure labels be set completely in math mode is sufficient set |set math mode labels=true| before the type of the network.
\end{key}
Expand Down Expand Up @@ -732,7 +732,7 @@ \section{Architectures for didactic purposes}
\clearpage
\appendix

\section{Benes complete internal connections algorithm}
\section{Algorithm for drawing connections in Benes Networks}
\label{sec:benesconnalg}
To explain how the connections of the |benes complete| networks are drawn, the following reference example will be considered:
\begin{center}
Expand Down
22 changes: 20 additions & 2 deletions sa-tikz.sty
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
%
% Sa-TikZ package v0.7 * * (C) Claudio Fiandrino 2012-2014
% Sa-TikZ package v0.7a * * (C) Claudio Fiandrino 2012-2014
%
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{sa-tikz}[2014/1/21 v0.7 Switching architectures design library.]
\ProvidesPackage{sa-tikz}[2014/1/29 v0.7a Switching architectures design library.]
\RequirePackage{tikz}
\usetikzlibrary{backgrounds,calc,positioning,decorations.pathreplacing}

% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
% UTILITY
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

% PGFMATHISODD: 1 = true, 0 = false
% from TikZ 3.0.0
% Test for checking whether \pgfmathisodd is defined or not
% for compatibility with TikZ 2.10
%
\@ifundefined{pgfmathisodd}{
\pgfmathdeclarefunction{isodd}{1}{%
\begingroup
\pgfmathsetcount\c@pgfmath@counta{abs(int(#1))}%
\ifodd\c@pgfmath@counta
\def\pgfmathresult{1}%
\else
\def\pgfmathresult{0}%
\fi
\pgfmath@smuggleone\pgfmathresult
\endgroup}
}{}

% PGFMATHOMEGAROTATION:
%
% #1: number to be rotated
Expand Down
20 changes: 19 additions & 1 deletion tikzlibraryswitching-architectures.code.tex
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
%
% Sa-TikZ package v0.7 * * (C) Claudio Fiandrino 2012-2014
% Sa-TikZ package v0.7a * * (C) Claudio Fiandrino 2012-2014
%
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

Expand All @@ -14,6 +14,24 @@
% UTILITY
% * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

% PGFMATHISODD: 1 = true, 0 = false
% from TikZ 3.0.0
% Test for checking whether \pgfmathisodd is defined or not
% for compatibility with TikZ 2.10
%
\@ifundefined{pgfmathisodd}{
\pgfmathdeclarefunction{isodd}{1}{%
\begingroup
\pgfmathsetcount\c@pgfmath@counta{abs(int(#1))}%
\ifodd\c@pgfmath@counta
\def\pgfmathresult{1}%
\else
\def\pgfmathresult{0}%
\fi
\pgfmath@smuggleone\pgfmathresult
\endgroup}
}{}

% PGFMATHOMEGAROTATION:
%
% #1: number to be rotated
Expand Down

0 comments on commit 20699ed

Please sign in to comment.