![为什么梯形宽度会随着文字的变化而变化?](https://linux22.com/image/316878/%E4%B8%BA%E4%BB%80%E4%B9%88%E6%A2%AF%E5%BD%A2%E5%AE%BD%E5%BA%A6%E4%BC%9A%E9%9A%8F%E7%9D%80%E6%96%87%E5%AD%97%E7%9A%84%E5%8F%98%E5%8C%96%E8%80%8C%E5%8F%98%E5%8C%96%EF%BC%9F.png)
我想要的是具有一定宽度的形状。显然,如果梯形中的文本较少,它不会表现得更大。我在梯形中放入的文本越多,它就越小。有人能解释一下吗,也许能找到一个解决方案,让梯形在尺寸方面表现得像一个矩形?
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,positioning}
\tikzset{
trap/.style={
draw,
align=center,
minimum height=4em,
text width=5em,
trapezium,
trapezium left angle=70,
trapezium right angle=-70,
},
rect/.style={
draw,
align=center,
minimum height=4em,
text width=5em,
rectangle,
},
}
\begin{document}
\begin{tikzpicture}
\node [trap] (one) { not5em}; %this has the largest width
\node [trap,below = of one] (two) {somehow smaller}; %this is smaller
\node [trap,below = of two] (three) {the smallest one}; %this is even smaller
\node [rect, right = of one] (one1) {5em}; %this has the largest width
\node [rect,below = of one1] (two1) {same width}; %this is smaller
\node [rect,below = of two1] (three1) {again same width}; %this is even smaller
\end{tikzpicture}
\end{document}