Add a padding around draw nodes and images












0















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:



enter image description here



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:



enter image description here



How I can get more extra space to avoid text overlapping?










share|improve this question







New contributor




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





















  • break text into more lines?

    – Zarko
    7 hours ago
















0















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:



enter image description here



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:



enter image description here



How I can get more extra space to avoid text overlapping?










share|improve this question







New contributor




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





















  • break text into more lines?

    – Zarko
    7 hours ago














0












0








0








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:



enter image description here



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:



enter image description here



How I can get more extra space to avoid text overlapping?










share|improve this question







New contributor




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












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:



enter image description here



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:



enter image description here



How I can get more extra space to avoid text overlapping?







spacing draw overlap






share|improve this question







New contributor




kitsune 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




kitsune 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






New contributor




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









asked 8 hours ago









kitsunekitsune

1032




1032




New contributor




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





New contributor





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






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













  • 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





break text into more lines?

– Zarko
7 hours ago










1 Answer
1






active

oldest

votes


















3














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}


enter image description here






share|improve this answer
























    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.










    draft saved

    draft discarded


















    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









    3














    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}


    enter image description here






    share|improve this answer




























      3














      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}


      enter image description here






      share|improve this answer


























        3












        3








        3







        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}


        enter image description here






        share|improve this answer













        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}


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 7 hours ago









        JouleVJouleV

        12k22561




        12k22561






















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










            draft saved

            draft discarded


















            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.




            draft saved


            draft discarded














            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





















































            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

            Contact image not getting when fetch all contact list from iPhone by CNContact

            Idjassú

            count number of partitions of a set with n elements into k subsets