Change background of rectangle without inner elements
Clash Royale CLAN TAG#URR8PPP
up vote
3
down vote
favorite
I have concatenated rectangles like so:
usetikzlibraryfit, positioning
begintikzpicture
node [rectangle, draw, text width=4em, fill=white] (b) B;
node [rectangle, draw, text width=4em, right=of b, fill=white] (a) A;
node [rectangle, draw, fit=(b) (a), fill=orange, fill opacity=0.1] (local) ;
endtikzpicture
The result of the above is this:
My problem is that I do not want inner boxes A & B to have the orange background (i.e. they should not be coloured..). How can I fix this please? (still new to Tikz!)
tikz-pgf
add a comment |Â
up vote
3
down vote
favorite
I have concatenated rectangles like so:
usetikzlibraryfit, positioning
begintikzpicture
node [rectangle, draw, text width=4em, fill=white] (b) B;
node [rectangle, draw, text width=4em, right=of b, fill=white] (a) A;
node [rectangle, draw, fit=(b) (a), fill=orange, fill opacity=0.1] (local) ;
endtikzpicture
The result of the above is this:
My problem is that I do not want inner boxes A & B to have the orange background (i.e. they should not be coloured..). How can I fix this please? (still new to Tikz!)
tikz-pgf
Welcome to TeX.SE! Does addingfill=white
to the inner nodes do what you want?node [rectangle, draw,text width=4em,fill=white] (b) B;
and then fill the big node on the background layer.
â marmot
Sep 3 at 17:32
Thank you, no it does not work. I think because the last fill is overriding previous ones.. I have updated my code above to reflect this..
â ojenn
Sep 3 at 17:34
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I have concatenated rectangles like so:
usetikzlibraryfit, positioning
begintikzpicture
node [rectangle, draw, text width=4em, fill=white] (b) B;
node [rectangle, draw, text width=4em, right=of b, fill=white] (a) A;
node [rectangle, draw, fit=(b) (a), fill=orange, fill opacity=0.1] (local) ;
endtikzpicture
The result of the above is this:
My problem is that I do not want inner boxes A & B to have the orange background (i.e. they should not be coloured..). How can I fix this please? (still new to Tikz!)
tikz-pgf
I have concatenated rectangles like so:
usetikzlibraryfit, positioning
begintikzpicture
node [rectangle, draw, text width=4em, fill=white] (b) B;
node [rectangle, draw, text width=4em, right=of b, fill=white] (a) A;
node [rectangle, draw, fit=(b) (a), fill=orange, fill opacity=0.1] (local) ;
endtikzpicture
The result of the above is this:
My problem is that I do not want inner boxes A & B to have the orange background (i.e. they should not be coloured..). How can I fix this please? (still new to Tikz!)
tikz-pgf
edited Sep 3 at 17:36
asked Sep 3 at 17:27
ojenn
474
474
Welcome to TeX.SE! Does addingfill=white
to the inner nodes do what you want?node [rectangle, draw,text width=4em,fill=white] (b) B;
and then fill the big node on the background layer.
â marmot
Sep 3 at 17:32
Thank you, no it does not work. I think because the last fill is overriding previous ones.. I have updated my code above to reflect this..
â ojenn
Sep 3 at 17:34
add a comment |Â
Welcome to TeX.SE! Does addingfill=white
to the inner nodes do what you want?node [rectangle, draw,text width=4em,fill=white] (b) B;
and then fill the big node on the background layer.
â marmot
Sep 3 at 17:32
Thank you, no it does not work. I think because the last fill is overriding previous ones.. I have updated my code above to reflect this..
â ojenn
Sep 3 at 17:34
Welcome to TeX.SE! Does adding
fill=white
to the inner nodes do what you want? node [rectangle, draw,text width=4em,fill=white] (b) B;
and then fill the big node on the background layer.â marmot
Sep 3 at 17:32
Welcome to TeX.SE! Does adding
fill=white
to the inner nodes do what you want? node [rectangle, draw,text width=4em,fill=white] (b) B;
and then fill the big node on the background layer.â marmot
Sep 3 at 17:32
Thank you, no it does not work. I think because the last fill is overriding previous ones.. I have updated my code above to reflect this..
â ojenn
Sep 3 at 17:34
Thank you, no it does not work. I think because the last fill is overriding previous ones.. I have updated my code above to reflect this..
â ojenn
Sep 3 at 17:34
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
3
down vote
accepted
Too long for a comment.
documentclass[tikz,border=3.14mm]standalone
begindocument
usetikzlibraryfit, positioning,backgrounds
begintikzpicture
node [rectangle, draw,text width=4em,fill=white] (b) B;
node [rectangle, draw,text width=4em, right=of b,fill=white] (a) A;
beginscope[on background layer]
node [rectangle, draw, fit=(b) (a),fill=orange,fill opacity=0.1] (local) ;
endscope
endtikzpicture
enddocument
Thanks so much it works now!
â ojenn
Sep 3 at 17:39
3
Of course. It was just asking me to wait..
â ojenn
Sep 3 at 17:54
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
accepted
Too long for a comment.
documentclass[tikz,border=3.14mm]standalone
begindocument
usetikzlibraryfit, positioning,backgrounds
begintikzpicture
node [rectangle, draw,text width=4em,fill=white] (b) B;
node [rectangle, draw,text width=4em, right=of b,fill=white] (a) A;
beginscope[on background layer]
node [rectangle, draw, fit=(b) (a),fill=orange,fill opacity=0.1] (local) ;
endscope
endtikzpicture
enddocument
Thanks so much it works now!
â ojenn
Sep 3 at 17:39
3
Of course. It was just asking me to wait..
â ojenn
Sep 3 at 17:54
add a comment |Â
up vote
3
down vote
accepted
Too long for a comment.
documentclass[tikz,border=3.14mm]standalone
begindocument
usetikzlibraryfit, positioning,backgrounds
begintikzpicture
node [rectangle, draw,text width=4em,fill=white] (b) B;
node [rectangle, draw,text width=4em, right=of b,fill=white] (a) A;
beginscope[on background layer]
node [rectangle, draw, fit=(b) (a),fill=orange,fill opacity=0.1] (local) ;
endscope
endtikzpicture
enddocument
Thanks so much it works now!
â ojenn
Sep 3 at 17:39
3
Of course. It was just asking me to wait..
â ojenn
Sep 3 at 17:54
add a comment |Â
up vote
3
down vote
accepted
up vote
3
down vote
accepted
Too long for a comment.
documentclass[tikz,border=3.14mm]standalone
begindocument
usetikzlibraryfit, positioning,backgrounds
begintikzpicture
node [rectangle, draw,text width=4em,fill=white] (b) B;
node [rectangle, draw,text width=4em, right=of b,fill=white] (a) A;
beginscope[on background layer]
node [rectangle, draw, fit=(b) (a),fill=orange,fill opacity=0.1] (local) ;
endscope
endtikzpicture
enddocument
Too long for a comment.
documentclass[tikz,border=3.14mm]standalone
begindocument
usetikzlibraryfit, positioning,backgrounds
begintikzpicture
node [rectangle, draw,text width=4em,fill=white] (b) B;
node [rectangle, draw,text width=4em, right=of b,fill=white] (a) A;
beginscope[on background layer]
node [rectangle, draw, fit=(b) (a),fill=orange,fill opacity=0.1] (local) ;
endscope
endtikzpicture
enddocument
answered Sep 3 at 17:35
marmot
56.2k461123
56.2k461123
Thanks so much it works now!
â ojenn
Sep 3 at 17:39
3
Of course. It was just asking me to wait..
â ojenn
Sep 3 at 17:54
add a comment |Â
Thanks so much it works now!
â ojenn
Sep 3 at 17:39
3
Of course. It was just asking me to wait..
â ojenn
Sep 3 at 17:54
Thanks so much it works now!
â ojenn
Sep 3 at 17:39
Thanks so much it works now!
â ojenn
Sep 3 at 17:39
3
3
Of course. It was just asking me to wait..
â ojenn
Sep 3 at 17:54
Of course. It was just asking me to wait..
â ojenn
Sep 3 at 17:54
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%2f449151%2fchange-background-of-rectangle-without-inner-elements%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
Welcome to TeX.SE! Does adding
fill=white
to the inner nodes do what you want?node [rectangle, draw,text width=4em,fill=white] (b) B;
and then fill the big node on the background layer.â marmot
Sep 3 at 17:32
Thank you, no it does not work. I think because the last fill is overriding previous ones.. I have updated my code above to reflect this..
â ojenn
Sep 3 at 17:34