我想将长文本对齐在圆柱体内,但无法将文本对齐到圆柱体的最左侧。
我的代码:
\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}
其输出:
这里能移动(Item1, Item2)
到气缸内部最左边吗?
想要的示例输出:
_____________
(_____________)
| Cloud |
| Storage |
|(Item1,Item2)|
\-------------/
答案1
我不确定您是否希望对不同的线条进行不同的对齐? - 或者所有内容都像这样居中:
\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}