0

I am trying to draw a cloud with text inside using this guide (https://latexdraw.com/cloud-shape-in-tikz/).

\documentclass[border=0.2cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.symbols}
\begin{document}
\begin{tikzpicture}
    \node[text width=0.55cm,text centered]
    [execute at begin node=\setlength{\baselineskip}{8pt},
        cloud,
        draw] (c) at (0,0)
    {\scriptsize{Lost\\Broker}};
\end{tikzpicture}
\end{document}

its output

enter image description here

Here as you can see Golden part i not perfectly centered, should be shift little bit right. I have used text centered, which did not helped.

Is it possible to aligh the text perfectly in center?

wanted text should be:

  TeX   
 Golden // shifted 1 character to left
alper
  • 1,389

1 Answers1

3

Reduce the inner sep and raise your text width.

center text in cloud node

\documentclass[border=0.2cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.symbols}
\begin{document}
\begin{tikzpicture}
    \node[text width=0.8cm,inner sep=0pt]
    [execute at begin node=\setlength{\baselineskip}{8pt},
        cloud,
        draw] (c) at (0,0)
    {\scriptsize{Lost\\Broker}};
\end{tikzpicture}
\end{document}
SebGlav
  • 19,186
  • 1
    Thanks for the fast answer :-) – alper Jun 30 '22 at 17:35
  • 1
    [align=center] makes [text width=...] redundant. Basically you are putting a tabular inside a \parbox. – John Kormylo Jul 01 '22 at 01:43
  • You'r right, I'm not familiar with those lower properties. I'll edit my answer accordingly. – SebGlav Jul 01 '22 at 16:21
  • @SebGlav I have asked another question related to your answer: https://tex.stackexchange.com/questions/650114/how-can-i-wrap-a-text-in-a-rectange-inside-a-cloud . Its kind of simple I just want to wrap the text inside a rectangle if possible – alper Jul 07 '22 at 10:37