Graphics, Figures & TablesLarge Text in Mindmap Node

Information and discussion about graphics, figures & tables in LaTeX documents.
histrion
Posts: 6
Joined: Wed Feb 13, 2013 9:52 pm

Large Text in Mindmap Node

Post by histrion »

hello,

I use tikZ to draw a mindmap. My problem is that my text is rendered in a high thin column, instead of a block, like this:
bulles.jpg
bulles.jpg (34.62 KiB) Viewed 10204 times
Here is my code :

Code: Select all

\makebox{
 \begin{minipage}{\linewidth} \centering
  \begin{tikzpicture}[mindmap,level 1 concept/.append style={level distance=150, sibling angle=72}]
   \begin{scope}[mindmap, concept color=light-gray, text=black]  
    \node[concept] {appeler \footnotemark[1]  \\ omen } [clockwise from=0] 
     child {node [concept] {\emph{Bulle 1 } \\ répulsif repousser rappeler pulsion pulser pulsation poussoir poussette \footnotemark[2] pousser pousse-pousse \footnotemark[3] pousse-café pousse pouls \footnotemark[4] impulsif impulser \footnotemark[5] expulser époustoufler compulsoire compulsion \footnotemark[6] compulsif compulser appellation appellatif \footnotemark[7] appelant appeau appeal }}
     child {node [concept] {\emph{Bulle 2 } \\ sex repoussoir repoussant rappel pulsionnel pulsion pulsatile pulsatif propulser poussif poussée pousse-café interpeller interpellation interpellateur impulsivité impulsion expulsion appellatif \footnotemark[8] appel \footnotemark[9] appeau }}
child {node [concept] {\emph{Bulle 3 } \\ propulsion appellation appel \footnotemark[10] }}
     child {node [concept] {\emph{Bulle 4 } \\ propulseur \footnotemark[11] }}
     child {node [concept] {\emph{Bulle 5 } \\ répulsion }}
 ; 
   \end{scope} 
  \end{tikzpicture} 
   \footnotetext[1]{\normalsize ~commentaire de appeler} \footnotetext[2]{\normalsize ~dfsfdgsdfgfgfgh} \footnotetext[3]{\normalsize ~sdffghdfghd} \footnotetext[4]{\normalsize ~fghfgh} \footnotetext[5]{\normalsize ~sdfgdfgdfgdfggfgghdfghsdfg} \footnotetext[6]{\normalsize ~fdgsgfhfghdfghd} 
 \end{minipage}}
thank you in advance.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Large Text in Mindmap Node

Post by localghost »

You can specify a certain width and alignment for text inside a node.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{selinput}
\SelectInputMappings{
  agrave={à},
  eacute={é}
}
\usepackage{tikz}
\usetikzlibrary{mindmap}

\begin{document}
  \begin{tikzpicture}[
    mindmap,
    level 1 concept/.append style={
      level distance=220,
      sibling angle=72
    }
  ]
    \begin{scope}[
      mindmap,
      concept color=gray!50,
      text=black
    ]  
      \node[concept] {appeler\footnotemark[1]\\ omen} [clockwise from=0]
        child {node[concept,text width=14em,text centered] {\emph{Bulle 1}\\ répulsif repousser rappeler pulsion pulser pulsation poussoir poussette\footnotemark[2] pousser pousse-pousse\footnotemark[3] pousse-café pousse pouls\footnotemark[4] impulsif impulser\footnotemark[5] expulser époustoufler compulsoire compulsion\footnotemark[6] compulsif compulser appellation appellatif\footnotemark[7] appelant appeau appeal}}
        child {node[concept,text width=14em,text centered] {\emph{Bulle 2}\\ sex repoussoir repoussant rappel pulsionnel pulsion pulsatile pulsatif propulser poussif poussée pousse-café interpeller interpellation interpellateur impulsivité impulsion expulsion appellatif\footnotemark[8] appel\footnotemark[9] appeau }}
        child {node[concept] {\emph{Bulle 3} \\ propulsion appellation appel\footnotemark[10]}}
        child {node[concept] {\emph{Bulle 4} \\ propulseur\footnotemark[11]}}
        child {node[concept] {\emph{Bulle 5} \\ répulsion }};
    \end{scope}
  \end{tikzpicture}
\end{document}

Best regards and welcome to the board
Thorsten
Attachments
tmp.png
tmp.png (13.02 KiB) Viewed 10192 times
histrion
Posts: 6
Joined: Wed Feb 13, 2013 9:52 pm

Re: Large Text in Mindmap Node

Post by histrion »

thank you for your answer, and your welcome :).

I have a lot of such graphs in my file, so I would like to define the width automatically...

I generate the tex file with a (haskell) code, so I can implemente any function ; do I have to count the words in each node and set the width to something like the squareroot of this number ?

any better idea ?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Large Text in Mindmap Node

Post by localghost »

histrion wrote:[…] do I have to count the words in each node and set the width to something like the squareroot of this number ? […]
I don't see that necessity.
histrion wrote:[…] any better idea ?
No.
histrion
Posts: 6
Joined: Wed Feb 13, 2013 9:52 pm

Large Text in Mindmap Node

Post by histrion »

I don't see that necessity.
I want automatic small circles (so small text width) when there is few words, and big circles when there is a lot of words (large text width),

if it's not done automatically, I have to calculate the width, and it seems to me that the desired size is proportional to the square root of the number of characters,

am I wrong ?

(and the same for the level distance)
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Large Text in Mindmap Node

Post by localghost »

histrion wrote:[…] if it's not done automatically, I have to calculate the width, and it seems to me that the desired size is proportional to the square root of the number of characters […]
May be. But since I don't have the time to think about that in detail, you will have to find that out by yourself.
histrion
Posts: 6
Joined: Wed Feb 13, 2013 9:52 pm

Re: Large Text in Mindmap Node

Post by histrion »

hello again

I just tried my solution, and it works quite fine.

But I still have one problem :
as in the exemple in your first answer,
when I define a text width,
the centering doesn't work well : the text is centered, but closer to the left than to the right.

I guess it's because the desired width is ragged left, and doesn't exactly fits the real width of the circle...

any idea ?

thank you in advance.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Large Text in Mindmap Node

Post by localghost »

No idea. Perhaps you can correct the behaviour by varwidth.
histrion
Posts: 6
Joined: Wed Feb 13, 2013 9:52 pm

Large Text in Mindmap Node

Post by histrion »

I didn't manage to make it work with varwidth. But, thinking about it, I may have an other solution.

Is it possible to get the value, for example, of the node radius? In that case, I could define a much more accurate text width value, and my text will be centered.

For example something like that with a parameter \radius:

Code: Select all

   child {node[concept,text badly centered,text width=\radius,inner sep=4pt]{...}}
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Large Text in Mindmap Node

Post by localghost »

Perhaps with shapepar.
Post Reply