Skip to content

Commit

Permalink
Added inputs and outputs to \factor command
Browse files Browse the repository at this point in the history
  • Loading branch information
jluttine committed Sep 10, 2012
1 parent fb0eb65 commit dc5a733
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Provides the following node styles:

Provides the following commands:

* :code:`\factor [options] {name} {caption}`
* :code:`\factor [options] {name} {caption} {inputs} {outputs}`

* :code:`\plate [options] {name} {fitlist} {caption}`

Expand Down
10 changes: 7 additions & 3 deletions tikzlibrarybayesnet.code.tex
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,13 @@
} ;
}

% \factor [options] {name} {caption}
\newcommand{\factor}[3][]{ %
\node[factor, label={[name=#2-caption]#3}, #1] (#2) {} ; %
% \factor [options] {name} {caption} {inputs} {outputs}
\newcommand{\factor}[5][]{ %
% Draw the factor node. Use alias to allow empty names.
\node[factor, label={[name=#2-caption]#3}, name=#2, alias=#2-alias,
#1] {} ; %
% Connect all inputs to outputs via this factor
\factoredge {#4} {#2-alias} {#5} ; %
}

% \plate [options] {name} {fitlist} {caption}
Expand Down

0 comments on commit dc5a733

Please sign in to comment.