TikZ: Summation circle with four ports separated by two prependicular diameters
up vote
5
down vote
favorite
I would like to modify the code of this answer
documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}
to get the output of this answer of a summation circle with four input ports separated by two perpendicular diameters.
Additionally, if the circle is drawn by
documentclass{article}
usepackage{tikz,mathtools,amssymb}
usetikzlibrary{shapes,arrows,positioning,calc}
begin{document}
tikzset{
port/.style = {inner sep=0pt, font=tiny},
sum/.style n args = {4}{draw, circle, node distance = 2cm, minimum size=5mm, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command={
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}}},
}
begin{tikzpicture}[auto, node distance=5mm,>=latex',align=center,]
node [sum={}{+}{-}{}] (sum) {};
end{tikzpicture}
end{document}
how can the two prependicular diameters be drawn?
tikz-pgf
add a comment |
up vote
5
down vote
favorite
I would like to modify the code of this answer
documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}
to get the output of this answer of a summation circle with four input ports separated by two perpendicular diameters.
Additionally, if the circle is drawn by
documentclass{article}
usepackage{tikz,mathtools,amssymb}
usetikzlibrary{shapes,arrows,positioning,calc}
begin{document}
tikzset{
port/.style = {inner sep=0pt, font=tiny},
sum/.style n args = {4}{draw, circle, node distance = 2cm, minimum size=5mm, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command={
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}}},
}
begin{tikzpicture}[auto, node distance=5mm,>=latex',align=center,]
node [sum={}{+}{-}{}] (sum) {};
end{tikzpicture}
end{document}
how can the two prependicular diameters be drawn?
tikz-pgf
Can you also provide a complete MWE for your second variant?
– Skillmon
2 days ago
@Skillmon I apologize. I updated my question.
– Diaa
2 days ago
add a comment |
up vote
5
down vote
favorite
up vote
5
down vote
favorite
I would like to modify the code of this answer
documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}
to get the output of this answer of a summation circle with four input ports separated by two perpendicular diameters.
Additionally, if the circle is drawn by
documentclass{article}
usepackage{tikz,mathtools,amssymb}
usetikzlibrary{shapes,arrows,positioning,calc}
begin{document}
tikzset{
port/.style = {inner sep=0pt, font=tiny},
sum/.style n args = {4}{draw, circle, node distance = 2cm, minimum size=5mm, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command={
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}}},
}
begin{tikzpicture}[auto, node distance=5mm,>=latex',align=center,]
node [sum={}{+}{-}{}] (sum) {};
end{tikzpicture}
end{document}
how can the two prependicular diameters be drawn?
tikz-pgf
I would like to modify the code of this answer
documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}
to get the output of this answer of a summation circle with four input ports separated by two perpendicular diameters.
Additionally, if the circle is drawn by
documentclass{article}
usepackage{tikz,mathtools,amssymb}
usetikzlibrary{shapes,arrows,positioning,calc}
begin{document}
tikzset{
port/.style = {inner sep=0pt, font=tiny},
sum/.style n args = {4}{draw, circle, node distance = 2cm, minimum size=5mm, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command={
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}}},
}
begin{tikzpicture}[auto, node distance=5mm,>=latex',align=center,]
node [sum={}{+}{-}{}] (sum) {};
end{tikzpicture}
end{document}
how can the two prependicular diameters be drawn?
tikz-pgf
tikz-pgf
edited 2 days ago
asked 2 days ago
Diaa
2,51011644
2,51011644
Can you also provide a complete MWE for your second variant?
– Skillmon
2 days ago
@Skillmon I apologize. I updated my question.
– Diaa
2 days ago
add a comment |
Can you also provide a complete MWE for your second variant?
– Skillmon
2 days ago
@Skillmon I apologize. I updated my question.
– Diaa
2 days ago
Can you also provide a complete MWE for your second variant?
– Skillmon
2 days ago
Can you also provide a complete MWE for your second variant?
– Skillmon
2 days ago
@Skillmon I apologize. I updated my question.
– Diaa
2 days ago
@Skillmon I apologize. I updated my question.
– Diaa
2 days ago
add a comment |
1 Answer
1
active
oldest
votes
up vote
5
down vote
accepted
Do you mean like this?
documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
draw
(n.north west) -- (n.south east)
(n.south west) -- (n.north east)
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}
It is possible to also append the lines in your second variant. And thanks to @marmot, it is possible to do so without paying further attention:
documentclass{standalone}
usepackage{tikz}
tikzset
{
port/.style = {inner sep=0pt, font=tiny},
cross/.style =
{%
path picture=%
{
draw
(path picture bounding box.north west) --
(path picture bounding box.south east)
(path picture bounding box.south west) --
(path picture bounding box.north east)
;
}
},
sum/.style n args = {4}%
{%
draw, circle, node distance = 2cm, minimum size=5mm, cross, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command=%
{%
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}
},
},
}
begin{document}
begin{tikzpicture}
node [sum={}{+}{-}{}] (b) {};
end{tikzpicture}
end{document}
Exactly. May I know how can I draw the two diameters in the second case that I appended to my question?
– Diaa
2 days ago
Off-topic question: is it possible to declare multiple nodes using one single commandnode
?
– Diaa
19 hours ago
@Diaanode
is the same aspath node
so you can specify further nodes usingnode (a) {a} node (b) {b} ...
.
– Skillmon
16 hours ago
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
5
down vote
accepted
Do you mean like this?
documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
draw
(n.north west) -- (n.south east)
(n.south west) -- (n.north east)
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}
It is possible to also append the lines in your second variant. And thanks to @marmot, it is possible to do so without paying further attention:
documentclass{standalone}
usepackage{tikz}
tikzset
{
port/.style = {inner sep=0pt, font=tiny},
cross/.style =
{%
path picture=%
{
draw
(path picture bounding box.north west) --
(path picture bounding box.south east)
(path picture bounding box.south west) --
(path picture bounding box.north east)
;
}
},
sum/.style n args = {4}%
{%
draw, circle, node distance = 2cm, minimum size=5mm, cross, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command=%
{%
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}
},
},
}
begin{document}
begin{tikzpicture}
node [sum={}{+}{-}{}] (b) {};
end{tikzpicture}
end{document}
Exactly. May I know how can I draw the two diameters in the second case that I appended to my question?
– Diaa
2 days ago
Off-topic question: is it possible to declare multiple nodes using one single commandnode
?
– Diaa
19 hours ago
@Diaanode
is the same aspath node
so you can specify further nodes usingnode (a) {a} node (b) {b} ...
.
– Skillmon
16 hours ago
add a comment |
up vote
5
down vote
accepted
Do you mean like this?
documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
draw
(n.north west) -- (n.south east)
(n.south west) -- (n.north east)
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}
It is possible to also append the lines in your second variant. And thanks to @marmot, it is possible to do so without paying further attention:
documentclass{standalone}
usepackage{tikz}
tikzset
{
port/.style = {inner sep=0pt, font=tiny},
cross/.style =
{%
path picture=%
{
draw
(path picture bounding box.north west) --
(path picture bounding box.south east)
(path picture bounding box.south west) --
(path picture bounding box.north east)
;
}
},
sum/.style n args = {4}%
{%
draw, circle, node distance = 2cm, minimum size=5mm, cross, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command=%
{%
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}
},
},
}
begin{document}
begin{tikzpicture}
node [sum={}{+}{-}{}] (b) {};
end{tikzpicture}
end{document}
Exactly. May I know how can I draw the two diameters in the second case that I appended to my question?
– Diaa
2 days ago
Off-topic question: is it possible to declare multiple nodes using one single commandnode
?
– Diaa
19 hours ago
@Diaanode
is the same aspath node
so you can specify further nodes usingnode (a) {a} node (b) {b} ...
.
– Skillmon
16 hours ago
add a comment |
up vote
5
down vote
accepted
up vote
5
down vote
accepted
Do you mean like this?
documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
draw
(n.north west) -- (n.south east)
(n.south west) -- (n.north east)
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}
It is possible to also append the lines in your second variant. And thanks to @marmot, it is possible to do so without paying further attention:
documentclass{standalone}
usepackage{tikz}
tikzset
{
port/.style = {inner sep=0pt, font=tiny},
cross/.style =
{%
path picture=%
{
draw
(path picture bounding box.north west) --
(path picture bounding box.south east)
(path picture bounding box.south west) --
(path picture bounding box.north east)
;
}
},
sum/.style n args = {4}%
{%
draw, circle, node distance = 2cm, minimum size=5mm, cross, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command=%
{%
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}
},
},
}
begin{document}
begin{tikzpicture}
node [sum={}{+}{-}{}] (b) {};
end{tikzpicture}
end{document}
Do you mean like this?
documentclass[tikz, border=5pt]{standalone}
begin{document}
tikzset{
charge node/.style={inner sep=0pt},
pics/sum block/.style n args={4}{
code={
path node (n) [draw, circle, inner sep=0pt, minimum size=9mm] {}
(n.north) +(0,-1.5mm) node [charge node] {$#1$}
(n.south) +(0,1.5mm) node [charge node] {$#2$}
(n.west) +(1.5mm,0) node [charge node] {$#3$}
(n.east) +(-1.5mm,0) node [charge node] {$#4$}
;
draw
(n.north west) -- (n.south east)
(n.south west) -- (n.north east)
;
}
}
}
begin{tikzpicture}
path pic at (10mm,0) {sum block={+}{-}{+}{-}}
pic at (20mm,0) {sum block={}{+}{-}{}}
;
end{tikzpicture}
end{document}
It is possible to also append the lines in your second variant. And thanks to @marmot, it is possible to do so without paying further attention:
documentclass{standalone}
usepackage{tikz}
tikzset
{
port/.style = {inner sep=0pt, font=tiny},
cross/.style =
{%
path picture=%
{
draw
(path picture bounding box.north west) --
(path picture bounding box.south east)
(path picture bounding box.south west) --
(path picture bounding box.north east)
;
}
},
sum/.style n args = {4}%
{%
draw, circle, node distance = 2cm, minimum size=5mm, cross, alias=sum,%https://tex.stackexchange.com/a/234545/2288
append after command=%
{%
node at (sum.north) [port, below=1pt] {$#1$}
node at (sum.west) [port, right=1pt] {$#2$}
node at (sum.south) [port, above=1pt] {$#3$}
node at (sum.east) [port, left=1pt] {$#4$}
},
},
}
begin{document}
begin{tikzpicture}
node [sum={}{+}{-}{}] (b) {};
end{tikzpicture}
end{document}
edited 16 hours ago
answered 2 days ago
Skillmon
20.1k11840
20.1k11840
Exactly. May I know how can I draw the two diameters in the second case that I appended to my question?
– Diaa
2 days ago
Off-topic question: is it possible to declare multiple nodes using one single commandnode
?
– Diaa
19 hours ago
@Diaanode
is the same aspath node
so you can specify further nodes usingnode (a) {a} node (b) {b} ...
.
– Skillmon
16 hours ago
add a comment |
Exactly. May I know how can I draw the two diameters in the second case that I appended to my question?
– Diaa
2 days ago
Off-topic question: is it possible to declare multiple nodes using one single commandnode
?
– Diaa
19 hours ago
@Diaanode
is the same aspath node
so you can specify further nodes usingnode (a) {a} node (b) {b} ...
.
– Skillmon
16 hours ago
Exactly. May I know how can I draw the two diameters in the second case that I appended to my question?
– Diaa
2 days ago
Exactly. May I know how can I draw the two diameters in the second case that I appended to my question?
– Diaa
2 days ago
Off-topic question: is it possible to declare multiple nodes using one single command
node
?– Diaa
19 hours ago
Off-topic question: is it possible to declare multiple nodes using one single command
node
?– Diaa
19 hours ago
@Diaa
node
is the same as path node
so you can specify further nodes using node (a) {a} node (b) {b} ...
.– Skillmon
16 hours ago
@Diaa
node
is the same as path node
so you can specify further nodes using node (a) {a} node (b) {b} ...
.– Skillmon
16 hours ago
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f460260%2ftikz-summation-circle-with-four-ports-separated-by-two-prependicular-diameters%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can you also provide a complete MWE for your second variant?
– Skillmon
2 days ago
@Skillmon I apologize. I updated my question.
– Diaa
2 days ago