From b27e062810dcd4b9c357e39f766a41fb93faef3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torbj=C3=B8rn=20T?= Date: Sun, 17 Dec 2017 17:07:15 +0100 Subject: [PATCH] Fixed macro names in \linklayers Fixes the "not from"/"not to" keys, which didn't work because the loop variables were \thislayer/\lastlayer, while the comparison used \nn@thislayer/\nn@lastlayer. --- neuralnetwork.sty | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/neuralnetwork.sty b/neuralnetwork.sty index 058dd0e..b6a1070 100644 --- a/neuralnetwork.sty +++ b/neuralnetwork.sty @@ -200,11 +200,11 @@ \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 @@ -212,14 +212,14 @@ \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}; } }}