LaTeX forum ⇒ Graphics, Figures & TablesBubble text Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
bstex
Posts: 27
Joined: Mon Oct 23, 2017 10:22 am

Bubble text

Postby bstex » Mon Oct 23, 2017 3:08 pm

Hi.
I would like to place an image (a talking man) with a bubble text on it, just like in the image:
bubble.jpg
bubble.jpg (12.56 KiB) Viewed 280 times

I followed some tutorials, but no luck.
Can you help me please?
Thank you.

User avatar
Stefan Kottwitz
Site Admin
Posts: 8534
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Tue Oct 24, 2017 8:08 pm

Hi,

welcome to the forum!

This can be a start:

  1. \documentclass{article}
  2. \usepackage[demo]{graphicx}
  3. \usepackage{tikz}
  4. \usepackage{lipsum}
  5. \usetikzlibrary{positioning,shapes.callouts}
  6. \begin{document}
  7. \begin{tikzpicture}
  8. \node (man) {\includegraphics{man}};
  9. \node [draw, align=center,
  10. cloud callout, cloud puffs = 17, cloud puff arc=140,
  11. callout pointer segments = 3, anchor = pointer,
  12. callout relative pointer = {(330:2cm)},
  13. aspect = 3, above left = 1.2 and 2 cm of man.north west]
  14. {This is some text\\and some more in the next line.\\That's all.};
  15. \end{tikzpicture}
  16. \end{document}


You can read about cloud callouts in the tikz manual.

Stefan
Site admin

bstex
Posts: 27
Joined: Mon Oct 23, 2017 10:22 am

Postby bstex » Tue Oct 24, 2017 10:13 pm

Hi Stefan,
I didn't even know that they are called "callouts".
Thank you so much for your help. ;)

bstex
Posts: 27
Joined: Mon Oct 23, 2017 10:22 am

Postby bstex » Wed Nov 01, 2017 1:35 pm

Hi again,
I changed my preamble to this:
  1. \usepackage[Greek,Latin]{ucharclasses}
  2.  
  3. % Language declaration
  4. \usepackage{xltxtra}
  5.  
  6. \usepackage{polyglossia}
  7. \setmainlanguage{greek}
  8. \setotherlanguages{english}
  9.  
  10. \setTransitionsForGreek{\selectlanguage{greek}}{\selectlanguage{english}}
  11.  
  12. % Fonts
  13. \setmainfont[Kerning=On,Mapping=tex-text]{Myriad Pro}

because it's much easier to switch languages inside my book.

Since then, my callout code:
  1. \begin{flushright}
  2. \begin{tikzpicture}
  3. \node (man) {\includegraphics{man}};
  4. \node [draw, align=center,
  5. cloud callout, cloud puffs = 19.5, cloud puff arc=90,
  6. callout pointer segments = 2, anchor = pointer,
  7. callout relative pointer = {(345:2.5cm)},
  8. aspect = 3, above left = -1.5 and 2.5 cm of man.north west]
  9. {Ένα δύο τρία\\
  10. τέσσερα πέντε έξι\\
  11. επτά οκτώ εννιά\\
  12. δέκα έντεκα};
  13. \end{tikzpicture}
  14. \end{flushright}


shows me this error:

  1. ! Package tikz Error: Giving up on this path. Did you forget a semicolon?.
  2. See the tikz package documentation for explanation.
  3. Type H <return> for immediate help.
  4. ...
  5. l.100 ^^Iτ
  6. έσσερα πέντε έξι\\
  7. This error message was generated by an \errmessage
  8. command, so I can't give any explicit help.
  9. Pretend that you're Hercule Poirot: Examine all clues,
  10. and deduce the truth by order and method.
  11. Missing character: There is no = in font nullfont!
  12. ! Illegal unit of measure (pt inserted).
  13. <to be read again>
  14. =
  15. l.100 ^^Iτ
  16. έσσερα πέντε έξι\\
  17. Dimensions can be in units of em, ex, in, pt, pc,
  18. cm, mm, dd, cc, bp, or sp; but yours is a new one!
  19. I'll assume that you meant to say pt, for printer's points.
  20. To recover gracefully from this error, it's best to
  21. delete the erroneous units; e.g., type `2' to delete
  22. two letters. (See Chapter 27 of The TeXbook.)
  23. Missing character: There is no = in font nullfont!
  24. Missing character: There is no ^^B in font nullfont!
  25. Missing character: There is no τ in font nullfont!
  26. Missing character: There is no έ in font nullfont!


When I insert english text inside the callout, it works fine.
Why does greek text have problem with the tikzpicture?

User avatar
Stefan Kottwitz
Site Admin
Posts: 8534
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Wed Nov 01, 2017 8:06 pm

It works when you hide it in a \parbox:

  1. \documentclass{article}
  2. \usepackage[demo]{graphicx}
  3. \usepackage{tikz}
  4. \usepackage[Greek,Latin]{ucharclasses}
  5.  
  6. % Language declaration
  7. \usepackage{xltxtra}
  8.  
  9. \usepackage{polyglossia}
  10. \setmainlanguage{greek}
  11. \setotherlanguages{english}
  12.  
  13. \setTransitionsForGreek{\selectlanguage{greek}}{\selectlanguage{english}}
  14.  
  15. % Fonts
  16. \setmainfont[Kerning=On,Mapping=tex-text]{Times New Roman}
  17. \usetikzlibrary{positioning,shapes.callouts}
  18. \begin{document}
  19. \begin{flushright}
  20. \begin{tikzpicture}
  21. \node (man) {\includegraphics{man}};
  22. \node [draw, align=center,
  23. cloud callout, cloud puffs = 19.5, cloud puff arc=90,
  24. callout pointer segments = 2, anchor = pointer,
  25. callout relative pointer = {(345:2.5cm)},
  26. aspect = 3, above left = -1.5 and 2.5 cm of man.north west]
  27. {\parbox{3cm}{\centering Ένα δύο τρία\\
  28. τέσσερα πέντε έξι\\
  29. επτά οκτώ εννιά\\
  30. δέκα έντεκα}};
  31. \end{tikzpicture}
  32. \end{flushright}


Stefan
Site admin

bstex
Posts: 27
Joined: Mon Oct 23, 2017 10:22 am

Postby bstex » Wed Nov 01, 2017 11:12 pm

Thanks again, Stefan. ;)


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: No registered users and 6 guests