Different sized loops in tikzcd matrix
up vote
4
down vote
favorite
I have a matrix of numbers with arrows and loops. The trouble i'm having is some loops are of different sizes depending on which way the loop is oriented. Loops are defined with 60 degrees difference between the in and out position (with midpoint of the loop corresponding to 0,90,180,270).
In the image included, the loop size differences can be seen from those in the middle column where loops above the matrix element are larger than the loops below the matrix element. Also the loops of corner elements are smaller than those of the side elements.
Can anyone point out what I'm doing wrong, or how to make the loops look the same size but `rotated'? MWE and its output given below.
documentclass[tikz]standalone
usepackagetikz-cd
usetikzlibraryfit,backgrounds
begindocument
newcommandaUarrow[bend left]u
newcommandaDarrow[bend left]d
newcommandaLarrowl
newcommandaRarrowr
newcommandaS[2]arrow[loop, out=#1, in=#2,looseness=4]
newcommandaSc[1]arrow[loop, out=#1+30, in=#1-30,looseness=4]%Self, clockwise
newcommandaSa[1]arrow[loop, out=#1-30, in=#1+30,looseness=4]%Self, anti-clockwise
begintikzcd[nodes=inner sep=1pt,minimum size=3ex,cramped,column sep=scriptsize, row sep=scriptsize,
every matrix/.append style=name=m,execute at end picture=
beginscope[on background layer]
node[rounded corners,fill=black!10,minimum width=1cm, fit=(m-1-2) (m-4-2)](c1) ;
endscope;
]
2aDaSc135 & 1aLaSc90 & 0aLaDaSc45 \
6aUaDaSa180 & 5aLaSc90 & 4aLaUaDaSc0 \
10aUaDaSc180 & 9aLaSa270 & 8aLaUaDaSc0 \
14aUaSc225 & 13aLaSa270 & 12aLaUaSc315
endtikzcd
enddocument
tikz-cd
add a comment |
up vote
4
down vote
favorite
I have a matrix of numbers with arrows and loops. The trouble i'm having is some loops are of different sizes depending on which way the loop is oriented. Loops are defined with 60 degrees difference between the in and out position (with midpoint of the loop corresponding to 0,90,180,270).
In the image included, the loop size differences can be seen from those in the middle column where loops above the matrix element are larger than the loops below the matrix element. Also the loops of corner elements are smaller than those of the side elements.
Can anyone point out what I'm doing wrong, or how to make the loops look the same size but `rotated'? MWE and its output given below.
documentclass[tikz]standalone
usepackagetikz-cd
usetikzlibraryfit,backgrounds
begindocument
newcommandaUarrow[bend left]u
newcommandaDarrow[bend left]d
newcommandaLarrowl
newcommandaRarrowr
newcommandaS[2]arrow[loop, out=#1, in=#2,looseness=4]
newcommandaSc[1]arrow[loop, out=#1+30, in=#1-30,looseness=4]%Self, clockwise
newcommandaSa[1]arrow[loop, out=#1-30, in=#1+30,looseness=4]%Self, anti-clockwise
begintikzcd[nodes=inner sep=1pt,minimum size=3ex,cramped,column sep=scriptsize, row sep=scriptsize,
every matrix/.append style=name=m,execute at end picture=
beginscope[on background layer]
node[rounded corners,fill=black!10,minimum width=1cm, fit=(m-1-2) (m-4-2)](c1) ;
endscope;
]
2aDaSc135 & 1aLaSc90 & 0aLaDaSc45 \
6aUaDaSa180 & 5aLaSc90 & 4aLaUaDaSc0 \
10aUaDaSc180 & 9aLaSa270 & 8aLaUaDaSc0 \
14aUaSc225 & 13aLaSa270 & 12aLaUaSc315
endtikzcd
enddocument
tikz-cd
add a comment |
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I have a matrix of numbers with arrows and loops. The trouble i'm having is some loops are of different sizes depending on which way the loop is oriented. Loops are defined with 60 degrees difference between the in and out position (with midpoint of the loop corresponding to 0,90,180,270).
In the image included, the loop size differences can be seen from those in the middle column where loops above the matrix element are larger than the loops below the matrix element. Also the loops of corner elements are smaller than those of the side elements.
Can anyone point out what I'm doing wrong, or how to make the loops look the same size but `rotated'? MWE and its output given below.
documentclass[tikz]standalone
usepackagetikz-cd
usetikzlibraryfit,backgrounds
begindocument
newcommandaUarrow[bend left]u
newcommandaDarrow[bend left]d
newcommandaLarrowl
newcommandaRarrowr
newcommandaS[2]arrow[loop, out=#1, in=#2,looseness=4]
newcommandaSc[1]arrow[loop, out=#1+30, in=#1-30,looseness=4]%Self, clockwise
newcommandaSa[1]arrow[loop, out=#1-30, in=#1+30,looseness=4]%Self, anti-clockwise
begintikzcd[nodes=inner sep=1pt,minimum size=3ex,cramped,column sep=scriptsize, row sep=scriptsize,
every matrix/.append style=name=m,execute at end picture=
beginscope[on background layer]
node[rounded corners,fill=black!10,minimum width=1cm, fit=(m-1-2) (m-4-2)](c1) ;
endscope;
]
2aDaSc135 & 1aLaSc90 & 0aLaDaSc45 \
6aUaDaSa180 & 5aLaSc90 & 4aLaUaDaSc0 \
10aUaDaSc180 & 9aLaSa270 & 8aLaUaDaSc0 \
14aUaSc225 & 13aLaSa270 & 12aLaUaSc315
endtikzcd
enddocument
tikz-cd
I have a matrix of numbers with arrows and loops. The trouble i'm having is some loops are of different sizes depending on which way the loop is oriented. Loops are defined with 60 degrees difference between the in and out position (with midpoint of the loop corresponding to 0,90,180,270).
In the image included, the loop size differences can be seen from those in the middle column where loops above the matrix element are larger than the loops below the matrix element. Also the loops of corner elements are smaller than those of the side elements.
Can anyone point out what I'm doing wrong, or how to make the loops look the same size but `rotated'? MWE and its output given below.
documentclass[tikz]standalone
usepackagetikz-cd
usetikzlibraryfit,backgrounds
begindocument
newcommandaUarrow[bend left]u
newcommandaDarrow[bend left]d
newcommandaLarrowl
newcommandaRarrowr
newcommandaS[2]arrow[loop, out=#1, in=#2,looseness=4]
newcommandaSc[1]arrow[loop, out=#1+30, in=#1-30,looseness=4]%Self, clockwise
newcommandaSa[1]arrow[loop, out=#1-30, in=#1+30,looseness=4]%Self, anti-clockwise
begintikzcd[nodes=inner sep=1pt,minimum size=3ex,cramped,column sep=scriptsize, row sep=scriptsize,
every matrix/.append style=name=m,execute at end picture=
beginscope[on background layer]
node[rounded corners,fill=black!10,minimum width=1cm, fit=(m-1-2) (m-4-2)](c1) ;
endscope;
]
2aDaSc135 & 1aLaSc90 & 0aLaDaSc45 \
6aUaDaSa180 & 5aLaSc90 & 4aLaUaDaSc0 \
10aUaDaSc180 & 9aLaSa270 & 8aLaUaDaSc0 \
14aUaSc225 & 13aLaSa270 & 12aLaUaSc315
endtikzcd
enddocument
tikz-cd
tikz-cd
edited Nov 8 at 7:34
asked Nov 8 at 7:18
Dunk the Lunk
38529
38529
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
5
down vote
accepted
It looks like the center of the nodes isn't positioned at the center of the numbers themselves. And the loops are constructed around the centers of the nodes. Also, the rectangular node shape
doesn't help in making loops equal. As a workaround you could use the circle
node shape (notice that I had to increase the minimum node size to 3.5ex as well to get all circles equal):
usepackagetikz-cd
usetikzlibraryfit,backgrounds
begindocument
newcommandaUarrow[bend left]u
newcommandaDarrow[bend left]d
newcommandaLarrowl
newcommandaRarrowr
newcommandaS[2]arrow[loop, out=#1, in=#2,looseness=4]
newcommandaSc[1]arrow[loop, out=#1+30, in=#1-30,looseness=4]%Self, clockwise
newcommandaSa[1]arrow[loop, out=#1-30, in=#1+30,looseness=4]%Self, anti-clockwise
begintikzcd[nodes=inner sep=1pt,minimum size=3.5ex,circle,cramped,column sep=scriptsize, row sep=scriptsize,
every matrix/.append style=name=m,execute at end picture=
beginscope[on background layer]
node[rectangle,rounded corners,fill=black!10,minimum width=1cm, fit=(m-1-2) (m-4-2)](c1) ;
endscope;
]
2aDaSc135 & 1aLaSc90 & 0aLaDaSc45 \
6aUaDaSa180 & 5aLaSc90 & 4aLaUaDaSc0 \
10aUaDaSc180 & 9aLaSa270 & 8aLaUaDaSc0 \
14aUaSc225 & 13aLaSa270 & 12aLaUaSc315
endtikzcd
enddocument
The result:
Thanks for your help. I will use your solution.
– Dunk the Lunk
Nov 8 at 10:50
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
It looks like the center of the nodes isn't positioned at the center of the numbers themselves. And the loops are constructed around the centers of the nodes. Also, the rectangular node shape
doesn't help in making loops equal. As a workaround you could use the circle
node shape (notice that I had to increase the minimum node size to 3.5ex as well to get all circles equal):
usepackagetikz-cd
usetikzlibraryfit,backgrounds
begindocument
newcommandaUarrow[bend left]u
newcommandaDarrow[bend left]d
newcommandaLarrowl
newcommandaRarrowr
newcommandaS[2]arrow[loop, out=#1, in=#2,looseness=4]
newcommandaSc[1]arrow[loop, out=#1+30, in=#1-30,looseness=4]%Self, clockwise
newcommandaSa[1]arrow[loop, out=#1-30, in=#1+30,looseness=4]%Self, anti-clockwise
begintikzcd[nodes=inner sep=1pt,minimum size=3.5ex,circle,cramped,column sep=scriptsize, row sep=scriptsize,
every matrix/.append style=name=m,execute at end picture=
beginscope[on background layer]
node[rectangle,rounded corners,fill=black!10,minimum width=1cm, fit=(m-1-2) (m-4-2)](c1) ;
endscope;
]
2aDaSc135 & 1aLaSc90 & 0aLaDaSc45 \
6aUaDaSa180 & 5aLaSc90 & 4aLaUaDaSc0 \
10aUaDaSc180 & 9aLaSa270 & 8aLaUaDaSc0 \
14aUaSc225 & 13aLaSa270 & 12aLaUaSc315
endtikzcd
enddocument
The result:
Thanks for your help. I will use your solution.
– Dunk the Lunk
Nov 8 at 10:50
add a comment |
up vote
5
down vote
accepted
It looks like the center of the nodes isn't positioned at the center of the numbers themselves. And the loops are constructed around the centers of the nodes. Also, the rectangular node shape
doesn't help in making loops equal. As a workaround you could use the circle
node shape (notice that I had to increase the minimum node size to 3.5ex as well to get all circles equal):
usepackagetikz-cd
usetikzlibraryfit,backgrounds
begindocument
newcommandaUarrow[bend left]u
newcommandaDarrow[bend left]d
newcommandaLarrowl
newcommandaRarrowr
newcommandaS[2]arrow[loop, out=#1, in=#2,looseness=4]
newcommandaSc[1]arrow[loop, out=#1+30, in=#1-30,looseness=4]%Self, clockwise
newcommandaSa[1]arrow[loop, out=#1-30, in=#1+30,looseness=4]%Self, anti-clockwise
begintikzcd[nodes=inner sep=1pt,minimum size=3.5ex,circle,cramped,column sep=scriptsize, row sep=scriptsize,
every matrix/.append style=name=m,execute at end picture=
beginscope[on background layer]
node[rectangle,rounded corners,fill=black!10,minimum width=1cm, fit=(m-1-2) (m-4-2)](c1) ;
endscope;
]
2aDaSc135 & 1aLaSc90 & 0aLaDaSc45 \
6aUaDaSa180 & 5aLaSc90 & 4aLaUaDaSc0 \
10aUaDaSc180 & 9aLaSa270 & 8aLaUaDaSc0 \
14aUaSc225 & 13aLaSa270 & 12aLaUaSc315
endtikzcd
enddocument
The result:
Thanks for your help. I will use your solution.
– Dunk the Lunk
Nov 8 at 10:50
add a comment |
up vote
5
down vote
accepted
up vote
5
down vote
accepted
It looks like the center of the nodes isn't positioned at the center of the numbers themselves. And the loops are constructed around the centers of the nodes. Also, the rectangular node shape
doesn't help in making loops equal. As a workaround you could use the circle
node shape (notice that I had to increase the minimum node size to 3.5ex as well to get all circles equal):
usepackagetikz-cd
usetikzlibraryfit,backgrounds
begindocument
newcommandaUarrow[bend left]u
newcommandaDarrow[bend left]d
newcommandaLarrowl
newcommandaRarrowr
newcommandaS[2]arrow[loop, out=#1, in=#2,looseness=4]
newcommandaSc[1]arrow[loop, out=#1+30, in=#1-30,looseness=4]%Self, clockwise
newcommandaSa[1]arrow[loop, out=#1-30, in=#1+30,looseness=4]%Self, anti-clockwise
begintikzcd[nodes=inner sep=1pt,minimum size=3.5ex,circle,cramped,column sep=scriptsize, row sep=scriptsize,
every matrix/.append style=name=m,execute at end picture=
beginscope[on background layer]
node[rectangle,rounded corners,fill=black!10,minimum width=1cm, fit=(m-1-2) (m-4-2)](c1) ;
endscope;
]
2aDaSc135 & 1aLaSc90 & 0aLaDaSc45 \
6aUaDaSa180 & 5aLaSc90 & 4aLaUaDaSc0 \
10aUaDaSc180 & 9aLaSa270 & 8aLaUaDaSc0 \
14aUaSc225 & 13aLaSa270 & 12aLaUaSc315
endtikzcd
enddocument
The result:
It looks like the center of the nodes isn't positioned at the center of the numbers themselves. And the loops are constructed around the centers of the nodes. Also, the rectangular node shape
doesn't help in making loops equal. As a workaround you could use the circle
node shape (notice that I had to increase the minimum node size to 3.5ex as well to get all circles equal):
usepackagetikz-cd
usetikzlibraryfit,backgrounds
begindocument
newcommandaUarrow[bend left]u
newcommandaDarrow[bend left]d
newcommandaLarrowl
newcommandaRarrowr
newcommandaS[2]arrow[loop, out=#1, in=#2,looseness=4]
newcommandaSc[1]arrow[loop, out=#1+30, in=#1-30,looseness=4]%Self, clockwise
newcommandaSa[1]arrow[loop, out=#1-30, in=#1+30,looseness=4]%Self, anti-clockwise
begintikzcd[nodes=inner sep=1pt,minimum size=3.5ex,circle,cramped,column sep=scriptsize, row sep=scriptsize,
every matrix/.append style=name=m,execute at end picture=
beginscope[on background layer]
node[rectangle,rounded corners,fill=black!10,minimum width=1cm, fit=(m-1-2) (m-4-2)](c1) ;
endscope;
]
2aDaSc135 & 1aLaSc90 & 0aLaDaSc45 \
6aUaDaSa180 & 5aLaSc90 & 4aLaUaDaSc0 \
10aUaDaSc180 & 9aLaSa270 & 8aLaUaDaSc0 \
14aUaSc225 & 13aLaSa270 & 12aLaUaSc315
endtikzcd
enddocument
The result:
answered Nov 8 at 9:18
Sergei Golovan
3,8851413
3,8851413
Thanks for your help. I will use your solution.
– Dunk the Lunk
Nov 8 at 10:50
add a comment |
Thanks for your help. I will use your solution.
– Dunk the Lunk
Nov 8 at 10:50
Thanks for your help. I will use your solution.
– Dunk the Lunk
Nov 8 at 10:50
Thanks for your help. I will use your solution.
– Dunk the Lunk
Nov 8 at 10:50
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f458921%2fdifferent-sized-loops-in-tikzcd-matrix%23new-answer', 'question_page');
);
Post as a guest
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
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
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