LaTeX forum ⇒ Graphics, Figures & TablesLarge Text in Mindmap Node Topic is solved

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

Postby histrion » Thu Feb 14, 2013 12:03 am

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 6828 times


Here is my code :
  1. \makebox{
  2. \begin{minipage}{\linewidth} \centering
  3. \begin{tikzpicture}[mindmap,level 1 concept/.append style={level distance=150, sibling angle=72}]
  4. \begin{scope}[mindmap, concept color=light-gray, text=black]
  5. \node[concept] {appeler \footnotemark[1] \\ omen } [clockwise from=0]
  6. 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 }}
  7. 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 }}
  8. child {node [concept] {\emph{Bulle 3 } \\ propulsion appellation appel \footnotemark[10] }}
  9. child {node [concept] {\emph{Bulle 4 } \\ propulseur \footnotemark[11] }}
  10. child {node [concept] {\emph{Bulle 5 } \\ répulsion }}
  11. ;
  12. \end{scope}
  13. \end{tikzpicture}
  14. \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}
  15. \end{minipage}}

thank you in advance.

Tags:

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Thu Feb 14, 2013 10:55 am

You can specify a certain width and alignment for text inside a node.
  1. \documentclass[11pt]{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage{selinput}
  4. \SelectInputMappings{
  5. agrave={à},
  6. eacute={é}
  7. }
  8. \usepackage{tikz}
  9. \usetikzlibrary{mindmap}
  10.  
  11. \begin{document}
  12. \begin{tikzpicture}[
  13. mindmap,
  14. level 1 concept/.append style={
  15. level distance=220,
  16. sibling angle=72
  17. }
  18. ]
  19. \begin{scope}[
  20. mindmap,
  21. concept color=gray!50,
  22. text=black
  23. ]
  24. \node[concept] {appeler\footnotemark[1]\\ omen} [clockwise from=0]
  25. 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}}
  26. 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 }}
  27. child {node[concept] {\emph{Bulle 3} \\ propulsion appellation appel\footnotemark[10]}}
  28. child {node[concept] {\emph{Bulle 4} \\ propulseur\footnotemark[11]}}
  29. child {node[concept] {\emph{Bulle 5} \\ répulsion }};
  30. \end{scope}
  31. \end{tikzpicture}
  32. \end{document}



Best regards and welcome to the board
Thorsten
Attachments
tmp.png
tmp.png (13.02 KiB) Viewed 6816 times
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

histrion
Posts: 6
Joined: Wed Feb 13, 2013 9:52 pm

Postby histrion » Thu Feb 14, 2013 11:41 am

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: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Thu Feb 14, 2013 6:32 pm

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.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

histrion
Posts: 6
Joined: Wed Feb 13, 2013 9:52 pm

Postby histrion » Thu Feb 14, 2013 7:15 pm

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: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Thu Feb 14, 2013 7:51 pm

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.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

histrion
Posts: 6
Joined: Wed Feb 13, 2013 9:52 pm

Postby histrion » Fri Feb 15, 2013 12:31 pm

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: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Fri Feb 15, 2013 6:46 pm

No idea. Perhaps you can correct the behaviour by varwidth.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

histrion
Posts: 6
Joined: Wed Feb 13, 2013 9:52 pm

Postby histrion » Mon Feb 18, 2013 4:42 pm

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:
  1. child {node[concept,text badly centered,text width=\radius,inner sep=4pt]{...}}

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Mon Feb 18, 2013 7:36 pm

Perhaps with shapepar.
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 5 guests