Skip to content

Commit

Permalink
Merge pull request battlesnake#5 from TorbjornT/TorbjornT-linklayersfix
Browse files Browse the repository at this point in the history
Fixed macro names in \linklayers
  • Loading branch information
battlesnake authored Dec 17, 2017
2 parents 7dd93c4 + b27e062 commit 09d268a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions neuralnetwork.sty
Original file line number Diff line number Diff line change
Expand Up @@ -200,26 +200,26 @@
\newcommand{\linklayers}[1][] {{%
\setkeys{links} {title={},labels=\nn@defaultlinklabel,style={},not from={}, not to={},#1}
% Layer indices
\edef\lastlayer{\nn@get{lastlayerindex}}
\edef\thislayer{\nn@get{thislayerindex}}
\edef\nn@lastlayer{\nn@get{lastlayerindex}}
\edef\nn@thislayer{\nn@get{thislayerindex}}
% Links
\foreach \lastnode in {\nn@get{lastlayerstart},...,\nn@get{lastlayercount}}
\foreach \thisnode in {1,...,\nn@get{thislayercount}} {
\foreach \nn@lastnode in {\nn@get{lastlayerstart},...,\nn@get{lastlayercount}}
\foreach \nn@thisnode in {1,...,\nn@get{thislayercount}} {
% Draw link if it isn't excluded
\def\nn@dontdraw{0}
\foreach \nn@excluded in \nn@notfrom
\if \nn@excluded \nn@lastnode \global\def\nn@dontdraw{1} \breakforeach \fi;
\foreach \nn@excluded in \nn@notto
\if \nn@excluded \nn@thisnode \global\def\nn@dontdraw{1} \breakforeach \fi;
\if \nn@dontdraw 0
\link[from layer=\lastlayer, from node=\lastnode, to layer=\thislayer, to node=\thisnode, label=\nn@linkslabels, style=\nn@linksstyle];
\link[from layer=\nn@lastlayer, from node=\nn@lastnode, to layer=\nn@thislayer, to node=\nn@thisnode, label=\nn@linkslabels, style=\nn@linksstyle];
\fi
}
% Title
\ifdefempty{\nn@linkstitle} {} {
\pgfmathsetlengthmacro{\nn@links@title@x} {\nn@layerspacing * (\thislayer - 0.5)}
\pgfmathsetlengthmacro{\nn@links@title@x} {\nn@layerspacing * (\nn@thislayer - 0.5)}
\pgfmathsetlengthmacro{\nn@links@title@y} {-(\nn@maintitleheight + \nn@layertitleheight - (\nn@nodespacing / 6))}
\node[linkstitle] (TL\lastlayer) at (\nn@links@title@x, \nn@links@title@y) {\nn@linkstitle};
\node[linkstitle] (TL\nn@lastlayer) at (\nn@links@title@x, \nn@links@title@y) {\nn@linkstitle};
}
}}

Expand Down

0 comments on commit 09d268a

Please sign in to comment.