`fit` does not respect relative positioning
Clash Royale CLAN TAG#URR8PPP
up vote
4
down vote
favorite
documentclassarticle
usepackagetikz
usetikzlibrarypositioning,fit
begindocument
begintikzpicture
node[name=a] longa;
node[name=b, below=of a] longb;
node[name=c, below=of b] longc;
node[name=talld, right=of c, fit=(a)(c), draw] talld;
endtikzpicture
enddocument
Now talld
overlaps the leftmost text. If I remove the fit=(a)(c)
it shifts talld
appropriately. How do I make fit
respect relative positioning?
tikz-pgf
add a comment |Â
up vote
4
down vote
favorite
documentclassarticle
usepackagetikz
usetikzlibrarypositioning,fit
begindocument
begintikzpicture
node[name=a] longa;
node[name=b, below=of a] longb;
node[name=c, below=of b] longc;
node[name=talld, right=of c, fit=(a)(c), draw] talld;
endtikzpicture
enddocument
Now talld
overlaps the leftmost text. If I remove the fit=(a)(c)
it shifts talld
appropriately. How do I make fit
respect relative positioning?
tikz-pgf
add a comment |Â
up vote
4
down vote
favorite
up vote
4
down vote
favorite
documentclassarticle
usepackagetikz
usetikzlibrarypositioning,fit
begindocument
begintikzpicture
node[name=a] longa;
node[name=b, below=of a] longb;
node[name=c, below=of b] longc;
node[name=talld, right=of c, fit=(a)(c), draw] talld;
endtikzpicture
enddocument
Now talld
overlaps the leftmost text. If I remove the fit=(a)(c)
it shifts talld
appropriately. How do I make fit
respect relative positioning?
tikz-pgf
documentclassarticle
usepackagetikz
usetikzlibrarypositioning,fit
begindocument
begintikzpicture
node[name=a] longa;
node[name=b, below=of a] longb;
node[name=c, below=of b] longc;
node[name=talld, right=of c, fit=(a)(c), draw] talld;
endtikzpicture
enddocument
Now talld
overlaps the leftmost text. If I remove the fit=(a)(c)
it shifts talld
appropriately. How do I make fit
respect relative positioning?
tikz-pgf
asked Aug 6 at 8:30
enthdegree
307212
307212
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
7
down vote
accepted
Edit: Added manual text alignment adjustment
You say that the code that correctly places the nodes produces this:
But you want the right node to be as big as the other three combined.
Since tikz processes instructions in the order they are read, simply reverse the instructions you have written by first fiting the node around the other three:
write fit=(a)(c), right=of c,
instead of right=of c, fit=(a)(c)
As longb
is in the center, just place it on this right: fit=(a)(c), right=of b
documentclassarticle
usepackagetikz
usetikzlibrarypositioning,fit
begindocument
begintikzpicture
node[name=a,draw] longa;
node[name=b,draw, below=of a] longb;
node[name=c,draw, below=of b] longc;
node[name=talld, fit=(a)(c), right=of b,draw,text height=55pt,inner sep=0pt,outer sep=0pt] talgd;
endtikzpicture
enddocument
I've traced every node to make sure everything is done the way you want it.
Thank you, this works and makes sense except nowtalld
's text isn't centered in its rectangle!
– enthdegree
Aug 6 at 18:21
Indeed, I had not paid attention to it. You can manually adjust the text. i edited the solution.
– AndréC
Aug 6 at 20:21
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
7
down vote
accepted
Edit: Added manual text alignment adjustment
You say that the code that correctly places the nodes produces this:
But you want the right node to be as big as the other three combined.
Since tikz processes instructions in the order they are read, simply reverse the instructions you have written by first fiting the node around the other three:
write fit=(a)(c), right=of c,
instead of right=of c, fit=(a)(c)
As longb
is in the center, just place it on this right: fit=(a)(c), right=of b
documentclassarticle
usepackagetikz
usetikzlibrarypositioning,fit
begindocument
begintikzpicture
node[name=a,draw] longa;
node[name=b,draw, below=of a] longb;
node[name=c,draw, below=of b] longc;
node[name=talld, fit=(a)(c), right=of b,draw,text height=55pt,inner sep=0pt,outer sep=0pt] talgd;
endtikzpicture
enddocument
I've traced every node to make sure everything is done the way you want it.
Thank you, this works and makes sense except nowtalld
's text isn't centered in its rectangle!
– enthdegree
Aug 6 at 18:21
Indeed, I had not paid attention to it. You can manually adjust the text. i edited the solution.
– AndréC
Aug 6 at 20:21
add a comment |Â
up vote
7
down vote
accepted
Edit: Added manual text alignment adjustment
You say that the code that correctly places the nodes produces this:
But you want the right node to be as big as the other three combined.
Since tikz processes instructions in the order they are read, simply reverse the instructions you have written by first fiting the node around the other three:
write fit=(a)(c), right=of c,
instead of right=of c, fit=(a)(c)
As longb
is in the center, just place it on this right: fit=(a)(c), right=of b
documentclassarticle
usepackagetikz
usetikzlibrarypositioning,fit
begindocument
begintikzpicture
node[name=a,draw] longa;
node[name=b,draw, below=of a] longb;
node[name=c,draw, below=of b] longc;
node[name=talld, fit=(a)(c), right=of b,draw,text height=55pt,inner sep=0pt,outer sep=0pt] talgd;
endtikzpicture
enddocument
I've traced every node to make sure everything is done the way you want it.
Thank you, this works and makes sense except nowtalld
's text isn't centered in its rectangle!
– enthdegree
Aug 6 at 18:21
Indeed, I had not paid attention to it. You can manually adjust the text. i edited the solution.
– AndréC
Aug 6 at 20:21
add a comment |Â
up vote
7
down vote
accepted
up vote
7
down vote
accepted
Edit: Added manual text alignment adjustment
You say that the code that correctly places the nodes produces this:
But you want the right node to be as big as the other three combined.
Since tikz processes instructions in the order they are read, simply reverse the instructions you have written by first fiting the node around the other three:
write fit=(a)(c), right=of c,
instead of right=of c, fit=(a)(c)
As longb
is in the center, just place it on this right: fit=(a)(c), right=of b
documentclassarticle
usepackagetikz
usetikzlibrarypositioning,fit
begindocument
begintikzpicture
node[name=a,draw] longa;
node[name=b,draw, below=of a] longb;
node[name=c,draw, below=of b] longc;
node[name=talld, fit=(a)(c), right=of b,draw,text height=55pt,inner sep=0pt,outer sep=0pt] talgd;
endtikzpicture
enddocument
I've traced every node to make sure everything is done the way you want it.
Edit: Added manual text alignment adjustment
You say that the code that correctly places the nodes produces this:
But you want the right node to be as big as the other three combined.
Since tikz processes instructions in the order they are read, simply reverse the instructions you have written by first fiting the node around the other three:
write fit=(a)(c), right=of c,
instead of right=of c, fit=(a)(c)
As longb
is in the center, just place it on this right: fit=(a)(c), right=of b
documentclassarticle
usepackagetikz
usetikzlibrarypositioning,fit
begindocument
begintikzpicture
node[name=a,draw] longa;
node[name=b,draw, below=of a] longb;
node[name=c,draw, below=of b] longc;
node[name=talld, fit=(a)(c), right=of b,draw,text height=55pt,inner sep=0pt,outer sep=0pt] talgd;
endtikzpicture
enddocument
I've traced every node to make sure everything is done the way you want it.
edited Aug 6 at 20:19
answered Aug 6 at 9:30
AndréC
2,233726
2,233726
Thank you, this works and makes sense except nowtalld
's text isn't centered in its rectangle!
– enthdegree
Aug 6 at 18:21
Indeed, I had not paid attention to it. You can manually adjust the text. i edited the solution.
– AndréC
Aug 6 at 20:21
add a comment |Â
Thank you, this works and makes sense except nowtalld
's text isn't centered in its rectangle!
– enthdegree
Aug 6 at 18:21
Indeed, I had not paid attention to it. You can manually adjust the text. i edited the solution.
– AndréC
Aug 6 at 20:21
Thank you, this works and makes sense except now
talld
's text isn't centered in its rectangle!– enthdegree
Aug 6 at 18:21
Thank you, this works and makes sense except now
talld
's text isn't centered in its rectangle!– enthdegree
Aug 6 at 18:21
Indeed, I had not paid attention to it. You can manually adjust the text. i edited the solution.
– AndréC
Aug 6 at 20:21
Indeed, I had not paid attention to it. You can manually adjust the text. i edited the solution.
– AndréC
Aug 6 at 20:21
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%2f444801%2ffit-does-not-respect-relative-positioning%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