为什么梯形宽度会随着文字的变化而变化?

为什么梯形宽度会随着文字的变化而变化?

我想要的是具有一定宽度的形状。显然,如果梯形中的文本较少,它不会表现得更大。我在梯形中放入的文本越多,它就越小。有人能解释一下吗,也许能找到一个解决方案,让梯形在尺寸方面表现得像一个矩形?

\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}

梯形与矩形节点

相关内容