How to get horizonzal alignment right for nested rectangles? The Next CEO of Stack OverflowHow...
What flight has the highest ratio of timezone difference to flight time?
Players Circumventing the limitations of Wish
How can the PCs determine if an item is a phylactery?
Is it ok to trim down a tube patch?
Is there a difference between "Fahrstuhl" and "Aufzug"?
Film where the government was corrupt with aliens, people sent to kill aliens are given rigged visors not showing the right aliens
Is Nisuin Biblical or Rabbinic?
Can we install two versions of Java JDK in windows
Is fine stranded wire ok for main supply line?
Reshaping json / reparing json inside shell script (remove trailing comma)
Audio Conversion With ADS1243
Calculate the Mean mean of two numbers
Is it OK to decorate a log book cover?
Ising model simulation
(How) Could a medieval fantasy world survive a magic-induced "nuclear winter"?
What is the process for purifying your home if you believe it may have been previously used for pagan worship?
Vector calculus integration identity problem
Is there an equivalent of cd - for cp or mv
Is it convenient to ask the journal's editor for two additional days to complete a review?
Is it professional to write unrelated content in an almost-empty email?
From jafe to El-Guest
How to Implement Deterministic Encryption Safely in .NET
The Ultimate Number Sequence Puzzle
Can Sneak Attack be used when hitting with an improvised weapon?
How to get horizonzal alignment right for nested rectangles?
The Next CEO of Stack OverflowHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeTikZ/ERD: node (=Entity) label on the insideNested rectangles with different widthsuse circuitikz picture inside tikzpictureprint double sided playing cardsLine up nested tikz enviroments or how to get rid of themRight options to draw a matrix of rectanglesProblems with nested TikZpicturesTikz: Nested Boxes Alignment
I know that nesting tikz pictures is considered bad, but I did it anyway as I don't want to mess around with manual positioning. I'm nesting several rectangles similar to another question for circles. The problem is that the rectangles aren't centered correctly, which can be seen at the left and right stacking vertical lines.
Is this a problem caused by nesting or am I doing something different wrong?
documentclass{article}
usepackage{tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
class/.style={
draw,
align=center,
rectangle,
rounded corners=20pt,
minimum size=0pt,
inner sep=5pt,
outer sep=0pt,
},
label/.style={
rectangle,
align=center,
inner sep=6pt,
outer sep=4pt, % shifts labels a bit down
node distance=0pt,
},
]
node [class] (csl) {
begin{tikzpicture}
node [class] (ptime) {
begin{tikzpicture}
node [class] (mcfl) {
begin{tikzpicture}
node [class] (rpl) {
begin{tikzpicture}
node [class] (tal) {
begin{tikzpicture}
node [class,rounded corners=5pt] (cfl) {CFG};
node [label, below=of cfl] {TAG, LIG, CCG, HG };
end{tikzpicture}
};
node [label, below=of tal] {RPG, (2,2)-MCFG};
end{tikzpicture}
};
node [label, below=of rpl] {MCFG, LCFRS};
end{tikzpicture}
};
node [label, below=of mcfl] {RCG, simple LMG \ (= PTIME)};
end{tikzpicture}
};
node [label, below=of ptime] {CSG};
end{tikzpicture}
};
end{tikzpicture}
end{document}
tikz-pgf
add a comment |
I know that nesting tikz pictures is considered bad, but I did it anyway as I don't want to mess around with manual positioning. I'm nesting several rectangles similar to another question for circles. The problem is that the rectangles aren't centered correctly, which can be seen at the left and right stacking vertical lines.
Is this a problem caused by nesting or am I doing something different wrong?
documentclass{article}
usepackage{tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
class/.style={
draw,
align=center,
rectangle,
rounded corners=20pt,
minimum size=0pt,
inner sep=5pt,
outer sep=0pt,
},
label/.style={
rectangle,
align=center,
inner sep=6pt,
outer sep=4pt, % shifts labels a bit down
node distance=0pt,
},
]
node [class] (csl) {
begin{tikzpicture}
node [class] (ptime) {
begin{tikzpicture}
node [class] (mcfl) {
begin{tikzpicture}
node [class] (rpl) {
begin{tikzpicture}
node [class] (tal) {
begin{tikzpicture}
node [class,rounded corners=5pt] (cfl) {CFG};
node [label, below=of cfl] {TAG, LIG, CCG, HG };
end{tikzpicture}
};
node [label, below=of tal] {RPG, (2,2)-MCFG};
end{tikzpicture}
};
node [label, below=of rpl] {MCFG, LCFRS};
end{tikzpicture}
};
node [label, below=of mcfl] {RCG, simple LMG \ (= PTIME)};
end{tikzpicture}
};
node [label, below=of ptime] {CSG};
end{tikzpicture}
};
end{tikzpicture}
end{document}
tikz-pgf
You need to read this article.
– kiss my armpit
Apr 27 '13 at 18:53
1
Just add%
after eachend{tikzpicture}
or don't put the node ending on the next line (e.g.,end{tikzpicture}};
).
– Mark Wibrow
Apr 27 '13 at 19:23
@MarkWibrow Oh boy... thank you so much! Please write a quick answer for that :)
– letmaik
Apr 27 '13 at 19:28
add a comment |
I know that nesting tikz pictures is considered bad, but I did it anyway as I don't want to mess around with manual positioning. I'm nesting several rectangles similar to another question for circles. The problem is that the rectangles aren't centered correctly, which can be seen at the left and right stacking vertical lines.
Is this a problem caused by nesting or am I doing something different wrong?
documentclass{article}
usepackage{tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
class/.style={
draw,
align=center,
rectangle,
rounded corners=20pt,
minimum size=0pt,
inner sep=5pt,
outer sep=0pt,
},
label/.style={
rectangle,
align=center,
inner sep=6pt,
outer sep=4pt, % shifts labels a bit down
node distance=0pt,
},
]
node [class] (csl) {
begin{tikzpicture}
node [class] (ptime) {
begin{tikzpicture}
node [class] (mcfl) {
begin{tikzpicture}
node [class] (rpl) {
begin{tikzpicture}
node [class] (tal) {
begin{tikzpicture}
node [class,rounded corners=5pt] (cfl) {CFG};
node [label, below=of cfl] {TAG, LIG, CCG, HG };
end{tikzpicture}
};
node [label, below=of tal] {RPG, (2,2)-MCFG};
end{tikzpicture}
};
node [label, below=of rpl] {MCFG, LCFRS};
end{tikzpicture}
};
node [label, below=of mcfl] {RCG, simple LMG \ (= PTIME)};
end{tikzpicture}
};
node [label, below=of ptime] {CSG};
end{tikzpicture}
};
end{tikzpicture}
end{document}
tikz-pgf
I know that nesting tikz pictures is considered bad, but I did it anyway as I don't want to mess around with manual positioning. I'm nesting several rectangles similar to another question for circles. The problem is that the rectangles aren't centered correctly, which can be seen at the left and right stacking vertical lines.
Is this a problem caused by nesting or am I doing something different wrong?
documentclass{article}
usepackage{tikz}
usetikzlibrary{positioning}
begin{document}
begin{tikzpicture}[
class/.style={
draw,
align=center,
rectangle,
rounded corners=20pt,
minimum size=0pt,
inner sep=5pt,
outer sep=0pt,
},
label/.style={
rectangle,
align=center,
inner sep=6pt,
outer sep=4pt, % shifts labels a bit down
node distance=0pt,
},
]
node [class] (csl) {
begin{tikzpicture}
node [class] (ptime) {
begin{tikzpicture}
node [class] (mcfl) {
begin{tikzpicture}
node [class] (rpl) {
begin{tikzpicture}
node [class] (tal) {
begin{tikzpicture}
node [class,rounded corners=5pt] (cfl) {CFG};
node [label, below=of cfl] {TAG, LIG, CCG, HG };
end{tikzpicture}
};
node [label, below=of tal] {RPG, (2,2)-MCFG};
end{tikzpicture}
};
node [label, below=of rpl] {MCFG, LCFRS};
end{tikzpicture}
};
node [label, below=of mcfl] {RCG, simple LMG \ (= PTIME)};
end{tikzpicture}
};
node [label, below=of ptime] {CSG};
end{tikzpicture}
};
end{tikzpicture}
end{document}
tikz-pgf
tikz-pgf
edited 2 mins ago
Glorfindel
263129
263129
asked Apr 27 '13 at 18:47
letmaikletmaik
9971823
9971823
You need to read this article.
– kiss my armpit
Apr 27 '13 at 18:53
1
Just add%
after eachend{tikzpicture}
or don't put the node ending on the next line (e.g.,end{tikzpicture}};
).
– Mark Wibrow
Apr 27 '13 at 19:23
@MarkWibrow Oh boy... thank you so much! Please write a quick answer for that :)
– letmaik
Apr 27 '13 at 19:28
add a comment |
You need to read this article.
– kiss my armpit
Apr 27 '13 at 18:53
1
Just add%
after eachend{tikzpicture}
or don't put the node ending on the next line (e.g.,end{tikzpicture}};
).
– Mark Wibrow
Apr 27 '13 at 19:23
@MarkWibrow Oh boy... thank you so much! Please write a quick answer for that :)
– letmaik
Apr 27 '13 at 19:28
You need to read this article.
– kiss my armpit
Apr 27 '13 at 18:53
You need to read this article.
– kiss my armpit
Apr 27 '13 at 18:53
1
1
Just add
%
after each end{tikzpicture}
or don't put the node ending on the next line (e.g., end{tikzpicture}};
).– Mark Wibrow
Apr 27 '13 at 19:23
Just add
%
after each end{tikzpicture}
or don't put the node ending on the next line (e.g., end{tikzpicture}};
).– Mark Wibrow
Apr 27 '13 at 19:23
@MarkWibrow Oh boy... thank you so much! Please write a quick answer for that :)
– letmaik
Apr 27 '13 at 19:28
@MarkWibrow Oh boy... thank you so much! Please write a quick answer for that :)
– letmaik
Apr 27 '13 at 19:28
add a comment |
1 Answer
1
active
oldest
votes
Compare the code below with yours. There is still room for improvements.
documentclass{article}
usepackage{tikz}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds,fit}
tikzset{every fit/.append style=text badly centered}
tikzset{class/.style={
draw,
rectangle,
rounded corners=20pt,
inner ysep=5pt,
},
label/.style={
align=center,
inner sep=6pt,
outer ysep=4pt,
node distance=0pt,
}
}
begin{document}
begin{tikzpicture}
node [class,rounded corners=5pt] (cfl) {CFG};
node [label, below=of cfl] (tal) {TAG, LIG, CCG, HG };
node [label, below=of tal] (rpl) {RPG, (2,2)-MCFG};
node [label, below=of rpl] (mcfl) {MCFG, LCFRS};
node [label, below=of mcfl] (ptime) {RCG, simple LMG \ (= PTIME)};
node [label, below=of ptime] (csl) {CSG};
begin{pgfonlayer}{background}
node [class, inner xsep=5em, fit=(cfl) (tal) (rpl) (mcfl) (ptime) (csl)] {};
node [class, inner xsep=4em, fit=(cfl) (tal) (rpl) (mcfl) (ptime)] {};
node [class, inner xsep=3em, fit=(cfl) (tal) (rpl) (mcfl)] {};
node [class, inner xsep=2em, fit=(cfl) (tal) (rpl)] {};
node [class, inner xsep=1em, fit=(cfl) (tal)] {};
end{pgfonlayer}
end{tikzpicture}
end{document}
add a comment |
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
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%2f111072%2fhow-to-get-horizonzal-alignment-right-for-nested-rectangles%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Compare the code below with yours. There is still room for improvements.
documentclass{article}
usepackage{tikz}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds,fit}
tikzset{every fit/.append style=text badly centered}
tikzset{class/.style={
draw,
rectangle,
rounded corners=20pt,
inner ysep=5pt,
},
label/.style={
align=center,
inner sep=6pt,
outer ysep=4pt,
node distance=0pt,
}
}
begin{document}
begin{tikzpicture}
node [class,rounded corners=5pt] (cfl) {CFG};
node [label, below=of cfl] (tal) {TAG, LIG, CCG, HG };
node [label, below=of tal] (rpl) {RPG, (2,2)-MCFG};
node [label, below=of rpl] (mcfl) {MCFG, LCFRS};
node [label, below=of mcfl] (ptime) {RCG, simple LMG \ (= PTIME)};
node [label, below=of ptime] (csl) {CSG};
begin{pgfonlayer}{background}
node [class, inner xsep=5em, fit=(cfl) (tal) (rpl) (mcfl) (ptime) (csl)] {};
node [class, inner xsep=4em, fit=(cfl) (tal) (rpl) (mcfl) (ptime)] {};
node [class, inner xsep=3em, fit=(cfl) (tal) (rpl) (mcfl)] {};
node [class, inner xsep=2em, fit=(cfl) (tal) (rpl)] {};
node [class, inner xsep=1em, fit=(cfl) (tal)] {};
end{pgfonlayer}
end{tikzpicture}
end{document}
add a comment |
Compare the code below with yours. There is still room for improvements.
documentclass{article}
usepackage{tikz}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds,fit}
tikzset{every fit/.append style=text badly centered}
tikzset{class/.style={
draw,
rectangle,
rounded corners=20pt,
inner ysep=5pt,
},
label/.style={
align=center,
inner sep=6pt,
outer ysep=4pt,
node distance=0pt,
}
}
begin{document}
begin{tikzpicture}
node [class,rounded corners=5pt] (cfl) {CFG};
node [label, below=of cfl] (tal) {TAG, LIG, CCG, HG };
node [label, below=of tal] (rpl) {RPG, (2,2)-MCFG};
node [label, below=of rpl] (mcfl) {MCFG, LCFRS};
node [label, below=of mcfl] (ptime) {RCG, simple LMG \ (= PTIME)};
node [label, below=of ptime] (csl) {CSG};
begin{pgfonlayer}{background}
node [class, inner xsep=5em, fit=(cfl) (tal) (rpl) (mcfl) (ptime) (csl)] {};
node [class, inner xsep=4em, fit=(cfl) (tal) (rpl) (mcfl) (ptime)] {};
node [class, inner xsep=3em, fit=(cfl) (tal) (rpl) (mcfl)] {};
node [class, inner xsep=2em, fit=(cfl) (tal) (rpl)] {};
node [class, inner xsep=1em, fit=(cfl) (tal)] {};
end{pgfonlayer}
end{tikzpicture}
end{document}
add a comment |
Compare the code below with yours. There is still room for improvements.
documentclass{article}
usepackage{tikz}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds,fit}
tikzset{every fit/.append style=text badly centered}
tikzset{class/.style={
draw,
rectangle,
rounded corners=20pt,
inner ysep=5pt,
},
label/.style={
align=center,
inner sep=6pt,
outer ysep=4pt,
node distance=0pt,
}
}
begin{document}
begin{tikzpicture}
node [class,rounded corners=5pt] (cfl) {CFG};
node [label, below=of cfl] (tal) {TAG, LIG, CCG, HG };
node [label, below=of tal] (rpl) {RPG, (2,2)-MCFG};
node [label, below=of rpl] (mcfl) {MCFG, LCFRS};
node [label, below=of mcfl] (ptime) {RCG, simple LMG \ (= PTIME)};
node [label, below=of ptime] (csl) {CSG};
begin{pgfonlayer}{background}
node [class, inner xsep=5em, fit=(cfl) (tal) (rpl) (mcfl) (ptime) (csl)] {};
node [class, inner xsep=4em, fit=(cfl) (tal) (rpl) (mcfl) (ptime)] {};
node [class, inner xsep=3em, fit=(cfl) (tal) (rpl) (mcfl)] {};
node [class, inner xsep=2em, fit=(cfl) (tal) (rpl)] {};
node [class, inner xsep=1em, fit=(cfl) (tal)] {};
end{pgfonlayer}
end{tikzpicture}
end{document}
Compare the code below with yours. There is still room for improvements.
documentclass{article}
usepackage{tikz}
usetikzlibrary{positioning}
usetikzlibrary{backgrounds,fit}
tikzset{every fit/.append style=text badly centered}
tikzset{class/.style={
draw,
rectangle,
rounded corners=20pt,
inner ysep=5pt,
},
label/.style={
align=center,
inner sep=6pt,
outer ysep=4pt,
node distance=0pt,
}
}
begin{document}
begin{tikzpicture}
node [class,rounded corners=5pt] (cfl) {CFG};
node [label, below=of cfl] (tal) {TAG, LIG, CCG, HG };
node [label, below=of tal] (rpl) {RPG, (2,2)-MCFG};
node [label, below=of rpl] (mcfl) {MCFG, LCFRS};
node [label, below=of mcfl] (ptime) {RCG, simple LMG \ (= PTIME)};
node [label, below=of ptime] (csl) {CSG};
begin{pgfonlayer}{background}
node [class, inner xsep=5em, fit=(cfl) (tal) (rpl) (mcfl) (ptime) (csl)] {};
node [class, inner xsep=4em, fit=(cfl) (tal) (rpl) (mcfl) (ptime)] {};
node [class, inner xsep=3em, fit=(cfl) (tal) (rpl) (mcfl)] {};
node [class, inner xsep=2em, fit=(cfl) (tal) (rpl)] {};
node [class, inner xsep=1em, fit=(cfl) (tal)] {};
end{pgfonlayer}
end{tikzpicture}
end{document}
answered Apr 27 '13 at 19:49
cacamailgcacamailg
4,95322463
4,95322463
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2f111072%2fhow-to-get-horizonzal-alignment-right-for-nested-rectangles%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
You need to read this article.
– kiss my armpit
Apr 27 '13 at 18:53
1
Just add
%
after eachend{tikzpicture}
or don't put the node ending on the next line (e.g.,end{tikzpicture}};
).– Mark Wibrow
Apr 27 '13 at 19:23
@MarkWibrow Oh boy... thank you so much! Please write a quick answer for that :)
– letmaik
Apr 27 '13 at 19:28