如何才能使连续节点的边界完美重叠?

如何才能使连续节点的边界完美重叠?

为什么我的节点的垂直边框没有像水平边框那样重叠?我怎样才能强制它们重叠(从而防止节点之间的垂直线看起来更强)并避免第二条线右侧的长度问题?

顺便问一下,有没有可以代替的命令minimal width,比如类似这样的exact width

在此处输入图片描述

\documentclass[tikz]{standalone}
\usepackage{fourier}
\begin{document}
\xdef\LW{.99*241pt}%\linewidth
\xdef\BLS{\baselineskip} 

\begin{tikzpicture}[y={(0,-\BLS)},inner sep=0pt]

\node[draw,minimum width=1.2,minimum height=2.5*\BLS,text width=1cm,align=flush center,font=\scriptsize] (11) at (0,0) {Poids jusqu'\`a} ; 

\node[draw,anchor=north west,minimum width=(\LW-1.2cm),minimum height=\BLS,] at (11.north east) {Tarifs nets (\$)};

\node[draw,anchor=south west,minimum width=(\LW-1.2cm)*.24,minimum height=1.5*\BLS,align=flush center,font=\scriptsize,text width=1.6cm] (22) at (11.south east) {Vers France m\'etropolitaine};

\node[draw,anchor=south west,minimum width=(\LW-1.2cm)*.38,minimum height=1.5*\BLS,align=flush center,font=\scriptsize,text width=1.8cm] (23) at (22.south east) {Vers zone outre-mer 1};

\node[draw,anchor=south west,minimum width=(\LW-1.2cm)*.38,minimum height=1.5*\BLS,align=flush center,font=\scriptsize,text width=1.8cm] at (23.south east) {Vers zone outre-mer 2};

\end{tikzpicture}

\end{document}

答案1

好的,有答案了,我认为,我采取更简单的方法来画图:

\documentclass[tikz]{standalone}
    \usetikzlibrary{calc,chains}
    \usepackage{fourier}
\begin{document}
    \begin{tikzpicture}[
    node distance=0mm,
    start chain=going right,
box/.style = {name=n#1,
              draw, minimum height=9mm, text width=17mm, 
              inner sep=1mm, outer sep=0pt,
              font=\scriptsize, align=flush center, on chain}
                        ]
\node[box=11]       {Vers France m\'etropolitaine};
\node[box=12]       {Vers zone outre-mer 1\vphantom{p}};
\node[box=13]       {Vers zone outre-mer 2\vphantom{p}};
    \path let   \p1=(n11.west),
                \p2=(n13.east) ,
                \n1={veclen(\x2-\x1,\y2-\y1)} in
     node[box=21,minimum width=\n1,above right=of n11.north west]      
                    {Tarifs nets (\$)};
    \path let   \p1=(n11.south west),
                \p2=(n21.north west) ,
                \n1={veclen(\x2-\x1,\y2-\y1)} in
     node[box=0,minimum height=\n1,text width=9mm, above left=of n11.south west]
                    {Poids jusqu'\`a};
\end{tikzpicture}

\end{document} 

如果您希望底部框有不同的宽度,只需将文本宽度从框形状的通用定义移到特定框即可。测量它们的宽度和高度 \path let \p1=(...) ... 将确保上方框的长度和框的高度始终正确。

相关内容