hrule into tikz circle nodeSplit circle in tikz unevenlyTop-align text in a TikZ node of given size for...

What are some ways of extending a description of a scenery?

What is the wife of a henpecked husband called?

Can we "borrow" our answers to populate our own websites?

Can my friend and I spend the summer in Canada (6 weeks) at 16 years old without an adult?

Single-row INSERT...SELECT much slower than separate SELECT

Memory usage: #define vs. static const for uint8_t

Crack the bank account's password!

Does it take energy to move something in a circle?

Stuck on a Geometry Puzzle

Why didn't Tom Riddle take the presence of Fawkes and the Sorting Hat as more of a threat?

Is there a file that always exists and a 'normal' user can't lstat it?

Word for something that's always reliable, but never the best?

Is `Object` a function in javascript?

Why do neural networks need so many examples to perform?

How to completely remove a package in Ubuntu (like it never existed)

Illustrator to chemdraw

Equivalent of "illegal" for violating civil law

How do you funnel food off a cutting board?

How can I prevent an oracle who can see into the past from knowing everything that has happened?

Critique vs nitpicking

How to politely refuse in-office gym instructor for steroids and protein

Closed set in topological space generated by sets of the form [a, b).

Concatenating two int[]

Lightning Data Table inline edit



hrule into tikz circle node


Split circle in tikz unevenlyTop-align text in a TikZ node of given size for single- and multiline caseRotate a node but not its content: the case of the ellipse decorationIntersection of paths with constructed namesHow to define the default vertical distance between nodes?TikZ scaling graphic and adjust node position and keep font sizeNumerical conditional within tikz keys?TikZ: Drawing an arc from an intersection to an intersectionLine up nested tikz enviroments or how to get rid of themProblems with nested TikZpicturesDrawing tikz line in the margin for multiple pages













5















I am struggling with inner node layout with Tikz. Basically, I want to add a line under the first text line inside a node, splitting it unevenly. Here is a try:



Two tikz nodes, one with a stupidly huge white space into its first part, and another not split



documentclass{standalone}

usepackage{tikz}
usetikzlibrary{shapes}

begin{document}
begin{tikzpicture}[auto, node distance=3cm,
style1/.style={ellipse split, draw, align=center},
style2/.style={ellipse, draw, , align=center},
]

node[style1] (1) {NODE1 nodepart{lower} long name \ foo \ bar \ baz};

node[style2] (2) [right of=1] {NODE2 \ long name \ foo \ bar \ baz};

end{tikzpicture}
end{document}


The split option seems to be able to split the ellipsis in half, leaving an enormous white space above the first line of text (see NODE1). I wish to render something like NODE2, but with a line separating the first line from the others. Here is an example of the desired output :



The desired output



I tried to add hrule command just after the "NODE2" text, but it does not seem to be possible. Do you have any idea on how to do this?



By the way, please note that I saw this related question and its accepted answer, but I believe it does not address my issue.










share|improve this question









New contributor




Lyudline is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    Can you add a picture of the desired output? Maybe draw it by hand if you cannot provide a digital version.

    – Dr. Manuel Kuehner
    6 hours ago











  • @Dr.ManuelKuehner I just added it, thanks.

    – Lyudline
    6 hours ago
















5















I am struggling with inner node layout with Tikz. Basically, I want to add a line under the first text line inside a node, splitting it unevenly. Here is a try:



Two tikz nodes, one with a stupidly huge white space into its first part, and another not split



documentclass{standalone}

usepackage{tikz}
usetikzlibrary{shapes}

begin{document}
begin{tikzpicture}[auto, node distance=3cm,
style1/.style={ellipse split, draw, align=center},
style2/.style={ellipse, draw, , align=center},
]

node[style1] (1) {NODE1 nodepart{lower} long name \ foo \ bar \ baz};

node[style2] (2) [right of=1] {NODE2 \ long name \ foo \ bar \ baz};

end{tikzpicture}
end{document}


The split option seems to be able to split the ellipsis in half, leaving an enormous white space above the first line of text (see NODE1). I wish to render something like NODE2, but with a line separating the first line from the others. Here is an example of the desired output :



The desired output



I tried to add hrule command just after the "NODE2" text, but it does not seem to be possible. Do you have any idea on how to do this?



By the way, please note that I saw this related question and its accepted answer, but I believe it does not address my issue.










share|improve this question









New contributor




Lyudline is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 1





    Can you add a picture of the desired output? Maybe draw it by hand if you cannot provide a digital version.

    – Dr. Manuel Kuehner
    6 hours ago











  • @Dr.ManuelKuehner I just added it, thanks.

    – Lyudline
    6 hours ago














5












5








5


1






I am struggling with inner node layout with Tikz. Basically, I want to add a line under the first text line inside a node, splitting it unevenly. Here is a try:



Two tikz nodes, one with a stupidly huge white space into its first part, and another not split



documentclass{standalone}

usepackage{tikz}
usetikzlibrary{shapes}

begin{document}
begin{tikzpicture}[auto, node distance=3cm,
style1/.style={ellipse split, draw, align=center},
style2/.style={ellipse, draw, , align=center},
]

node[style1] (1) {NODE1 nodepart{lower} long name \ foo \ bar \ baz};

node[style2] (2) [right of=1] {NODE2 \ long name \ foo \ bar \ baz};

end{tikzpicture}
end{document}


The split option seems to be able to split the ellipsis in half, leaving an enormous white space above the first line of text (see NODE1). I wish to render something like NODE2, but with a line separating the first line from the others. Here is an example of the desired output :



The desired output



I tried to add hrule command just after the "NODE2" text, but it does not seem to be possible. Do you have any idea on how to do this?



By the way, please note that I saw this related question and its accepted answer, but I believe it does not address my issue.










share|improve this question









New contributor




Lyudline is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












I am struggling with inner node layout with Tikz. Basically, I want to add a line under the first text line inside a node, splitting it unevenly. Here is a try:



Two tikz nodes, one with a stupidly huge white space into its first part, and another not split



documentclass{standalone}

usepackage{tikz}
usetikzlibrary{shapes}

begin{document}
begin{tikzpicture}[auto, node distance=3cm,
style1/.style={ellipse split, draw, align=center},
style2/.style={ellipse, draw, , align=center},
]

node[style1] (1) {NODE1 nodepart{lower} long name \ foo \ bar \ baz};

node[style2] (2) [right of=1] {NODE2 \ long name \ foo \ bar \ baz};

end{tikzpicture}
end{document}


The split option seems to be able to split the ellipsis in half, leaving an enormous white space above the first line of text (see NODE1). I wish to render something like NODE2, but with a line separating the first line from the others. Here is an example of the desired output :



The desired output



I tried to add hrule command just after the "NODE2" text, but it does not seem to be possible. Do you have any idea on how to do this?



By the way, please note that I saw this related question and its accepted answer, but I believe it does not address my issue.







tikz-pgf rules tikz-node tikz-shape






share|improve this question









New contributor




Lyudline is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




Lyudline is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 6 hours ago









Dr. Manuel Kuehner

9,08732769




9,08732769






New contributor




Lyudline is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 6 hours ago









LyudlineLyudline

284




284




New contributor




Lyudline is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





Lyudline is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






Lyudline is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 1





    Can you add a picture of the desired output? Maybe draw it by hand if you cannot provide a digital version.

    – Dr. Manuel Kuehner
    6 hours ago











  • @Dr.ManuelKuehner I just added it, thanks.

    – Lyudline
    6 hours ago














  • 1





    Can you add a picture of the desired output? Maybe draw it by hand if you cannot provide a digital version.

    – Dr. Manuel Kuehner
    6 hours ago











  • @Dr.ManuelKuehner I just added it, thanks.

    – Lyudline
    6 hours ago








1




1





Can you add a picture of the desired output? Maybe draw it by hand if you cannot provide a digital version.

– Dr. Manuel Kuehner
6 hours ago





Can you add a picture of the desired output? Maybe draw it by hand if you cannot provide a digital version.

– Dr. Manuel Kuehner
6 hours ago













@Dr.ManuelKuehner I just added it, thanks.

– Lyudline
6 hours ago





@Dr.ManuelKuehner I just added it, thanks.

– Lyudline
6 hours ago










2 Answers
2






active

oldest

votes


















5














Something of that sort?



documentclass{standalone}

usepackage{tikz}
usetikzlibrary{shapes,fit,positioning}

begin{document}
begin{tikzpicture}[auto, node distance=3cm,
style1/.style={ellipse split, draw, align=center},
style2/.style={ellipse, draw, , align=center},
lower elli/.style={align=center},
fit elli/.style={ellipse,draw,inner sep=0pt,
path picture={draw ([xshift=-1cm]#1.south west)--
([xshift=1cm]#1.south east);}}
]

node[style1] (1) {NODE1 nodepart{lower} long name \ foo \ bar \ baz};

node[style2] (2) [right=1cm of 1] {NODE2 \ long name \ foo \ bar \ baz};

node (3a) [right=3.5cm of 2.north,anchor=north] {NODE3};
node[lower elli] (3b)[below=0pt of 3a] {long name \ foo \ bar \ baz};
node[fit elli=3a,fit=(3a) (3b)]{};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer
























  • This seems a bit hard to position and align with other nodes if that is required by the OP (e.g. [right of=1] will not have them vertically aligned anymore)

    – sheß
    5 hours ago






  • 2





    @sheß Vertical alignment is not really an issue to me. But it might be for someone, indeed.

    – Lyudline
    5 hours ago











  • @sheß If you want to position relative to each other, there is no problem. You could then position the upper parts relative to each other.

    – marmot
    5 hours ago











  • True. Though that would still change behavior compared to a normal node, especially when nodes vary in size. But this seems not to be an issue for the OP

    – sheß
    5 hours ago



















6














You could just draw a longer [h]rule and clip the node:



documentclass{standalone}
usepackage{tikz}
usetikzlibrary{shapes}
defclap#1{hbox to 0pt{hss#1hss}}
begin{document}
begin{tikzpicture}[auto, node distance=3cm,
styleshess/.style={ellipse, draw, align=center,clip},
]
node[styleshess] (2) {NODE2\clap{rule{linewidth}{.4pt}}\ long name \ foo \ bar \ baz};
end{tikzpicture}
end{document}


enter image description here



You can play around with that line as with any other rule to modify positioning or width. The clap makes sure that the (imaginary) length of that line does not blow up the size of the node. The clip in the style definition makes sure that only the part of the line that falls within the node is actually drawn.






share|improve this answer





















  • 2





    This seems to have a larger gap than in the screen shot of the OP. (Personally I do not like these kinds of comments, but you started that.)

    – marmot
    5 hours ago











  • That solution is closest to what I tried, but I prefer the breakdown into two nodes suggested by @marmot : I feel I can control more easily the style of each subpart of the ellipsis. The code is more elegant to me, however.

    – Lyudline
    5 hours ago













  • That space is easily adjustable with the usual techniques as pointed out in my post. You could write NODE2\[-0.5baselineskip]clap{... or something of that sort to reduce that space. I didn't intend to be nasty or start a game of tit-for-tat with my comment on your post, I just thought easy positioning might be a factor for people drawing nodes in tikz. Nevermind.

    – sheß
    5 hours ago













  • You could just add a tabular instead. (These kinds of shapes generally have issues when relative positioning unless you position relative to their centers.)

    – marmot
    5 hours ago











Your Answer








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
});


}
});






Lyudline is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476597%2fhrule-into-tikz-circle-node%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









5














Something of that sort?



documentclass{standalone}

usepackage{tikz}
usetikzlibrary{shapes,fit,positioning}

begin{document}
begin{tikzpicture}[auto, node distance=3cm,
style1/.style={ellipse split, draw, align=center},
style2/.style={ellipse, draw, , align=center},
lower elli/.style={align=center},
fit elli/.style={ellipse,draw,inner sep=0pt,
path picture={draw ([xshift=-1cm]#1.south west)--
([xshift=1cm]#1.south east);}}
]

node[style1] (1) {NODE1 nodepart{lower} long name \ foo \ bar \ baz};

node[style2] (2) [right=1cm of 1] {NODE2 \ long name \ foo \ bar \ baz};

node (3a) [right=3.5cm of 2.north,anchor=north] {NODE3};
node[lower elli] (3b)[below=0pt of 3a] {long name \ foo \ bar \ baz};
node[fit elli=3a,fit=(3a) (3b)]{};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer
























  • This seems a bit hard to position and align with other nodes if that is required by the OP (e.g. [right of=1] will not have them vertically aligned anymore)

    – sheß
    5 hours ago






  • 2





    @sheß Vertical alignment is not really an issue to me. But it might be for someone, indeed.

    – Lyudline
    5 hours ago











  • @sheß If you want to position relative to each other, there is no problem. You could then position the upper parts relative to each other.

    – marmot
    5 hours ago











  • True. Though that would still change behavior compared to a normal node, especially when nodes vary in size. But this seems not to be an issue for the OP

    – sheß
    5 hours ago
















5














Something of that sort?



documentclass{standalone}

usepackage{tikz}
usetikzlibrary{shapes,fit,positioning}

begin{document}
begin{tikzpicture}[auto, node distance=3cm,
style1/.style={ellipse split, draw, align=center},
style2/.style={ellipse, draw, , align=center},
lower elli/.style={align=center},
fit elli/.style={ellipse,draw,inner sep=0pt,
path picture={draw ([xshift=-1cm]#1.south west)--
([xshift=1cm]#1.south east);}}
]

node[style1] (1) {NODE1 nodepart{lower} long name \ foo \ bar \ baz};

node[style2] (2) [right=1cm of 1] {NODE2 \ long name \ foo \ bar \ baz};

node (3a) [right=3.5cm of 2.north,anchor=north] {NODE3};
node[lower elli] (3b)[below=0pt of 3a] {long name \ foo \ bar \ baz};
node[fit elli=3a,fit=(3a) (3b)]{};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer
























  • This seems a bit hard to position and align with other nodes if that is required by the OP (e.g. [right of=1] will not have them vertically aligned anymore)

    – sheß
    5 hours ago






  • 2





    @sheß Vertical alignment is not really an issue to me. But it might be for someone, indeed.

    – Lyudline
    5 hours ago











  • @sheß If you want to position relative to each other, there is no problem. You could then position the upper parts relative to each other.

    – marmot
    5 hours ago











  • True. Though that would still change behavior compared to a normal node, especially when nodes vary in size. But this seems not to be an issue for the OP

    – sheß
    5 hours ago














5












5








5







Something of that sort?



documentclass{standalone}

usepackage{tikz}
usetikzlibrary{shapes,fit,positioning}

begin{document}
begin{tikzpicture}[auto, node distance=3cm,
style1/.style={ellipse split, draw, align=center},
style2/.style={ellipse, draw, , align=center},
lower elli/.style={align=center},
fit elli/.style={ellipse,draw,inner sep=0pt,
path picture={draw ([xshift=-1cm]#1.south west)--
([xshift=1cm]#1.south east);}}
]

node[style1] (1) {NODE1 nodepart{lower} long name \ foo \ bar \ baz};

node[style2] (2) [right=1cm of 1] {NODE2 \ long name \ foo \ bar \ baz};

node (3a) [right=3.5cm of 2.north,anchor=north] {NODE3};
node[lower elli] (3b)[below=0pt of 3a] {long name \ foo \ bar \ baz};
node[fit elli=3a,fit=(3a) (3b)]{};
end{tikzpicture}
end{document}


enter image description here






share|improve this answer













Something of that sort?



documentclass{standalone}

usepackage{tikz}
usetikzlibrary{shapes,fit,positioning}

begin{document}
begin{tikzpicture}[auto, node distance=3cm,
style1/.style={ellipse split, draw, align=center},
style2/.style={ellipse, draw, , align=center},
lower elli/.style={align=center},
fit elli/.style={ellipse,draw,inner sep=0pt,
path picture={draw ([xshift=-1cm]#1.south west)--
([xshift=1cm]#1.south east);}}
]

node[style1] (1) {NODE1 nodepart{lower} long name \ foo \ bar \ baz};

node[style2] (2) [right=1cm of 1] {NODE2 \ long name \ foo \ bar \ baz};

node (3a) [right=3.5cm of 2.north,anchor=north] {NODE3};
node[lower elli] (3b)[below=0pt of 3a] {long name \ foo \ bar \ baz};
node[fit elli=3a,fit=(3a) (3b)]{};
end{tikzpicture}
end{document}


enter image description here







share|improve this answer












share|improve this answer



share|improve this answer










answered 6 hours ago









marmotmarmot

103k4123234




103k4123234













  • This seems a bit hard to position and align with other nodes if that is required by the OP (e.g. [right of=1] will not have them vertically aligned anymore)

    – sheß
    5 hours ago






  • 2





    @sheß Vertical alignment is not really an issue to me. But it might be for someone, indeed.

    – Lyudline
    5 hours ago











  • @sheß If you want to position relative to each other, there is no problem. You could then position the upper parts relative to each other.

    – marmot
    5 hours ago











  • True. Though that would still change behavior compared to a normal node, especially when nodes vary in size. But this seems not to be an issue for the OP

    – sheß
    5 hours ago



















  • This seems a bit hard to position and align with other nodes if that is required by the OP (e.g. [right of=1] will not have them vertically aligned anymore)

    – sheß
    5 hours ago






  • 2





    @sheß Vertical alignment is not really an issue to me. But it might be for someone, indeed.

    – Lyudline
    5 hours ago











  • @sheß If you want to position relative to each other, there is no problem. You could then position the upper parts relative to each other.

    – marmot
    5 hours ago











  • True. Though that would still change behavior compared to a normal node, especially when nodes vary in size. But this seems not to be an issue for the OP

    – sheß
    5 hours ago

















This seems a bit hard to position and align with other nodes if that is required by the OP (e.g. [right of=1] will not have them vertically aligned anymore)

– sheß
5 hours ago





This seems a bit hard to position and align with other nodes if that is required by the OP (e.g. [right of=1] will not have them vertically aligned anymore)

– sheß
5 hours ago




2




2





@sheß Vertical alignment is not really an issue to me. But it might be for someone, indeed.

– Lyudline
5 hours ago





@sheß Vertical alignment is not really an issue to me. But it might be for someone, indeed.

– Lyudline
5 hours ago













@sheß If you want to position relative to each other, there is no problem. You could then position the upper parts relative to each other.

– marmot
5 hours ago





@sheß If you want to position relative to each other, there is no problem. You could then position the upper parts relative to each other.

– marmot
5 hours ago













True. Though that would still change behavior compared to a normal node, especially when nodes vary in size. But this seems not to be an issue for the OP

– sheß
5 hours ago





True. Though that would still change behavior compared to a normal node, especially when nodes vary in size. But this seems not to be an issue for the OP

– sheß
5 hours ago











6














You could just draw a longer [h]rule and clip the node:



documentclass{standalone}
usepackage{tikz}
usetikzlibrary{shapes}
defclap#1{hbox to 0pt{hss#1hss}}
begin{document}
begin{tikzpicture}[auto, node distance=3cm,
styleshess/.style={ellipse, draw, align=center,clip},
]
node[styleshess] (2) {NODE2\clap{rule{linewidth}{.4pt}}\ long name \ foo \ bar \ baz};
end{tikzpicture}
end{document}


enter image description here



You can play around with that line as with any other rule to modify positioning or width. The clap makes sure that the (imaginary) length of that line does not blow up the size of the node. The clip in the style definition makes sure that only the part of the line that falls within the node is actually drawn.






share|improve this answer





















  • 2





    This seems to have a larger gap than in the screen shot of the OP. (Personally I do not like these kinds of comments, but you started that.)

    – marmot
    5 hours ago











  • That solution is closest to what I tried, but I prefer the breakdown into two nodes suggested by @marmot : I feel I can control more easily the style of each subpart of the ellipsis. The code is more elegant to me, however.

    – Lyudline
    5 hours ago













  • That space is easily adjustable with the usual techniques as pointed out in my post. You could write NODE2\[-0.5baselineskip]clap{... or something of that sort to reduce that space. I didn't intend to be nasty or start a game of tit-for-tat with my comment on your post, I just thought easy positioning might be a factor for people drawing nodes in tikz. Nevermind.

    – sheß
    5 hours ago













  • You could just add a tabular instead. (These kinds of shapes generally have issues when relative positioning unless you position relative to their centers.)

    – marmot
    5 hours ago
















6














You could just draw a longer [h]rule and clip the node:



documentclass{standalone}
usepackage{tikz}
usetikzlibrary{shapes}
defclap#1{hbox to 0pt{hss#1hss}}
begin{document}
begin{tikzpicture}[auto, node distance=3cm,
styleshess/.style={ellipse, draw, align=center,clip},
]
node[styleshess] (2) {NODE2\clap{rule{linewidth}{.4pt}}\ long name \ foo \ bar \ baz};
end{tikzpicture}
end{document}


enter image description here



You can play around with that line as with any other rule to modify positioning or width. The clap makes sure that the (imaginary) length of that line does not blow up the size of the node. The clip in the style definition makes sure that only the part of the line that falls within the node is actually drawn.






share|improve this answer





















  • 2





    This seems to have a larger gap than in the screen shot of the OP. (Personally I do not like these kinds of comments, but you started that.)

    – marmot
    5 hours ago











  • That solution is closest to what I tried, but I prefer the breakdown into two nodes suggested by @marmot : I feel I can control more easily the style of each subpart of the ellipsis. The code is more elegant to me, however.

    – Lyudline
    5 hours ago













  • That space is easily adjustable with the usual techniques as pointed out in my post. You could write NODE2\[-0.5baselineskip]clap{... or something of that sort to reduce that space. I didn't intend to be nasty or start a game of tit-for-tat with my comment on your post, I just thought easy positioning might be a factor for people drawing nodes in tikz. Nevermind.

    – sheß
    5 hours ago













  • You could just add a tabular instead. (These kinds of shapes generally have issues when relative positioning unless you position relative to their centers.)

    – marmot
    5 hours ago














6












6








6







You could just draw a longer [h]rule and clip the node:



documentclass{standalone}
usepackage{tikz}
usetikzlibrary{shapes}
defclap#1{hbox to 0pt{hss#1hss}}
begin{document}
begin{tikzpicture}[auto, node distance=3cm,
styleshess/.style={ellipse, draw, align=center,clip},
]
node[styleshess] (2) {NODE2\clap{rule{linewidth}{.4pt}}\ long name \ foo \ bar \ baz};
end{tikzpicture}
end{document}


enter image description here



You can play around with that line as with any other rule to modify positioning or width. The clap makes sure that the (imaginary) length of that line does not blow up the size of the node. The clip in the style definition makes sure that only the part of the line that falls within the node is actually drawn.






share|improve this answer















You could just draw a longer [h]rule and clip the node:



documentclass{standalone}
usepackage{tikz}
usetikzlibrary{shapes}
defclap#1{hbox to 0pt{hss#1hss}}
begin{document}
begin{tikzpicture}[auto, node distance=3cm,
styleshess/.style={ellipse, draw, align=center,clip},
]
node[styleshess] (2) {NODE2\clap{rule{linewidth}{.4pt}}\ long name \ foo \ bar \ baz};
end{tikzpicture}
end{document}


enter image description here



You can play around with that line as with any other rule to modify positioning or width. The clap makes sure that the (imaginary) length of that line does not blow up the size of the node. The clip in the style definition makes sure that only the part of the line that falls within the node is actually drawn.







share|improve this answer














share|improve this answer



share|improve this answer








edited 5 hours ago

























answered 5 hours ago









sheßsheß

1,59011328




1,59011328








  • 2





    This seems to have a larger gap than in the screen shot of the OP. (Personally I do not like these kinds of comments, but you started that.)

    – marmot
    5 hours ago











  • That solution is closest to what I tried, but I prefer the breakdown into two nodes suggested by @marmot : I feel I can control more easily the style of each subpart of the ellipsis. The code is more elegant to me, however.

    – Lyudline
    5 hours ago













  • That space is easily adjustable with the usual techniques as pointed out in my post. You could write NODE2\[-0.5baselineskip]clap{... or something of that sort to reduce that space. I didn't intend to be nasty or start a game of tit-for-tat with my comment on your post, I just thought easy positioning might be a factor for people drawing nodes in tikz. Nevermind.

    – sheß
    5 hours ago













  • You could just add a tabular instead. (These kinds of shapes generally have issues when relative positioning unless you position relative to their centers.)

    – marmot
    5 hours ago














  • 2





    This seems to have a larger gap than in the screen shot of the OP. (Personally I do not like these kinds of comments, but you started that.)

    – marmot
    5 hours ago











  • That solution is closest to what I tried, but I prefer the breakdown into two nodes suggested by @marmot : I feel I can control more easily the style of each subpart of the ellipsis. The code is more elegant to me, however.

    – Lyudline
    5 hours ago













  • That space is easily adjustable with the usual techniques as pointed out in my post. You could write NODE2\[-0.5baselineskip]clap{... or something of that sort to reduce that space. I didn't intend to be nasty or start a game of tit-for-tat with my comment on your post, I just thought easy positioning might be a factor for people drawing nodes in tikz. Nevermind.

    – sheß
    5 hours ago













  • You could just add a tabular instead. (These kinds of shapes generally have issues when relative positioning unless you position relative to their centers.)

    – marmot
    5 hours ago








2




2





This seems to have a larger gap than in the screen shot of the OP. (Personally I do not like these kinds of comments, but you started that.)

– marmot
5 hours ago





This seems to have a larger gap than in the screen shot of the OP. (Personally I do not like these kinds of comments, but you started that.)

– marmot
5 hours ago













That solution is closest to what I tried, but I prefer the breakdown into two nodes suggested by @marmot : I feel I can control more easily the style of each subpart of the ellipsis. The code is more elegant to me, however.

– Lyudline
5 hours ago







That solution is closest to what I tried, but I prefer the breakdown into two nodes suggested by @marmot : I feel I can control more easily the style of each subpart of the ellipsis. The code is more elegant to me, however.

– Lyudline
5 hours ago















That space is easily adjustable with the usual techniques as pointed out in my post. You could write NODE2\[-0.5baselineskip]clap{... or something of that sort to reduce that space. I didn't intend to be nasty or start a game of tit-for-tat with my comment on your post, I just thought easy positioning might be a factor for people drawing nodes in tikz. Nevermind.

– sheß
5 hours ago







That space is easily adjustable with the usual techniques as pointed out in my post. You could write NODE2\[-0.5baselineskip]clap{... or something of that sort to reduce that space. I didn't intend to be nasty or start a game of tit-for-tat with my comment on your post, I just thought easy positioning might be a factor for people drawing nodes in tikz. Nevermind.

– sheß
5 hours ago















You could just add a tabular instead. (These kinds of shapes generally have issues when relative positioning unless you position relative to their centers.)

– marmot
5 hours ago





You could just add a tabular instead. (These kinds of shapes generally have issues when relative positioning unless you position relative to their centers.)

– marmot
5 hours ago










Lyudline is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















Lyudline is a new contributor. Be nice, and check out our Code of Conduct.













Lyudline is a new contributor. Be nice, and check out our Code of Conduct.












Lyudline is a new contributor. Be nice, and check out our Code of Conduct.
















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.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476597%2fhrule-into-tikz-circle-node%23new-answer', 'question_page');
}
);

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







Popular posts from this blog

is 'sed' thread safeWhat should someone know about using Python scripts in the shell?Nexenta bash script uses...

How do i solve the “ No module named 'mlxtend' ” issue on Jupyter?

Pilgersdorf Inhaltsverzeichnis Geografie | Geschichte | Bevölkerungsentwicklung | Politik | Kultur...