5

I'm trying to the colors inside non root nodes in my mind map like the manual for PGF did for the root concept. But it never does anything to fill inside the nodes and create a border for my mind map. I appreciate your help. Also, please let me know whether there is some where in the manual which is released in 2019, information regarding the solution to this problem.

Here is my code

    \documentclass{article}

\usepackage[utf8]{inputenc}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}

\usepackage{tikz}
\usetikzlibrary{mindmap,trees,decorations.pathmorphing}

\usepackage{fullpage}

\title{mindmaps}
\author{creator}
\date{\today}

\begin{document}

\maketitle

\begin{center}
\begin{tikzpicture}
[
    mindmap,
    every node/.style={concept, execute at begin node=\hskip0pt},
    root concept/.append style={
            concept color=black,fill=white,line width=1ex,text=black
            },
        text=white,
        grow cyclic,
    level 1 concept/.append style={
        level distance=4.5cm,sibling angle=120,
        concept color=red!50!green!40, fill={white}, text=white, line width=1ex
        },
    level 2 concept/.append style={
        level distance=3.5cm,sibling angle=35, concept color =red!50, fill= white
        }
]
    %\clip(0,-1)rectangle++(4,5);
    \node[root concept]{$2^{nd}-Oreder PDEs$}
        child
        {
            node[concept]{$\Delta > 0$}
            {
                child{node{Hyperbolic}}
            }
        }
        child
        {
            node{$\Delta = 0$}
            {
                child{node{Parabolic}}
            }
        }
        child
        {
            node{$\Delta < 0$}
            {
                child{node{Elliptic}}
            }
        };
\end{tikzpicture}
\end{center}


\end{document}

and this is what I get

enter image description here

2
  • 1
    Do you mean you want to remove the fill colors from the children / non-root nodes and have a border around them instead?
    – steve
    Apr 19, 2020 at 19:48
  • exactly, I want to have for example a red border color like the one in this updated picture. I can have it around the root (the black color in the picture). However I don't realize why the same piece of code doesn't work for other nodes.
    – Master.AKA
    Apr 19, 2020 at 19:51

1 Answer 1

8

There is a subtle but important difference between a child and and a node "in" the child. You need to pass the concept color to the children and drop fill=white.

\documentclass{article}

\usepackage[utf8]{inputenc}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}

\usepackage{tikz}
\usetikzlibrary{mindmap,trees,decorations.pathmorphing}

\usepackage{fullpage}

\title{mindmaps}
\author{creator}
\date{\today}

\begin{document}

\maketitle

\begin{center}
\begin{tikzpicture}
[
    mindmap,
    every node/.style={concept, execute at begin node=\hskip0pt},
    root concept/.append style={
            concept color=black, line width=1ex,text=white
            },
        text=white,
        grow cyclic,
    level 1 concept/.append style={
        level distance=4.5cm,sibling angle=120,
        every child/.append style={concept color=red!50!green!40}, text=white, line width=1ex
        },
    level 2 concept/.append style={
        level distance=3.5cm,sibling angle=35, 
         every child/.append style={concept color =red!50}
        }
]
    %\clip(0,-1)rectangle++(4,5);
    \node[root concept]{2\textsuperscript{nd} order PDEs}
        child
        {
            node[concept]{$\Delta > 0$}
            {
                child{node{Hyperbolic}}
            }
        }
        child
        {
            node{$\Delta = 0$}
            {
                child{node{Parabolic}}
            }
        }
        child
        {
            node{$\Delta < 0$}
            {
                child{node{Elliptic}}
            }
        };
\end{tikzpicture}
\end{center}
\end{document}

enter image description here

As for your comment: maybe like this?

\documentclass{article}

\usepackage[utf8]{inputenc}

\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}

\usepackage{tikz}
\usetikzlibrary{mindmap,trees,decorations.pathmorphing}

\usepackage{fullpage}

\title{mindmaps}
\author{creator}
\date{\today}

\begin{document}

\maketitle

\begin{center}
\begin{tikzpicture}
[
    mindmap,
    every node/.style={concept,text=black,fill=white, execute at begin node=\hskip0pt},
    root concept/.append style={
            concept color=black, line width=1ex,fill=white
            },
        %text=white,
        grow cyclic,
    level 1 concept/.append style={
        level distance=4.5cm,sibling angle=120,
        every child/.append style={concept color=red!50!green!40}, 
        },
    level 2 concept/.append style={
        level distance=3.5cm,sibling angle=35, 
         every child/.append style={concept color =red!50},
        }
]
    %\clip(0,-1)rectangle++(4,5);
    \node[root concept]{2\textsuperscript{nd} order PDEs}
        child
        {
            node{$\Delta > 0$}
            {
                child{node{Hyperbolic}}
            }
        }
        child
        {
            node{$\Delta = 0$}
            {
                child{node{Parabolic}}
            }
        }
        child
        {
            node{$\Delta < 0$}
            {
                child{node{Elliptic}}
            }
        };
\end{tikzpicture}
\end{center}
\end{document}

enter image description here

5
  • But this even destroyed the border on the root as well! :) I want the opposite. Do you think there is a way to get border on every thing?
    – Master.AKA
    Apr 19, 2020 at 19:57
  • 2
    @Master.AKA I added another version. I was a bit confused by the text=white, which doesn't look too good on a white background.
    – user194703
    Apr 19, 2020 at 20:02
  • Wow thank you!!!! I tried a lot of things for hours. I wished I had asked this here from the begenning! Thank you very very much... ☺ Why did I encounter such a problem?
    – Master.AKA
    Apr 19, 2020 at 20:07
  • 2
    @Master.AKA I think the pgf manual could be a bit clearer on the distinction between child and node and remind its reader on p. 721 of v3.1.5 that in the example on p. 722 the concept color gets passed to the child (and not to the node "under" it). One can post feature requests here. If you want me to, I could add one there.
    – user194703
    Apr 19, 2020 at 20:10
  • That's very kind of you. I think it's a good idea.
    – Master.AKA
    Apr 19, 2020 at 20:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .