3

I want to align long text inside a cylinder, but I was not able to align the text to the most left side of it.

my code:

\documentclass[tikz, border=1cm]{standalone}
\usetikzlibrary{shapes}
\begin{document}
\begin{tikzpicture}
    \node[text width=1cm,
        text centered,
        cylinder,
        shape border rotate=90,
        draw, minimum height=0.5cm,
        minimum width=1.6cm, shape aspect=0.4,
        font={\scriptsize\baselineskip=8pt},
        fill=white,
        preaction={draw, white, line width=15pt}]
    {Cloud Storage (Item1,Item2)};
\end{tikzpicture}
\end{document}

its output:

enter image description here

Here is it possible to shift (Item1, Item2) to the most left side inside the cylinder?

wanted example output:

enter image description here

 _____________
(_____________)
|   Cloud     |
|  Storage    |
|(Item1,Item2)|
\-------------/

1 Answer 1

3

I am not sure if you want different alignment for the different lines? -or everything centred like this:

\documentclass[tikz, border=1cm]{standalone}
\usetikzlibrary{shapes}
\begin{document}
\begin{tikzpicture}
\node[
cylinder,
shape border rotate=90,
draw, 
minimum height=0.5cm,
shape aspect=0.4,
font={\scriptsize\baselineskip=8pt},
inner xsep=0pt,
align=center,
]
{Cloud\\Storage\\(Item1,Item2)};
\end{tikzpicture}
\end{document}

Cylinder with centred text

0

You must log in to answer this question.

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