0

I'm trying to build a template for a bubble diagram, since I don't know in advance how many bubbles need to be added I'm trying to do it using foreach.

I suspect \foreach does not expand the way I think it would because instead of multiple bubbles I get 1 bubble with all the text.

\newcommand\addbubbles[1]{
    \foreach \x in {#1}{\textbf{\x}, \newline}
}

% Command for printing bubble
\newcommand\flexbubblediag[1]{
    \renewcommand{\flexbubblediag}{
        \smartdiagram[bubble diagram]{
            \addbubbles{#1}
        }
    }
}

in my .tex I use to

\flexbubblediag{{bubble1},{bubble2}}
0

Turns out the expansion with foreach was unnecessary.

% Command for printing bubble
\newcommand\skillbubbles[1]{
    \renewcommand{\skillbubbles}{
        \smartdiagram[bubble diagram]{#1}
    }
}

Works just fine

% Skill bubbles 
\skillbubbles{{Skill1}, {Kill12}, {madSkill}, {mad \\ science}}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.