Add a padding around draw nodes and images
I use this code to generate a set a of bubbles with labels:
newcounter{a}
newcounter{b}
newcounter{c}
% Command to output a number of automatically-sized bubbles from a string in the format of '<size>/<label>', e.g. bubbles{5/Eclipse, 6/git, 4/Office, 3/Inkscape, 3/Blender}
newcommand{bubbles}[1]{
% Reset counters
setcounter{a}{0}
setcounter{c}{150}
begin{tikzpicture}[scale=3.5]
foreach p/t in {#1} {
addtocounter{a}{1}
bubble{thea/2}{theb}{p/25}{t}{1p0}
}
end{tikzpicture}
}
% Command to output a bubble at a specific position with a specific size
newcommand{bubble}[5]{
filldraw[fill=black, draw=none] (#1,0.5) circle (#3); % Bubble
node[label=textcolor{black}{#4}] at (#1,0.7) {}; % Label
}
For example using:
begin{center}
textbf{OSes and office tools}
bubbles{
6/draw.io,
5/iWork,
4/Linux,
6/macOS,
4/MS Office,
3/Windows
}
end{center}
I will get:
But if I use a long text, for example:
begin{center}
textbf{OSes and office tools}
bubbles{
6/draw.io,
5/iWork,
4/Linux,
6/macOS very long tool,
4/MS Office,
3/Windows
}
end{center}
I will get:
How I can get more extra space to avoid text overlapping?
spacing draw overlap
New contributor
add a comment |
I use this code to generate a set a of bubbles with labels:
newcounter{a}
newcounter{b}
newcounter{c}
% Command to output a number of automatically-sized bubbles from a string in the format of '<size>/<label>', e.g. bubbles{5/Eclipse, 6/git, 4/Office, 3/Inkscape, 3/Blender}
newcommand{bubbles}[1]{
% Reset counters
setcounter{a}{0}
setcounter{c}{150}
begin{tikzpicture}[scale=3.5]
foreach p/t in {#1} {
addtocounter{a}{1}
bubble{thea/2}{theb}{p/25}{t}{1p0}
}
end{tikzpicture}
}
% Command to output a bubble at a specific position with a specific size
newcommand{bubble}[5]{
filldraw[fill=black, draw=none] (#1,0.5) circle (#3); % Bubble
node[label=textcolor{black}{#4}] at (#1,0.7) {}; % Label
}
For example using:
begin{center}
textbf{OSes and office tools}
bubbles{
6/draw.io,
5/iWork,
4/Linux,
6/macOS,
4/MS Office,
3/Windows
}
end{center}
I will get:
But if I use a long text, for example:
begin{center}
textbf{OSes and office tools}
bubbles{
6/draw.io,
5/iWork,
4/Linux,
6/macOS very long tool,
4/MS Office,
3/Windows
}
end{center}
I will get:
How I can get more extra space to avoid text overlapping?
spacing draw overlap
New contributor
break text into more lines?
– Zarko
7 hours ago
add a comment |
I use this code to generate a set a of bubbles with labels:
newcounter{a}
newcounter{b}
newcounter{c}
% Command to output a number of automatically-sized bubbles from a string in the format of '<size>/<label>', e.g. bubbles{5/Eclipse, 6/git, 4/Office, 3/Inkscape, 3/Blender}
newcommand{bubbles}[1]{
% Reset counters
setcounter{a}{0}
setcounter{c}{150}
begin{tikzpicture}[scale=3.5]
foreach p/t in {#1} {
addtocounter{a}{1}
bubble{thea/2}{theb}{p/25}{t}{1p0}
}
end{tikzpicture}
}
% Command to output a bubble at a specific position with a specific size
newcommand{bubble}[5]{
filldraw[fill=black, draw=none] (#1,0.5) circle (#3); % Bubble
node[label=textcolor{black}{#4}] at (#1,0.7) {}; % Label
}
For example using:
begin{center}
textbf{OSes and office tools}
bubbles{
6/draw.io,
5/iWork,
4/Linux,
6/macOS,
4/MS Office,
3/Windows
}
end{center}
I will get:
But if I use a long text, for example:
begin{center}
textbf{OSes and office tools}
bubbles{
6/draw.io,
5/iWork,
4/Linux,
6/macOS very long tool,
4/MS Office,
3/Windows
}
end{center}
I will get:
How I can get more extra space to avoid text overlapping?
spacing draw overlap
New contributor
I use this code to generate a set a of bubbles with labels:
newcounter{a}
newcounter{b}
newcounter{c}
% Command to output a number of automatically-sized bubbles from a string in the format of '<size>/<label>', e.g. bubbles{5/Eclipse, 6/git, 4/Office, 3/Inkscape, 3/Blender}
newcommand{bubbles}[1]{
% Reset counters
setcounter{a}{0}
setcounter{c}{150}
begin{tikzpicture}[scale=3.5]
foreach p/t in {#1} {
addtocounter{a}{1}
bubble{thea/2}{theb}{p/25}{t}{1p0}
}
end{tikzpicture}
}
% Command to output a bubble at a specific position with a specific size
newcommand{bubble}[5]{
filldraw[fill=black, draw=none] (#1,0.5) circle (#3); % Bubble
node[label=textcolor{black}{#4}] at (#1,0.7) {}; % Label
}
For example using:
begin{center}
textbf{OSes and office tools}
bubbles{
6/draw.io,
5/iWork,
4/Linux,
6/macOS,
4/MS Office,
3/Windows
}
end{center}
I will get:
But if I use a long text, for example:
begin{center}
textbf{OSes and office tools}
bubbles{
6/draw.io,
5/iWork,
4/Linux,
6/macOS very long tool,
4/MS Office,
3/Windows
}
end{center}
I will get:
How I can get more extra space to avoid text overlapping?
spacing draw overlap
spacing draw overlap
New contributor
New contributor
New contributor
asked 8 hours ago
kitsunekitsune
1032
1032
New contributor
New contributor
break text into more lines?
– Zarko
7 hours ago
add a comment |
break text into more lines?
– Zarko
7 hours ago
break text into more lines?
– Zarko
7 hours ago
break text into more lines?
– Zarko
7 hours ago
add a comment |
1 Answer
1
active
oldest
votes
I think this can still be improved.
documentclass{article}
usepackage{tikz}
usetikzlibrary{positioning}
newcommandbubbles[1] {%
begin{tikzpicture}[scale=3.5]
coordinate (a0) at (0,0);
foreach sz/name [count=cnt,count=xcnt from 0] in {#1} {%
node[right=0pt of axcnt,minimum height=.75cm] (acnt) {name};
path (acnt.south);
node[fill=black,circle,minimum size=5*sz] at ([yshift=-3.5pt]acnt.south) {};
}
end{tikzpicture}}
begin{document}
bubbles{
6/draw.io,
5/iWork,
4/Linux,
6/macOS very long tool,
4/MS Office,
3/Windows
}
end{document}
add a comment |
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
});
}
});
kitsune is a new contributor. Be nice, and check out our Code of Conduct.
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%2f483935%2fadd-a-padding-around-draw-nodes-and-images%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
I think this can still be improved.
documentclass{article}
usepackage{tikz}
usetikzlibrary{positioning}
newcommandbubbles[1] {%
begin{tikzpicture}[scale=3.5]
coordinate (a0) at (0,0);
foreach sz/name [count=cnt,count=xcnt from 0] in {#1} {%
node[right=0pt of axcnt,minimum height=.75cm] (acnt) {name};
path (acnt.south);
node[fill=black,circle,minimum size=5*sz] at ([yshift=-3.5pt]acnt.south) {};
}
end{tikzpicture}}
begin{document}
bubbles{
6/draw.io,
5/iWork,
4/Linux,
6/macOS very long tool,
4/MS Office,
3/Windows
}
end{document}
add a comment |
I think this can still be improved.
documentclass{article}
usepackage{tikz}
usetikzlibrary{positioning}
newcommandbubbles[1] {%
begin{tikzpicture}[scale=3.5]
coordinate (a0) at (0,0);
foreach sz/name [count=cnt,count=xcnt from 0] in {#1} {%
node[right=0pt of axcnt,minimum height=.75cm] (acnt) {name};
path (acnt.south);
node[fill=black,circle,minimum size=5*sz] at ([yshift=-3.5pt]acnt.south) {};
}
end{tikzpicture}}
begin{document}
bubbles{
6/draw.io,
5/iWork,
4/Linux,
6/macOS very long tool,
4/MS Office,
3/Windows
}
end{document}
add a comment |
I think this can still be improved.
documentclass{article}
usepackage{tikz}
usetikzlibrary{positioning}
newcommandbubbles[1] {%
begin{tikzpicture}[scale=3.5]
coordinate (a0) at (0,0);
foreach sz/name [count=cnt,count=xcnt from 0] in {#1} {%
node[right=0pt of axcnt,minimum height=.75cm] (acnt) {name};
path (acnt.south);
node[fill=black,circle,minimum size=5*sz] at ([yshift=-3.5pt]acnt.south) {};
}
end{tikzpicture}}
begin{document}
bubbles{
6/draw.io,
5/iWork,
4/Linux,
6/macOS very long tool,
4/MS Office,
3/Windows
}
end{document}
I think this can still be improved.
documentclass{article}
usepackage{tikz}
usetikzlibrary{positioning}
newcommandbubbles[1] {%
begin{tikzpicture}[scale=3.5]
coordinate (a0) at (0,0);
foreach sz/name [count=cnt,count=xcnt from 0] in {#1} {%
node[right=0pt of axcnt,minimum height=.75cm] (acnt) {name};
path (acnt.south);
node[fill=black,circle,minimum size=5*sz] at ([yshift=-3.5pt]acnt.south) {};
}
end{tikzpicture}}
begin{document}
bubbles{
6/draw.io,
5/iWork,
4/Linux,
6/macOS very long tool,
4/MS Office,
3/Windows
}
end{document}
answered 7 hours ago
JouleVJouleV
12k22561
12k22561
add a comment |
add a comment |
kitsune is a new contributor. Be nice, and check out our Code of Conduct.
kitsune is a new contributor. Be nice, and check out our Code of Conduct.
kitsune is a new contributor. Be nice, and check out our Code of Conduct.
kitsune 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.
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%2f483935%2fadd-a-padding-around-draw-nodes-and-images%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
break text into more lines?
– Zarko
7 hours ago